Posts Tagged with "rss"

Parsing an RSS feed with Ruby

JUN

09

2007

7 comments

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

require 'rss'
rss = RSS::Parser.parse(open('http://www.travisonrails.com/feed/posts').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: tutorial, rss, ruby

Syndicated!

JUN

16

2006

0 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: rails, rss


© 2010 Travis Roberts. All rights reserved.