/TwitterSentimentAnalysis

WORK IN PROGRESS. This project will allow users to enter in a keyword or hashtag to search for on Twitter, as well as the number of Tweets to include in their search, and the program will return an analysis of the general sentiment of that topic.

Primary LanguagePython

Twitter Sentiment Analyzer

This is a work in progress project that I am starting to be able to let a user look up the general sentiment of tweets surrounding specific keyword(s) or hashtag(s).

Setup Instructions

Prerequisites:

  • Python 3.8.2+
  • Make sure you have the pipenv library installed.
  • Have a Twitter Developer account created, and have an application ready for this project.

Steps

  1. Clone this repo.
  2. Open a command prompt/terminal in the folder where the repo has been cloned, and run pipenv install.
  3. Create a folder called nltk_data anywhere.
  4. Create a file in the cloned folder named .env, and enter the contents using the following template:
NLTK_DATA={path to ntlk_data folder.}
TWITTER_CONSUMER_KEY={your Twitter application's consumer key}
TWITTER_CONSUMER_SECRET={your Twitter application's consumer key}
TWITTER_ACCESS_TOKEN={your Twitter application's access token}
TWITTER_ACCESS_SECRET={your Twitter application's access secret}
  1. Edit the main file, on line 40, and change the keyword argument to your search keyword, and change the num argument to the maximum number of tweets you want to search.
  2. Run pipenv run python main.py to start the program.