views:

435

answers:

3

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

+4  A: 

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

Alex Martelli
A: 

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))
grosser
+2  A: 

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

cnk
Feedzirra is the best.
Shripad K