[SimBot-commits] CVS: simbot/plugins weather.pl,1.97,1.98
Status: Abandoned
Brought to you by:
kstange
|
From: Pete P. <fou...@us...> - 2005-07-19 20:30:23
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10957/plugins Modified Files: weather.pl Log Message: If NOAA tells us no data available, tell the user that and give them the link to look up stations at. Index: weather.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/weather.pl,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -p -r1.97 -r1.98 --- weather.pl 19 Jul 2005 20:27:08 -0000 1.97 +++ weather.pl 19 Jul 2005 20:30:13 -0000 1.98 @@ -330,6 +330,12 @@ sub got_metar { } # my ($datestamp, $raw_metar) = split(/\n/, $response->content); my $raw_metar; + if($response->content =~ m|no data available|) { + &SimBot::send_message(&SimBot::option('network', 'channel'), + "$nick: Sorry, there is no report available for \"$station\". " + . FIND_STATION_AT); + return; + } unless(($raw_metar) = $response->content =~ m|<FONT FACE="Monospace,Courier">(.*?)</FONT>|s) { &SimBot::debug(1, "NOAA made no sense. They said:\n" . $response->content . "\n"); &SimBot::send_message(&SimBot::option('network', 'channel'), "$nick: I couldn't make sense of what NOAA told me."); |