views:

146

answers:

1

I'm attempting to parse Media RSS feeds that contain media:* elements, but it seems as though all of the standard RSS parsing libraries for Ruby only support enclosures, not MRSS elements.

I've tried:

  • SimpleRSS
  • RSS::Parser
  • Syndication:RSS::Parser

Ideally, I'd like something that makes it simple to extract elements such as media:thumbnail, similar to how I can extract an entry's enclosure.

+1  A: 

http://github.com/cardmagic/simple-rss seems to support Media RSS to some degree.

For example:

pp rss.entries.last
{
 ...
 :media_content_url=>"...",
 :media_content_type=>"image/jpeg",
 :media_content_height=>"426",
 :media_content_width=>"640",
 :media_thumbnail_url=>"...",
 :media_thumbnail_height=>"133",
 :media_thumbnail_width=>"200"}
}

(Unfortunately, with the feed I'm testing it with, it seems to be only taking the first media:content tag inside of the media:group, even though the media:group has 2 media:content tags.)

Tyler Rick