summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2012-03-20 12:13:17 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2012-03-20 12:13:17 +0100
commitc7b9d8dee7128b2fa1a3f0244c7005d7bef0b7a2 (patch)
tree8484b2e43803bd37f4a3216652000b94e50310e6
parent7a6221adf24e81ef1e47441bd848241adfa02ba6 (diff)
Forecast plugin patch
"I've updated the forecast plugin, the two API URLs used had been updated and the NOAA SOAP API method call now requires 6 arguments instead of the 5 it was passing previously." (Ticket #89)
-rw-r--r--data/rbot/plugins/forecast.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/data/rbot/plugins/forecast.rb b/data/rbot/plugins/forecast.rb
index 293c7c05..8ac2d2ad 100644
--- a/data/rbot/plugins/forecast.rb
+++ b/data/rbot/plugins/forecast.rb
@@ -20,13 +20,13 @@ class LatLong
# [+return+] latitude,longitude
def get_lat_long(loc)
loc = url_encode(loc)
- url="http://api.local.yahoo.com/MapsService/V1/geocode?appid=mrchucho_rbot_weather&location=#{loc}"
+ url="http://where.yahooapis.com/geocode?appid=mrchucho_rbot_weather&location=#{loc}"
lat,long = 0,0
begin
open(url) do |xmldoc|
results = (REXML::Document.new xmldoc).root
- lat = results.elements["//Latitude/text()"].to_s
- long = results.elements["//Longitude/text()"].to_s
+ lat = results.elements["//latitude/text()"].to_s
+ long = results.elements["//longitude/text()"].to_s
end
rescue => err
raise err #?
@@ -36,7 +36,7 @@ class LatLong
end
class Forecast
- WSDL_URI="http://www.nws.noaa.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php?wsdl"
+ WSDL_URI="http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl"
def initialize(lat,long)
@lat,@long=lat,long
# this extra step is for backward/forward compatibility
@@ -50,7 +50,7 @@ class Forecast
private
def retrieve
forecast = @forecaster.NDFDgenByDay(
- @lat,@long,Time.now.strftime("%Y-%m-%d"),2,"24 hourly")
+ @lat,@long,Time.now.strftime("%Y-%m-%d"),2,"e","24 hourly")
(REXML::Document.new(forecast)).root
end
def parse(xml)