Wanting to test out the data-driven visualisation library d3.js and HTML5’s WebSocket, I wrote a Python script to monitor Justin Bieber tweets, used Pusher to send them to a web page, and modified Mike Bostock‘s d3 bar chart example code to show a rolling bar chart of the count each second. Here’s the GitHub repo.
Pusher is a great streaming data service, sparing you from writing up a slew of workarounds for the various degrees of WebSockets support in various browsers. As they put it: “We believe that your developer time is best spent making awesome features, not creating infrastructure.” For quick experiments and hacks I broadly agree.
My colleague Edd Parris and Pusher’s Developer Evangelist Phil Leggetter took my demo, put Twitter’s Bootstrap on the front end and hosted it with Heroku. You can see it running at bieber.nixonmcinnes.co.uk.