Posts Tagged with "rss"
Parsing an RSS feed with Ruby
Published about 1 year on June 9, 2007 | 2 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}" }
Syndicated!
Published over 2 years on June 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.
©2008 Travis Roberts. All rights reserved.
![Validate this page for XHTML [Valid XHTML]](/images/xhtml.gif)
![Validate this page for CSS [Valid CSS]](/images/css.gif)
![Validate my RSS feed [Valid RSS]](/images/rss.gif)