Menu

Developer guide

Baptiste Zorzi

Developers Guide

This page's purpose is to help developper have a better understanding of the code.

The code is divided into 3 files:

  • interface.js
  • Tweet.js ( actually not used! Should be deleted -- TODO )
  • tweetFonctions.js

We will see the goal of each one of those files, along with the location of the main code features ( e.g. tweet parsing )

Menu

Everything begins in the interface.js file, in the choixFichier() function, where the user gets to choose the date they want to analyse.

The dates choices depend on the folders present in the sample directory ( currently donnees ).

Once the date has been choosen, the user has access to the main menu ( mainMenu() function, still in the interface.js file ), where
He can chose what he wants to do among the following choices:

  • Change the day
    Comes back to the date menu
  • Get a tweet by author or by id
    Fetches a tweet by author or ID ( getsearchAuthor() or getSearchID() )
  • Get the top 10 most retweeted hashtags
    Gets the top 10 tetweeted hashTags ( top10RTH() )
  • Get the top 10 accounts that tweet the most
    Gets the top 10 accounts ( top10Authors() )
  • Get the hashtags associated with a reference hashtag
    Gets the linked hashtags by enumeration ( getMostRTHashtag() )
  • Display the top 10 tweets Regions that tweet the most
    Gets the top 10 location where there are the most tweets ( pourcentage() )
  • Display the number of tweets written in the specified period for the specified hashtag
    Asks the user for a date range, and gets the number of tweets sent during that period ( numberTweetOnPeriod() )
  • Quit
    Pretty self-explanatory

What those function actually do is just changing flags so that the tweetFonctions.main() can "know" what to do when it's called.

All the data parsing and computing is actually done in tweetFonctions.main() ! ( in the file tweetFonctions.js )

Available dates and Parsing

All the files are taken in account, and the dates are then extracted from those tweets.
The extracted dates are then parsed, and sorted. All that processing is made in the interface.js file.

All the parsing is taken care of by the csv-parser module

Features

As said before, each feature has an associated flag, and is then processed in the TweetFonctions.main() function.

Here is the list of feature - Flag variable name:

Feature Variable name
Search By ID searchByID
Search By Author searchByAuthor
Top 10 most retweeted hashtags mostRTHashtag
Top 10 users top10A
Top 10 regions that tweet the most tweetByCountry
Get associated hashtags top10RTHAshtag
Number of tweets for a specific date range numberTweetForH

Related

Wiki: Home

MongoDB Logo MongoDB