Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing Atom & RSS in Ruby/Rails?

I'm looking for something that will let me parse Atom and RSS in Ruby and Rails. I've looked at the standard RSS library, but is there one library that will auto-detect whatever type of feed it is and parse it for me?

like image 998
aronchick Avatar asked Oct 18 '08 04:10

aronchick


5 Answers

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

like image 52
Paul Dix Avatar answered Oct 31 '22 17:10

Paul Dix


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"
like image 11
Pistos Avatar answered Oct 31 '22 17:10

Pistos


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

like image 11
Thibaut Barrère Avatar answered Oct 31 '22 19:10

Thibaut Barrère


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

like image 2
Nakilon Avatar answered Oct 31 '22 17:10

Nakilon


Feed Normalizer looks like it may be a good option

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

like image 2
RichH Avatar answered Oct 31 '22 19:10

RichH