Skip to content

Debanik/Tweet-based-Trends-plotting-using-Hashtags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tweet-based-Trends-plotting-using-Hashtags

Tweet Based Trends plotted on maps using hashtags uses Twitter data, more importantly the tweet text and sentimentally analyses it to output a feeling index and the tweet location, on the other hand, is simultaneously projected on a world map. This can be used for getting a bird's eye view of the current trends going on in the world, regarding any issues such as social, economic, cultural or political overview of a specific area.

Getting Started

Input: A twitter hashtag and the limiting value of how many tweets are to be extracted.

Output: An HTML file, to be opened in any browser for displaying the map.

A sample HTML output file is uploaded to this repo where the hashtag input was 'bjp' and the limiting value was 1000.

Instructions to run the code

Step 1 $ git clone https://github.com/Debanik/Tweet-based-Trends-plotting-using-Hashtags.git

Step 2 $ python3 -m virtualenv myenv

Step 3 $ source myenv/bin/activate

Step 4 $ pip install -r requirements.txt

Step 5 $ Edit twitter.py and insert your own Twitter API credentials

Step 6 $ python twitter.py

Viola! If everything worked correctly, you'll find a twittermap.html file with the geocoded data.

Built With

  • TextBlob - For sentimentally analysing the tweets.
  • Folium - For creating a Leaflet map from location parameters.
  • Tweepy - An open source API for fetching twitter data.
  • Geopy - For geocoding the location name to latitude and longitude pairs.
  • Tweet-Preprocessor - For cleaning the tweets

Contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published