RSS, OPML and the XML platform.
Copyright 2012 World Readable
This morning, I was building an image and video application and needed some RSS sources to seed the image and video database. I picked three feed sources; Google Video, Yahoo! Video and Flickr. The first thing I noticed was that only Yahoo! Video used RSS enclosures, where as all three used Media RSS. I decided to write the code once using Media RSS and drop RSS enclosure support. I wasn't too happy about making this decision. Had Flick and Google simply used RSS enclosures in addition to the Media RSS, then I could've written this application for general RSS enclosure support. It's not like this would've been difficult as RSS enclosures look almost exactly like Media RSS content. A sample of each element follows.
<media:content url="http://www.youtube.com/v/aVN_VZhLiCg.swf" fileSize="30" type="application/x-shockwave-flash" height="356" width="450" duration="1"/>
Using an extension element in place of an equivalent core RSS element is what we call Funky RSS and much not appreciated by people trying to write RSS applications. The reason we don't appreciate it is because the core RSS elements are better understood and you don't end up with the ridiculous situation that I'm about to describe.
Although all three sources use Media RSS, I had to write separate code for all three implementations. All I wanted to do was access the media:content/@url attribute and all three conveniently had unique access paths to this variable. Here's three feeds that I'm looking at.
Using fully qualified element names, the access paths are as follow.