Vous êtes sur la page 1sur 22

City/place rankings based on

semantic tracking through


online media.
Farooq Rasheed
Sp13-BCS-092
Muhammad
Sp13-BCS-092

Supervisor:
Ms. Shahela Saif

Scope

A web application that would allow all users to


access information about various cities of the
world list of which shall be provided.
The information would range from basic
information such as location and climate to more
detailed one, such as inhabitants and status.
We would also include the opinions of various
users that shall be gathered automatically from
multiple social media sites.

Modules
Data Extraction:Data will be gathered from
multiple sources and extract the required
information from it. Data gathering shall be done
periodically and automatically by using
crawler/scrapper.
Data analysis: Sentiment analysis will be
perform on data and sentiment polarity will be
assigned such as positive, negative and neutral.

Modules
Data representation: Results will be

represented in graphical and textual form.


Data storage: Analyzed data results will also be
saved in data base(MongoDb)

Mockups

APIs/Libraries
Request.js: Helps us make Http
requests.
Cheerio: Implementation of core
jQuery specifically for the server
(helps us traverse the DOM and
extract data).
Express.js: A framework for Nodes.js
that adds more features to Node.js.
Dattumbox API:

System Architecture
3-tier architecture will be used for the
system.
Presentation tier
Logic tier
Data tier
A physically separate middle-tier adds an
extra level of security to avoid giving direct
access of database to the user.

Design Methodology
Object-Oriented design methodology will
be followed. OOP methodology provides:
Reusability
Maintainability
Modularity and easy debugging. Each class
contains appropriate objects and methods.
Prototyping as software process model.
Reason is it reduces inherent project risk by
breaking a project into smaller segments
and providing more ease-of-change during
the development process.

Use Case Diagram

Data Representation

Class Diagram

Sequence Diagram

Algorithm &
Implementation

var request = require('request');


var cheerio = require('cheerio');
var URL = require('url-parse');

Generate_Ranking(city) {
var city,word,sent_pol;
var URL = require('http://www.twitter.com');
Dattumbox_API();
Scrapper();
Print(city,word,sent_pol);
}
Dattumbox_API() {
datum.twitterSentimentAnalysis("Canyoufindmy#sentiments#please?",f
unction(err,data){
if(err)
returnconsole.log(err);
console.log (data);});
}

Algorithm &
Implementation
Scrapper() {
request("https://www.twitter.com", function(error, response, body) {
if(error) {
console.log("Error: " + error);
}
console.log("Status code: " + response.statusCode);
var $ = cheerio.load(body);
$('div#siteTable > div.link').each(function( index ) {
var city = $(this).find('p.title > a.title').text().trim();
Dattumbox_API( WORD, sent_pol) ;
console.log("City: " + city);
console.log("Word: " + word);
console.log("Sentiment_polarity: " + sent_pol); });
Print(city,word,sent_pol){
fs.appendFile('output.json', "City:" + city + '\n' + "Word:" + word+ '\n' + "Sentiment_polarity:"
+ sent_pol + '\n');
});
}

References (If any)


PlacePulse
http://pulse.media.mit.edu/
Sperlings best places
http://www.bestplaces.net/
Money Senses best places to live in Canada
http://www.moneysense.ca/canadas-best-places-to-li
ve-2015-full-ranking/
http://www.Wikipedia.com
http://www.numbeo.com

Question and
Answers

Vous aimerez peut-être aussi