lorz
lorz

Reputation: 1139

Rails library to process an RSS/ATOM feed?

What's a good solution to parse an RSS/ATOM feed and present the content in a Rails view?

Upvotes: 2

Views: 972

Answers (3)

cnk
cnk

Reputation: 1312

One of the recent Railscasts (6/29/2009) recommended Feedzirra

Upvotes: 3

grosser
grosser

Reputation: 15097

id recommend acts_as_feed, which takes care of parsing automatically acts as feed rails plugin and can be added to models. Another solution would be to use google feed api as long as you only need to display the feed.

#HAML view example
- if feed.filled?
  %h2="Blog: #{feed.title}"
  - for item in feed.entries[0...5]
    -date = item.published_at.to_date.to_s(:long)

    %h2=link_to(h(item.title),h(item.url))

Upvotes: 0

Alex Martelli
Alex Martelli

Reputation: 881635

I've seen good notes on the parsing part at http://www.robbyonrails.com/articles/2005/05/11/parsing-a-rss-feed (and links therefrom). How to best present things once you have parsed them is maybe a bit of a subjective issue...

Upvotes: 4

Related Questions