Being someone who has not followed Atom as much as the next super-geek, I’m clueless as to how enclosures are handled… I mean, I could have sworn someone was just namespacing in RSS 2.0 and using the <enclosure> element, but I find no docs on that… (And since Mark ain’t around to help with this…)

I guess there are “Atom enclosures” in the 0.8 draft

Should I be using this?

   src="http://foo.com/foo.mp3" />

Or perhaps this?

   href="http://foo.com/foo.mp3" />

I think they both pass the validator fine, but that doesn’t tell me what I should really be using or doing.

Searching gave no good results, and IM to smart people gave no solid answers… Argh… (Maybe in another 10 months I’ll have an answer.)

Oh yeah, it looks like the WordPress solution was to just use a function named rss_enclosure in the wp-atom.php file, which as you might guess, does the RSS 2.0 thing with <enclosure> in an Atom 0.3 file. I think I’d call that a bug

Update: My (test) Atom 0.3 Feed with Enclosures.

4 Responses to “Enclosures in Atom?”

  1. I haven’t been paying as much attention to enclosures as other parts, but I’d say “Maybe” and “No.”

    The first one would be correct and reasonable for remote content: you might have a summary and a title, but you have no content other than the MP3. For the second, you want rel="enclosure".

  2. Thanks Phil! I’ll go with what you suggest, which means I will re-write the code I already wrote since I picked the second one to implement.

  3. Bugger, no good on that either… At least with Atom 0.3 so I guess it’s back to <link rel=”related” …> since enclosure is not a valid link relationship :(

  4. Ah, 0.3 rather than 0.9+. The transition’s going to be interesting, isn’t it?

    I’d mention that someone really ought to be writing a transition guide, if it wasn’t for the little pitchers with big ears and a fondness for assigning tasks to whoever brings them up.

« | »

buy the button:

Buy The Button