2 # Weather.pl: Frontend to GEO::Weather (weather.com).
4 # Version: v0.1 (20020512).
13 ###local $SIG{ALRM} = sub { die "alarm\n" };
17 my (@weatherloc, $whash);
20 return unless &::loadPerlModule("Geo::Weather");
21 my $weather = new Geo::Weather;
29 @weatherloc = split /,\s*/, $query;
31 if (@weatherloc == 1) {
32 $whash = $weather->get_weather ("$weatherloc[0]");
34 $whash = $weather->get_weather ("$weatherloc[0]", "$weatherloc[1]");
38 $retval = "I'm sorry, not able to return weather conditions for $query";
39 &::performStrictReply($retval);
44 $retval = "Current conditions in $whash->{city}, $whash->{state}: $whash->{cond}, $whash->{temp}° F. Winds $whash->{wind} MPH. Dewpoint: $whash->{dewp}° F, Relative Humidity: $whash->{humi}%,";
46 if ($whash->{visb} eq 'Unlimited') {
47 $retval .= " Visibility: $whash->{visb}, ";
49 $retval .= " Visibility: $whash->{visb} mi., ";
52 $retval .= " Barometric Pressure: $whash->{baro} in.";
53 if($whash->{heat} ne 'N/A') {
54 $retval .= " Heat Index: $whash->{heat}° F.";
57 &::performStrictReply($retval);