Return to Snippet

Revision: 26758
at May 10, 2010 05:04 by almazom


Initial Code
require 'net/http'
require 'rexml/document'


url = 'http://weather.yahooapis.com/forecastrss?p=RSXX0438&u=c'


xml_data = Net::HTTP.get_response(URI.parse(url)).body


doc = REXML::Document.new(xml_data)
titles = []

doc.elements.each('rss/channel/item/yweather:condition') do |ele|
	 print ele.attributes['temp']
end

Initial URL

                                

Initial Description

                                

Initial Title
weather parsing

Initial Tags
ruby

Initial Language
Rails