Geeks With Blogs

News

qrcode

Lance Robinson

Create Your Badge

Lance Robinson is a software engineer in Durham, Chapel Hill, Raleigh, and surrounding areas. More about Lance.

 Subscribe


Lance's TextBox » About Me » My Resume »Twitter

In my last post, I explained how RSSBus can be instructed to output JSON instead of RSS items.

This means that RSSBus can be used to output ANY feeds items in JSON, simply by creating a 3 line RSSBus Script that calls the target feed.  As an example, here's how I can get the latest digg.com technology topics in JSON:

1.  Create a new RSSBus Script that looks like so:


<
rsb:call op="http://digg.com/rss/containertechnology.xml">
  <rsb:push />
<
rsb:call>

2.  Hit the url http://localhost:1110/digg.rsb?@json.  Now you'll get back a giant chunk of JSON describing all of the latest digg technology items.

3.  If you just want to get the most recent topic, add one more like to the RSSBus script so that it will stop after it pushes the first item:

<rsb:call op="http://digg.com/rss/containertechnology.xml">
  <rsb:push />
  <rsb:break />
<
rsb:call>
Now you'll just get the one item.
Posted on Friday, August 11, 2006 10:32 AM Programming , Software | Back to top


Comments on this post: Output any feed as JSON

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Lance Robinson | Powered by: GeeksWithBlogs.net