Follow 2016 Presidential Election Using Twitter Data
Using twttier streaming api to discover how many people are talking about Trump or Hillary
This repo is for demonstration purpose on how to collect, store, analyze and visualize data on the fly using Python, SQL, bokeh and twitter API, not necessarily complicated analysis. The analysis is actually very naive
This program stores the real time twitter data into Sqlite database. Eevry minute, it queries the data in the database and performs analysis. Finally it uses bokeh libaray to visulize the coverage for Trump and Hillary.
-
Install packages in the requirements.txt
-
Go to twitter to aquire token and api key, then input the information into private.py
-
Create a Sqilte Database, name it twitter_election. Run create_db.py to create tables
-
Run 'bokeh serve' in terminal, then run app.py