Hi Friends, I have to parse only the 'current temperature' value in a webpage and display it. Kindly help me out please.
A:
require 'open-uri'
data =''
open("http://some.site/page/address") do |f| // adjust URI here
data << f.read while !f.eof?
end
temp = data[/current temperature: [0-9]+/] // and regex here
p temp
zed_0xff
2010-06-09 08:00:24
+1
A:
I highly recommend you using Nokogiri. Here's a good overview.
Simone Carletti
2010-06-09 08:37:34