Simplepie offers a good reliable Enclosure Object. Presently getting at the enclosures in ->raw isn't completely reliable, or clean. The parser_ already presents the author object. So I've coded a few lines to present appropriate object(s) in the ->options

To ease selection of the appropriate types of content I've placed these in an array keyed on mime type and subtype.

More detailed notes I made while working are here: http://wiki.transmission.cc/index.php?title=Drupal_FeedAPI_and_FeedAPI_m...

CommentFileSizeAuthor
feedapi.20080204.patch1.22 KBekes

Comments

alex_b’s picture

Great, thank you for posting this here. Two questions:

1) Does SimplePie expose RSS / Atom enclosures equally through get_enclosures(); ? I take it it does. ( http://en.wikipedia.org/wiki/RSS_enclosure#Similar_technologies )
2) How does Parser Common Syndication handle this? Can we (at least theoretically - no need to actually make this happen in order to make this patch go in) expose enclosure information on ->options->enclosures with parser_common_syndication the same way as this patch would do it with parser_simplepie?

ekes’s picture

1) In short yes.

The note in the documentation http://simplepie.org/wiki/reference/simplepie_enclosure/start and code http://svn.simplepie.org/simplepie/trunk/simplepie.inc (line 3729), only refers only to RSS enclosures, Media RSS and iTunes RSS. But it does do the ATOM link type enclosure (http://atompub.org/rfc4287.html#element.link) as well in http://svn.simplepie.org/simplepie/trunk/simplepie.inc (lines 5404 - 5472) although it only seems to use the href, type and length attributes (like the simple RSS enclosure).

2) I believe at the moment parser_common_syndication ignores enclosures. I seen no reason not put content into a similar enclosure object. While there are quite a few variables in the object (http://php5.simplepie.org/phpDoc/SimplePie/SimplePie_Enclosure.html) the only ones for the standard RSS enclosure and ATOM link enclosure need are the href, type, length - which should not be so hard - the Media and iTunes RSS are significantly more complicated.

alex_b’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.