在Ruby / Rails中解析Atom和RSS?

我正在寻找能让我在Ruby和Rails中解析Atom和RSS的东西。 我看过标准的RSS库,但是有一个库可以自动检测它是什么类型的源并为我解析它吗?

Feedzirra是更好的选择之一: http : //www.pauldix.net/2009/02/feedzirra-a-ruby-feed-library-built-for-speed.html

当然,自从我写这篇文章以后,我就有了偏见。 🙂

Google将揭示一些事情。 他们不被接受吗?

简单的RSS
rubyFeedparser

require 'simple-rss' require 'open-uri' rss = SimpleRSS.parse open('http://slashdot.org/index.rdf') rss.channel.title # => "Slashdot" 

如果遇到糟糕的Feed,您可能需要使用HPricot来解析Feed。

Feed Normalizer看起来可能是一个不错的选择

http://rubyforge.org/projects/feed-normalizer/

看起来在2009年, 标准的Ruby RSS库还不存在吗?

我喜欢使用niokrigi或scrapi来解析atom / rss feed中的xml。 http://www.rubyinside.com/nokogiri-ruby-html-parser-and-xml-parser-1288.html

我尝试过Feedzirra和SimpleRSS,我发现两者都很好用。 Feedzirra虽然速度更快,但如果你正在寻找它的性能,那么你最好使用Feedzirra。

Interesting Posts