Today I was working on completing the support for Atom 1.0 in the next version of RSS Bandit and decided to make the changes for parsing out enclosure/podcast elements while I was in that part of the code. RSS 2.0 is pretty straightforward, there is an <enclosure> element that is a child of the <item> element.
On the other hand, the Atom 1.0 specification has two completely different mechanisms for creating podcasts. Both mechanisms are described in the article by James Snell entitled An overview of the Atom 1.0 Syndication Format. From the article
Support for enclosures
Listing 4. Atom 1.0 podcasting example
<title>My Podcast Feed</title>
<name>James M Snell</name>
<link href="http://example.org" />
<link rel="self" href="http://example.org/myfeed" />
<link href="http://www.example.org/entries/1" />
<summary>An overview of Atom 1.0</summary>
<li>00:01:00 -- Introduction</li>
<li>00:15:00 -- Talking about Atom 1.0</li>
<li>00:30:00 -- Wrapping up</li>
Atom enclosures allow you to do more than just distribute audio content. Enclosure links can reference any type of resource. Listing 5, for instance, uses multiple enclosures within a single entry to reference translated versions of a single PDF document that's accessible through FTP. The
hreflang attribute identifies the language that each PDF document has been translated into.
In addition to support for links and enclosures, Atom introduces the ability to reference entry content by URI. Listing 6, for instance, illustrates how an Atom feed for a photo weblog might appear. The
content element references each individual photograph in the blog. The
summary element provides a caption for the image.
Listing 6. A simple list of images using Atom 1.0
<title>My Picture Gallery</title>
<name>James M Snell</name>
<title>Trip to San Francisco</title>
<link href="/entries/1" />
<summary>A picture of my hotel room in San Francisco</summary>
<content type="image/png" src="/mypng1.png" />
<title>My new car</title>
<link href="/entries/2" />
<summary>A picture of my new car</summary>
<content type="image/png" src="/mypng2.png" />
This content-by-reference mechanism provides a very flexible means of expanding the types of content that one can syndicate through Atom.
After looking at this from all angles for about 30 minutes the only conclusion I can come to is that Atom provided two completely different mechanisms of achieving the same goal. This is likely a potential gotcha for aggregator authors who might end up supporting one or the other of the mechanisms instead of both.
After this, I still have to add some code to also support Yahoo! Media RSS and then track down some feeds that actually use all the various enclosure techniques so I can test my code with actual real world scenarios. I'd appreciate any pointers to test feeds especially for the Yahoo! Media extensions to RSS [which I'm considering not supporting if there aren't that many feeds that use it].
No rest for the wicked. ;)