Sunday, April 22, 2007

Rssreader Feeds

The Google AJAX API team has announced a genuinely useful Feed API that gives an Ajax developer the ability to access feeds, cached in the fast Google edge cache where appropriate, from across the web using a simple JavaScript API.

This is a subtle service that does one thing that is currently a pain-point for developers of certain applications. Ajax developers now have a clean way to access public feeds on any domain, and get access to the content in a uniform way.

Gone is the need for us to create a proxy on the server to access feeds from other domains.

Gone is the need to have to deal with all of the feed types. RSS, Atom, RDF, we can now use either MIXED_FORMAT or JSON_FORMAT to use the uniform access. The full set of feed formats supported is Atom 1.0, Atom 0.3, RSS 2.0, RSS 1.0, RSS 0.94, RSS 0.93, RSS 0.92, RSS 0.91, RSS 0.9. The unified feed result elements are: title, link, description, author and a list of entries[]. The entries[] list has the following elements: title, link, content, contentSnippet, publishDate, and categories.

XML and mixed formats allow you to also get access to the XML document itself, and then you can use standard DOM tactics to get what you want from that content (e.g. getElementsByTagName). You would want to use XML if you needed to grab out something specific from the feed, such as the digg:count.

No comments:

Choose Referral Unit