Can I serve RSS in JSON? Can I serve RSS in JSON? xml xml

Can I serve RSS in JSON?


No, RSS is an XML-based format, and JSON is an different language rather than some kind of dialect. RSS readers won't understand JSON.

Your question is akin to asking 'Can I speak French in Chinese?'


I believe this has been done already.

Take a look at this jQuery extension: jFeed - RSS/ATOM feed parser

jQuery.getFeed(options);

Options:

  • url:
  • data:
  • success:

Example:

jQuery.getFeed({       url: 'rss.xml',       success: function(feed) {           alert(feed.title);       }   });

Note that in this case, 'feed' would be a javascript object. If you wanted to pass this using JSON, you can just use the javascript JSON utility.

Example:

var myJSONText = JSON.stringify(feed);


Is the RSS spec (sans the XML part) a useful spec to conform to in this case?

If you want to invent yet another syndication format, I recommend using Atom as a base. IMHO it has much cleaner, more consistent design, and has useful features like reliable updates of past items, makes distinction between summaries and full content, etc.

I was wondering if this had been done already.

Flickr has JSON output format. They even have lolcode feed.