This project is a geographic visualization of Twitter data across the USA, analyzing the sentiments of the tweets based on certain key words. It is a project of the CS61A course at UC Berkeley.
This repository includes a sample tweets data in 2011 as a txt file, located under the /data direcotry. There is also a compressed file with more data.
python3 trends.py -m <keyword>
python3 trends.py -m texas
python3 trends.py -m sandwich
python3 trends.py -m obama
python3 trends.py -m "my life"
- Collecting public Twitter posts (tweets) that have been tagged with geographic locations and filtering for those that contain the "texas" query term,
- Assigning a sentiment (positive or negative) to each tweet, based on all of the words it contains,
- Aggregating tweets by the state with the closest geographic center, and finally
- Coloring each state according to the aggregate sentiment of its tweets. Red means positive sentiment; blue means negative.