是否有任何 Ruby RSS 解析库支持 MRSS? [英] Do any Ruby RSS parsing libaries support MRSS?
问题描述
我正在尝试解析包含 media:* 元素的媒体 RSS 提要,但似乎所有用于 Ruby 的标准 RSS 解析库都只支持附件,而不支持 MRSS 元素.
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.
我试过了:
- 简单RSS
- RSS::解析器
- 联合:RSS::Parser
理想情况下,我希望能够轻松提取 media:thumbnail 等元素,类似于提取条目的附件.
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 似乎在某种程度上支持媒体 RSS.
http://github.com/cardmagic/simple-rss seems to support Media RSS to some degree.
例如:
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"}
}
(不幸的是,对于我正在测试的提要,它似乎只采用了 media:group 中的第一个 media:content 标签,即使 media:group 有 2 个 media:content 标签.)
(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.)
这篇关于是否有任何 Ruby RSS 解析库支持 MRSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!