Javascript web service aggregator

Posted on Nov 18, 2007. In Tech.

This was a project I started when I was looking into extracting data from various web services such as Digg, Facebook, Twitter, etc.

I came across this script by Remy Sharp to extract recent updates from the web service Twitter using JSON, and publish them to a webpage. I wanted to build upon this - using the JSON format to pull data from other web services.

The problem came in getting the data from the various services in the JSON format, some services offered this as standard, but for the ones that didn't i used the Yahoo! Pipes service to convert RSS feeds from the services to the JSON format.

I modified the original Twitter script to include methods for each web service I wanted to use, and used a callback method to process the JSON and update a target on the webpage using DOM scripting.

All that needs to be done to update a page with the desired data is link the script file and call the desired function with the required arguments:

getDiggs('target_id', 'username', 'root_site', 5, { clearContents: true, timeout: 5000, enableLinks: true, printDescription: true, printDiggCount: true, printTime: false });

Technology used:
  • Javascript
  • JSON
  • Yahoo! Pipes
  • RSS