https://github.com/aryathel/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.
https://github.com/aryathel/twittersentimentanalysis
data-science data-visualization flask python twitter-api twitter-sentiment-analysis
Last synced: about 1 month ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/aryathel/twittersentimentanalysis
- Owner: Aryathel
- Created: 2021-02-20T07:07:29.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-08T03:36:10.000Z (about 5 years ago)
- Last Synced: 2023-03-06T05:52:12.660Z (about 3 years ago)
- Topics: data-science, data-visualization, flask, python, twitter-api, twitter-sentiment-analysis
- Language: Python
- Homepage:
- Size: 83 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://developer.twitter.com/) account created, and have an [application](https://developer.twitter.com/en/portal/dashboard) ready for this project.
### Steps
1. Clone this repo.
1. Open a command prompt/terminal in the folder where the repo has been cloned, and run `pipenv install`.
1. Create a folder called `nltk_data` anywhere.
1. 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](main.py#L40) 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.
1. Run `pipenv run python main.py` to start the program.