Tuesday, March 15, 2011

Ruby Atom generator to use with merb

I want to provide feed in my merb application. After reading wikipedia, RSSvsAtom and seeing that StackOverflow uses it, I think I will use Atom. What library should I use? I have found rAtom that looks quite good. Are there better alternatives? Or does merb has anything built in to help me?

UPDATE: maybe I should just do the news in plain html and use FeedBurner?

From stackoverflow
  • While not Merb specific, you might consider using FeedTools - which is a Ruby Gem.

    You'd do something like:

    require 'feed_tools'
    feed = FeedTools::Feed.open('http://url/feed')
    
    feed.items.each do |item|
      puts item.title + "\n---\n" + item.description + "\n\n"
    end
    

    Anyway - check it out at http://sporkmonger.com/projects/feedtools

    NOTE: This is for parsing ATOM feeds as I wasn't clear as to whether or not you were looking to provide an ATOM feed or parse others.

    rkj : thanks for the answer, but I want to provide feed.
  • I went for rAtom and for now, and it works really good - code is minimal and nice.

0 comments:

Post a Comment