require rubygemsrequire feed_tools feed = FeedTools::Feed.open(http://www.rubyinside.com/feed/) puts This feeds title is #{feed.title}puts This feeds Web site is at #{feed.link} feed.items.each do |item| puts item.title + \n---\n + item.des
require 'rubygems' require 'feed_tools' feed = FeedTools::Feed.open('http://www.rubyinside.com/feed/') puts "This feed's title is #{feed.title}" puts "This feed's Web site is at #{feed.link}" feed.items.each do |item| puts item.title + "\n---\n" + item.description + "\n\n" end
以上就是使用FeedTools解析RSS代码示例的详细内容,更多请关注自由互联其它相关文章!