Skip to content

Hamatti/mit-twitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT-shootings Twitter Bot

Blog post

I blogged the process in Passion for Data blog. There are also the word cloud images.

Background

As MIT shootings started at 18th April 2013, I hacked a quick Twitter bot to keep track of hashtag #mitshooting. After 10 hours, I wordclouded the data.

Features

mit.py Every 15 seconds, the script fetches 15 tweets containing the hashtag #mitshooting and records the tweet and the username to database

analyse-mit.py The script fetches the tweets from the database and does cleaning (ignores couple of known spams), removes stopwords listed in stopwords.txt, removes punctuation, hashtags, mentions and links.

The script also creates hourly frequency files as well as combined frequency file for the entire 10 hours.

cloud_mit.r Read the frequency table and uses wordcloud library to create nice looking word clouds.

hourly_cloud.r Reads one frequency file per hour and creates corresponding word cloud

Contact

If you have any ideas to improve the code, feel free to fork and make a pull request to contribute. Or you can contact me via Twitter @hamatti.

Licence

Copyright (C) 2013 Juha-Matti Santala

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Wordcloud with 10 hours of twitter data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published