[SimBot-commits] CVS: simbot/plugins weather.pl,1.85,1.86
Status: Abandoned
Brought to you by:
kstange
|
From: Pete P. <fou...@us...> - 2005-05-09 23:03:29
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23685/plugins Modified Files: weather.pl Log Message: - Misplaced comment - Filter out airfield quality color code Index: weather.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/weather.pl,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -p -r1.85 -r1.86 --- weather.pl 9 May 2005 21:34:19 -0000 1.85 +++ weather.pl 9 May 2005 23:03:20 -0000 1.86 @@ -320,8 +320,6 @@ sub got_metar { } my (undef, $raw_metar) = split(/\n/, $response->content); - # Geo::METAR has issues not ignoring the remarks section of the - # METAR report. Let's strip it out. &SimBot::debug(4, "weather: METAR is " . $raw_metar . "\n"); my $station_name_query = $dbh->prepare_cached( @@ -346,13 +344,15 @@ sub got_metar { "$nick: METAR report for $station_name is $raw_metar."); return; } - - my $wind_mph; - + + + # Geo::METAR has issues not ignoring the remarks section of the + # METAR report. Let's strip it out. my $remarks; ($raw_metar, undef, $remarks) = $raw_metar =~ m/^(.*?)( RMK (.*))?$/; $raw_metar =~ s|/////KT|00000KT|; + $raw_metar =~ s{\b(BLU|WHT|GRN|YLO|AMB|RED)\b}{}; &SimBot::debug(5, "weather: Reduced METAR is " . $raw_metar . "\n"); my $m = new Geo::METAR; @@ -369,6 +369,7 @@ sub got_metar { . "metar $station if you want to try parsing it yourself."); return; } + my $wind_mph; $m->{date_time} =~ m/(\d\d)(\d\d)(\d\d)Z/; my $time = "$2:$3"; |