#!/usr/bin/ruby
# tom.luo@gmail.com
# 2010/03/07
# Oscar night
require 'rss/2.0'
require 'open-uri'
def rss(rss_url)
80.times.to_a.each {print '-'}
puts
open(rss_url) do |http|
response = http.read
result = RSS::Parser.parse(response, false)
puts result.channel.title
80.times.to_a.each {print '-'}
puts
result.items.each do |item|
puts ". #{item.title}"
puts " #{item.description}"
end
end
80.times.to_a.each {print '-'}
puts
end
urls =[]
urls << 'http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml'
urls << 'http://rss.cbc.ca/lineup/topstories.xml'
# you can add more
urls.each {|u| rss(u) }