Yesterday, I stumbled onto Soup.io, which is a service that aggregates your social media activity (twitter, digg, rss feeds, flickr, etc) into one solid social timeline. For whatever reason, I thought “Hey, this would be a neat service to provide in a javascript file!” I’ll blame that reasoning on an early rise on a rainy day.
Anyway, I did some digging around the net, and found a JSON feed for both twitter and digg, as well as a free RSS to JSON converter. That seemed like it would be all I needed, so I decided to try and whip something up that would emulate the Soup.io end product, using just javascript.
It only took a few hours of tinkering before I had the script working the way I wanted (I still made it out for lunch with friends), so the endproduct I have online right now likely isn’t bug/error free. I’ve only tested it in FireFox 2 and Safari 3. That being said, it seems to work swimmingly in both of those browsers.
I named the script I wrote “stew”, which was the closest thing to soup I could think up at 8am, and it’s really easy to implement. A full implementation looks something like this:
<script src="stew.js"></script>
<script>
stew.twitter_username = 'krewenki';
stew.digg_username = 'krewenki';
stew.rss_feed = 'http://feeds.feedburner.com/warrendotmesozendotcom';
stew.rss_custom_badge = 'http://warren.mesozen.com/favicon.ico';
stew.write_script_tags();
</script>
And that’s it!
With that, your web browser contacts the services you specify, and grabs your most recent history, and formats in a nice timeline, organized by day of occurrence.
You can view a demo here, or download what i’ve got so far here.
Just a note, though. Since this uses javascript, and no serverside language, you can’t cache any content to show to your users. That means that in any sort of “high traffic” environment, this script would perform far too many HTTP requests to each of the providers of the services you’re displaying. With that in mind, this is more of a “just because I could” project, more than a “You can use it too” project. If you like the idea of this style, sign up for an account at http://soup.io because they do this the right way, and likely better than I do, anyway.
Cheers!