Country Tweet Analysis is a project done using twitter API and tweepy to analyze country-wise trending topics .
- Search your favourite country .
- See the latest trends .
- Analyze how people react .
Country Tweet Analysis uses the following API , modules and Python to run .
- Twitter API - Create Developer account in Twitter .
- Visual Studio code - code editor (optional) .
- Python - Python 2.7 or 3.6
Install the software and required modules as given below .
Run the following commmand in command prompt .
pip install tweepy
pip install textblob
pip install json
To clean tweets, use preprocessor .
pip install preprocessor
To plot the sentiments of tweets .
pip install matplotlib
- Create an app using twitter developer account .
- Copy all the necessary keys and tokens .
- Open Visual Studio code editor .
- Connect to the twitter app using your API .
-
consumerKey = 'Enter your consumer key' consumerSecret = 'Enter your Consumer secret key' accessToken = 'Enter your access token' accessTokenSecret = 'Enter your access token secret key'
- Enter your Favourite Country .
- Search from the available trending topics .
- Tweepy - An easy-to-use Python library for accessing the Twitter API.
- TextBlob - TextBlob is a Python (2 and 3) library for processing textual data.
- matplotlib - Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy.
- JSON - JSON is a lightweight data interchange format inspired by JavaScript object literal syntax .