Parsing Atom & RSS in Ruby/Rails?

雨燕双飞 提交于 2019-11-30 01:29:45

Feedzirra is one of the better options: http://www.pauldix.net/2009/02/feedzirra-a-ruby-feed-library-built-for-speed.html

Of course, I'm biased since I wrote it. :)

Googleage reveals some things. Were they not acceptable?

Simple RSS
Ruby-Feedparser

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

If you meet crappy feeds, you may want to use HPricot to parse the feed.

Looks like in 2009 the standart Ruby RSS library just didn't exist yet?

RichH

Feed Normalizer looks like it may be a good option

https://github.com/aasmith/feed-normalizer

I like using niokrigi or scrapi for parsing the xml in the atom/rss feeds. http://www.rubyinside.com/nokogiri-ruby-html-parser-and-xml-parser-1288.html

I have tried Feedzirra and SimpleRSS and I found that both work great. Feedzirra was faster though so if its performance you're looking for, you're better off with Feedzirra.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!