https://github.com/nikhilweee/poll-predictor
https://github.com/nikhilweee/poll-predictor
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nikhilweee/poll-predictor
- Owner: nikhilweee
- Created: 2016-04-19T11:15:37.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T21:33:59.000Z (about 2 years ago)
- Last Synced: 2025-01-22T09:09:54.312Z (4 months ago)
- Language: Python
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Poll Predictor
An app to predict the results of the US Presidential Elections of 2016.
Based on Sentiment Analysis using CNNs.## First Steps
The `twitter.py` script returns upto 100 tweets using the twitter API, but Twitter requires API requests to be authenticated using OAuth2.To do so, first obtain your credentials by creating an app on [apps.twitter.com](https://apps.twitter.com/) to get a `consumer_key` and `consumer_secret`
Then, create a file named `credentials.py` and key in the following
```python
consumer_key = ''
consumer_secret = '''
```Also, make sure to install the dependencies using
```
$ pip install -r requirements.txt
```## Usage
Just run the script with the search query as arguments. For example, to search for *Barack Obama*, just run
```
$ python twitter.py barack obama
```
This should generate a file named `barack-obama.py` with the tweets listed.