1 RSS Standard Library
RSS is xml-based, so you can simply parse it as an XML. But, in fact, he has a higher level of proprietary parsers to parse him out. The standard of RSS is also very confusing.
He has a lot of inconvenience, is the standard version of the incompatibility, RSS has 0.9, 1.0, and 2.0 version. RSS versions, like making hot dogs, are some of the details that you don't want to know unless you must know.
Ruby has a standard RSS library that contains 0.9, 1.0, and 2.0 versions of the standard. As seamless as possible between different versions. If you don't specify a version, the library will test the version as much as possible.
Look at the example below where we get the feed from http://marsdrive.com:
Require ' RSS '
require ' Open-uri '
url = ' http://www.marstoday.com/rss/mars.xml '
open (URL) do |h|
RESP = h.read Result
= RSS::P arser.parse (resp,false)
puts "Channel: #{result.channel.title}"
Result.ite Ms.each_with_index do |item,i|
i + 1
puts "#{i} #{item.title}"
End