有没有一种干净的方法来确定 RSS 版本?
是否可以通过某种方式确定提要类型和版本,以便确保您拥有正确的版本。可以说是最低级别。命名空间是一种显而易见的方法,但很多提要中并不存在。
有什么想法吗?
(我正在尝试混搭各种 RSS 源)。
预先感谢您的任何帮助!
Is it possible to determine the feed type and version in a way so that you can make sure that you have the correct version. At the lowest level so to speak. Namespaces is an obvious approach, but its not present for a lot of feeds.
Any thoughts?
(I'm trying to mashup varioius RSS Feeds).
Thanks in advance for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
考虑到变体的数量、混合命名空间的人数(通常是在没有命名空间的 RSS 版本中使用完整内容元素)以及无效提要的数量。
不。您最好只获得一个良好的提要解析库,让它抽象出所有版本问题,并从您检索到的数据构建一个干净的 Atom 提要。
Given the number of variations, the number of people mixing namespaces (usually to use a full content element in a version of RSS that doesn't have one), and the number of invalid feeds.
No. You'd be better off just getting a good feed parsing library and letting it abstract away all the version issues and building a clean Atom feed from the data you retrieve from it.
我不知道有什么干净的方法。查看此问题了解多种方法。
Zend_Feed_Reader 在我看来很有趣。也许可以尝试用它来获取提要的版本。
I don't know of a clean way. Check out this question for a number of approaches.
Zend_Feed_Reader looks interesting IMO. Maybe it's possible to try and get the feed's version with that.
看看罗马
(来源:rollerweblogger.org)
。
它能够解析各种 RSS 和 ATOM 联合提要和版本,并发出您想要的任何联合提要格式/版本。
Take a look at ROME
(source: rollerweblogger.org)
.
It is able to parse a variety of RSS and ATOM syndication feeds and versions and emit whatever syndication feed format/version you want.