Bot-BasicBot-Pluggable-Module-Weather
view release on metacpan or search on metacpan
lib/Bot/BasicBot/Pluggable/Module/Aviation.pm view on Meta::CPAN
my $content = LWP::Simple::get("http://weather.noaa.gov/cgi-bin/mgettaf.pl?cccc=$site");
return "I can't seem to retrieve data from weather.noaa.com right now."
unless $content;
# extract TAF from equally verbose webpage
$content =~ m/($site( AMD)* \d+Z .*?)</s;
my $taf = $1;
$taf =~ s/\n//gm;
$taf =~ s/\s+/ /g;
my $taf_highlight_bold = $self->get("taf_highlight_bold");
# Optionally highlight beginnings of parts of the forecast. Some
# find it useful, some find it obnoxious, so it's configurable. :-)
$taf =~ s/(FM\d+Z?|TEMPO \d+|BECMG \d+|PROB\d+)/\cB$1\cB/g if $taf_highlight_bold;
# Sane?
return "I can't find any forecast for $site." if length($taf) < 10;
return $taf;
}
#
# greatcircle -- calculate great circle distance and heading between
( run in 0.471 second using v1.01-cache-2.11-cpan-62beec7d96d )