Overview
I recently created TweetTracker.js as replacement for TweetTracker.rb. This blog post is actually TweetTracker.js's README. It describes the outcome, purpose, and techology stack used in the creation of TweetTracker.js. I created this README in such a way where it could also serve as a blog post. I feel like this app solves common data visualiations problems in a unique way and hopefully sharing it in this blog format will offer value to others in the future. Hope you enjoy it!
TweetTracker.js
TweetTracker.js is a tool for creating data visualizations of Tweet data. Users have the ability to select from a range of keywords and view graphs generated in real time based on their keyword selection. TweetTracker.js runs a background process which listens for tweets using Twitters streaming API. As tweets are received they are filtered by keywords and location. Valid tweets are then persisted to the database and later retrieved to generate a dynamic graph based on user input.
Demo Screenshot
Technologies Used
How TweetTracker.js Storage Works
A tweet is persisted to MongoDB when it is in the correct geographic range, and when it has at least one keyword match. When a match occurs, the following attributes are persisted to MongoDB:
- Tweet message
- Matched keyword
- City where Tweet occurred
- CreatedAt timestamp
If a tweet contains more than one keyword, the first keyword which is detected will be the keyword that is persisted to the database. Tweets containing more than one keyword will only have the very first keyword detected count towards influencing keyword frequencies. The other matched keywords in the tweet will be ignored and will not be accounted for later during the graph generation phase.
History of TweetTracker.*
TweetTracker.js is the successor of TweetTracker.rb. TweetTracker.js has the following advantages over its predecessor:
- Dramatic increase in performance. JavaScript's asynchronous nature makes running multiple background processes (such as listening for tweets/persisting tweets to database) simple and efficient.
- Improved user experience. Users can now select the keywords that are being listened to and generate graphs in real time.
- Dynamic and customizable graphs. Users have the ability to manipulate graph data directly from their browsers.
- Source code has increased readability. Enough said