s

Posts Tagged with "rss"

Parsing an RSS feed with Ruby

Jun 09, 2007  -  Comments

Parsing an RSS feed is insanely simple with Ruby. Two lines is all it takes. . .

require 'rss'
rss = RSS::Parser.parse(open('/feed/posts/index.html').read, false)

Now you'll have an Array of the results, so you can do something like:

rss.items.each { |i| puts "#{i.title} - #{i.date}" }

Tagged: rubyrsstutorial

Syndicated!

Jun 16, 2006  -  Comments

One of the things I had hoped to be able to do with Rails for this blog was to create an RSS feed. I briefly looked at the chapter that describes how to do this in the Rails Recipes book and kinda decided put it off until later.

Well, after seeing that Adam added an RSS feed to his blog and even provided the steps he took to accomplish it, I decided to finally implement it. It turned out to be a lot easier than I thought.

So, if you're really bored often, go ahead and subscribe.

Tagged: railsrss