Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

read and parse RSS feed (See related posts)

require 'open-uri'

require 'rss/0.9'
require 'rss/1.0'
require 'rss/2.0'
require 'rss/parser'

url = 'http://some.host/rss.xml'
rss = RSS::Parser.parse(open(url){|fd|fd.read})
puts rss.items.collect{|item|item.title}.join("\n")


See also simple-rss at rubyforge.

Comments on this post

danny posts on Jan 09, 2006 at 16:05
This code crashed on most feeds I tried to read with it. SimpleRss works very well though!

You need to create an account or log in to post comments to this site.


Click here to browse all 4858 code snippets

Related Posts