[SimBot-commits] CVS: simbot/plugins weather.pl,1.91,1.92
Status: Abandoned
Brought to you by:
kstange
|
From: Pete P. <fou...@us...> - 2005-06-10 12:38:17
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18452/plugins Modified Files: weather.pl Log Message: We now catch NOAA's fondness for sending an empty forecast for 1970 in response to bad requests and give an error message, including the suggestion to check one's clock. Now to figure out why my computer thinks it is 1982... Index: weather.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/weather.pl,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -p -r1.91 -r1.92 --- weather.pl 14 May 2005 22:41:27 -0000 1.91 +++ weather.pl 10 Jun 2005 12:37:56 -0000 1.92 @@ -681,7 +681,11 @@ sub get_forecast { my (undef, undef, undef, $today_day, $today_mon, $today_year, $toay_wday) = localtime; foreach (@days) { my ($year, $month, $day) = m/^(\d+)-(\d+)-(\d+)/; - if($year == $today_year+1900 + if($year <= 2000) { + # NOAA's giving us bogus data again + &SimBot::debug(1, "weather: Forecast is in the past, check your clock!\n"); + return 'Could not get the forecast.'; + } elsif($year == $today_year+1900 && $month == $today_mon+1 && $day == $today_day) { |