From 9cd035d187a581446fd2cecd333fb214b1182ce8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 8 Nov 2007 23:06:27 +0000 Subject: weather plugin: fix 163 --- data/rbot/plugins/weather.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'data/rbot/plugins/weather.rb') diff --git a/data/rbot/plugins/weather.rb b/data/rbot/plugins/weather.rb index 4edcc963..47ab1ca2 100644 --- a/data/rbot/plugins/weather.rb +++ b/data/rbot/plugins/weather.rb @@ -190,13 +190,18 @@ class WeatherPlugin < Plugin case xml when nil m.reply "couldn't retrieve weather information, sorry" - return when /City Not Found/ m.reply "no such location found (#{where})" - return - when /(.*?)<\/table>/m - data = $1 - m.reply wu_weather_filter(data) + when /
(.*?)<\/table>/m).each do |match| + data += wu_weather_filter(match.first) + end + if data.length > 0 + m.reply data + else + m.reply "couldn't parse weather data from #{where}" + end when //) m.reply "multiple stations available, use 'weather station ' where code is one of " + stations.join(", ") -- cgit v1.2.3