Things have been quite at the zoo recently so I've been assigned a project to capture chatter amongst the resident creatures. I'm taking a very learn-as-you-go approach to this challenge and so far have managed to create a working app that captures the twitter stream chattering about the eur/usd currency pair. You can see my progress at www.eurochatter.com but be fore-warned that it's a work in progress. Once you start seeing ads you'll know that I've solved most of the programming issues.
Here is a screenshot of what it looks like today:
Of course, this will not likely be its final styling format, but it's a start. The chart is generated by an open-source javascript library and has some cool features including the ability to get the values of various datapoints by mousing over the chart. Also, you can zoom in. Reloading the page brings it back to its original state.
The programming behind the app is a Ruby. It uses the Sinatra gem to serve the web page and it's currently being hosted at Heroku. I'm also using a Mongo database in the cloud, courtesy of MongoLab.
I still have a substantial hurdle to overcome in this app with regards to managing the database. I'm currently using a capped collection to store all tweets. I query the database as to its total and that's how the data is generated for the chart. But, as you can imagine, a capped collection reaches a limit at which point its total doesn't change. Only the contents does. I'm thinking that in the code block where I insert records into the database I can increment something there to avoid this limit problem, but I'm not sure.
Another problem will be that when I push changes up to the hosting company, the record of timestamped tweet totals will be erased. This is because the tweets.csv is being updated on Heroku servers. Meh, just another problem to solve. Kinda like a crossword.
I hope you enjoy the site. And remember to click on the ads after I get them up. I promise not to put up too many.

0 comments:
Post a Comment