UPDATE: I was using this script on my site for a little while but I’ve since switched to a more versatile WordPress plugin called wp-lifestream.
I’ve been using a great script from Remy Sharp to pull updates from Twitter (using JSON) and present them using AJAX. It’s a versatile tool but only works with Twitter, so I wanted to build on it to create a similar script to present a lifestream pulled from various web services – Digg, Facebook, Flickr, etc.
The problem is getting the data as JSON, some services offer this up but for the others I had to use Yahoo! Pipes to convert RSS feeds to JSON.
I’ve added methods for each web service I wanted to use (although I want to create generic methods in the future) and used a call-back to process the returned JSON and update the page using the DOM.
The methods are called as follows:
getDiggs(‘target_id’, ‘username’, ‘root_site’, 5, { clearContents: true, timeout: 5000, enableLinks: true, printDescription: true, printDiggCount: true, printTime: false });
It was fun to play around using JSON and DOM manipulation, I’ll probably get around to updating this code at some point.