这是indexloc提供的服务,不要输入任何密码
Skip to content

yiwentang/twitter-election-2016

Repository files navigation

twitter-election-2016

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.

  1. Install packages in the requirements.txt

  2. Go to twitter to aquire token and api key, then input the information into private.py

  3. Create a Sqilte Database, name it twitter_election. Run create_db.py to create tables

  4. Run 'bokeh serve' in terminal, then run app.py

bokeh_plot

About

Follow 2016 Presidential Election Using Twitter Data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages