开发者

Do any Ruby RSS parsing libaries support MRSS?

开发者 https://www.devze.com 2022-12-20 01:22 出处:网络
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'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:

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.


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.)

0

精彩评论

暂无评论...
验证码 换一张
取 消