Experimenting with the MS Feeds API
The Windows RSS platform includes a Feeds API that parses all forms of RSS and Atom to a simplified object model.
For example, an Item object has an Author property and not an author name, author e-mail and author URI which are all possible in Atom. And, an Item object has a Description field and not description and content (as in Wordpress feeds) or summary and content (as in Atom feeds).
So, how does the Feeds API decide how to map elements to this simplified object model? I did some C# experiments and here are some of my findings. Note that the Feeds API is beta software and will certainly change for the better (I hope) by the time it is released in IE7 and Windows Vista.
Item contains |
Feeds API returns |
<dc:creator>dave</dc:creator> | item.Author = "dave" |
<author>dave@example.com</author> | item.Author = "dave@example.com" |
<author>dave@example.com</author> <dc:creator>dave</dc:creator> |
item.Author = "dave" (prefers funky RSS) |
<description>my desc</description> <content:encoded>my content</content:encoded> |
item.Description = "my content" (prefers funky RSS) |
<pubDate> Thu, 9 Mar 2006 23:13:04 -0500 </pubdate> |
item.Date = "3/10/2006 4:13:04 AM" (uses GMT) |
<pubDate> Thu, 9 Mar 2006 23:13:04 -0500 </pubdate> <dc:date> 2004-08-19T11:54:37-08:00 </dc:date> |
item.Date = "3/10/2006 4:13:04 AM" (prefers core RSS element) |
<atom:summary>my summary</atom:summary> <atom:content>my content</atom:content> |
item.Description = "my content" |
First, it's interesting that those funky RSS elements that Winer dislikes are preferred over the core RSS elements in important places. And second, what if you're not happy with Microsoft's mapping choices in this area?
For example, how do you get both description and content from those Wordpress feeds? Wordpress (and Typepad) uses the <description> element as a summary and the funky <content:encoded> element for the full content (see Winer's own Wordpress.com feed for example). You've got to parse the XML yourself. The Feeds API tries to makes that easy by providing both the XML for the entire feed and the XML fragment for each item, but I think most developers would prefer to have a more complete object model.
See also: What's up with the Windows RSS Platform
Tags: topic:[rss], topic:[atom], topic:[feeds], topic:[ie7], topic:[vista]
Dave Johnson
in Blogging
• 🕒 03:46AM Mar 16, 2006
Posted by Bosko Milekic on March 17, 2006 at 02:35 PM EST #
Posted by Christian Mogensen on March 17, 2006 at 04:35 PM EST #