Plotting tweets in real-time using Smoothie Charts and Kwwika
I noticed a tweet today about real-time JavaScript charts and couldn’t resist having a play. The charts are call Smoothie Charts and have been developed by Joe Walnes. You can read the blog post where he announced the release of them here.
The demos that I’ve seen don’t use real-time data so I thought I would create a small demo using real-time tweets being pushed through Kwwika. I updated the Kwwika TweetStreamer component (which I must get around to putting in GitHub) to push through updates from some popular hashtags including #nowplaying, #news, #tech and a few others and then wrote a bit of code to count the number of tweet updates over an interval and push that value into a Smoothie chart. The result looks like this (Smoothie charts use Canvas so only work in some browsers. I’ve tested this demo in Firefox and Chrome):
You can see the Smoothie Twitter Real-Time Charting demo using Kwwika here: http://kwwika.com/Standalone/Demos/javascript-examples/smoothie-twitter-charting/
I’ve got the Smoothie chart showing the number of updates for each twitter hashtag, a table showing the count and a list of the tweets at the bottom.
The code is in GitHub so feel free to fork/download and have a play yourself. You can run the code on http://localhost but in order to get the code to work on your own website you’ll need to register with Kwwika and get in touch to let us know you want access to the real-time Twitter hashtag topics.
Update: We found a bug in the Smoothie library which Joe Walnes promptly fixed.
One thing we’ve noticed is that the Smoothie chart stops working and throws an exception and as yet we’ve not been able to work out what the problem is due to lack of time. It’s probably something to do with not getting any updated values in a TimeSeries. This is what the exception look like in Firebug:
If anybody can work out what the problem is please let us know. Failing that we’ll look into it when we can.
Related posts:
- Kwwika-Superfeedr real-time demo available
- Kwwika World Cup 2010 Real-Time Push Web App – Apple iPad competition
- Kwwika Powered Real-Time Opta Sports Cricket Widget
- Add real-time news to your site with Google. Add any real-time data to your site with Kwwika
- Marriage, Work/life integration, real-time web technology evangelism & Kwwika: A retrospective of my 2010
-
J. Eaton
About Phil Leggetter
My name is Phil Leggetter and I'm a Developer Evangelist at Pusher, a Real-Time Web Software and Technology Evangelist and Consultant, software engineer, team leader, line manager, micropreneur, product developer, Twitter user and a keen user of social media. For more information see the About Phil Leggetter page.
Social
Tags
.NET Ajax API APIs ASP.NET MVC Bing Blogging C# cloud comet Community DataSift Facebook Google Hardware http streaming ian sanders ideas Internet JavaScript Kwwika Life Mapping Microsoft Mobile Phones pubsubhubbub pusher real-time real-time data real-time push real-time web realtime RSS RTRIA Scotland silverlight Social Media Software Development Superfeedr truly real-time truly real-time web Twitter web 2.0 websockets Whinge











