Ruby 之 RSS 2.0 解析

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'rss/2.0'
require 'open-uri'

url = 'http://www.oschina.net/code/rss'
feed = RSS::Parser.parse(open(url).read, false)
puts "#{feed.channel.title}"
feed.items.each do |item|
  puts item.title
  puts " (#{item.link})"
  puts
  puts item.description
end