Skip to content

Using the Twitter API to perform sentiment analysis and find the happiest regions in the world.

Notifications You must be signed in to change notification settings

csr/Twitter-Sentiment-Analysis

Repository files navigation

Sentiment Analysis on Tweets

Getting Started

Sign up for a Twitter Developer account and add your API key, API secret, Access Token Key, and Access Token Secret to twitterstream.py to get started. You'll need Python 2.7 and Oauth2 installed on your machine to get started.

api_key = "YOUR_API_KEY"
api_secret = "YOUR_API_SECRET"
access_token_key = "YOUR_ACCESS_TOKEN_KEY"
access_token_secret = "YOUR_ACCESS_TOKEN_SECRET"

To download a stream of tweets and check that everything is working fine, enter in the following command into the terminal:

python twitterstream.py > output.json

This will create a continous stream of tweets and save it to a file named output.json. Let it run for a while to generate new tweets, and then press control + C on your keyboard to stop.

License

This directory is licensed under the MIT License.

About

Using the Twitter API to perform sentiment analysis and find the happiest regions in the world.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages