The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Weather::Bug - Get realtime weather where available

SYNOPSIS

    use Weather::Bug;

    my $w = get_live_weather( 'KCMI' );
    print "It is $w->{temp} degrees in $w->{location}\n";

ABOUT

Weather::Bug uses data from aws.com's live Java weather applet. Not all available stations report live data, however. If the station closest to you does not report live weather data to aws.com, you are probably better off using one of the other Weather:: modules from CPAN.

Disclaimer

This Perl module is not endorsed or supported in any way by AWS Convergence Technologies. "WeatherBug" is their trademark.

USAGE

    get_live_weather($station_id [, $units])

Weather::Bug exports only one funcion, get_live_weather. The first argument is the station ID. You can find the ID of a station near you at this page:

    http://www.aws.com/aws_2001/asp/getLiveWeather.asp

If you get a list of sites, click one to view current conditions. Look at the URL of the link that says "Live Broadcast JAVA." The part of the URL that reads "?id=XXXX" is your station ID. For example, my old high school in Fredericksburg, Iowa, is FRDRC.

The units argument defaults to American, and supports these values:

    0 American
    1 Metric
    2 American, but pressure in millibars

This function returns a reference to a hash in scalar context, or a hash in list context. The keys of the hash are as follows:

    last_updated
    date
    temp
    wind_direction
    wind_speed
    max_wind_direction
    max_wind_speed
    precip
    precip_rate
    pressure
    humidity
    max_temp
    min_temp
    site_name
    dew_point
    heat_index
    monthly_rain
    temp_change
    humidity_change
    pressure_change
    location
    max_humidity
    min_humidity
    max_pressure
    min_pressure
    max_precip_rate

Be aware that not all stations report all of these items. Units are stripped from all measurements and rates.

AUTHOR

Weather::Bug by Mike Rosulek <mike@mikero.com>.

COPYRIGHT

Copyright (c) 2003 Mike Rosulek. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.