Name

Weather::WWO - API to World Weather Online

Synopsis

Get the 5-day weather forecast:

my $wwo = Weather::WWO->new( api_key           => $your_api_key,
                             use_new_api       => 1,
                             location          => $location,
                             temperature_units => 'F',
                             wind_units        => 'Miles');
                             
Where the $location can be:
* zip code
* IP address
* latitude,longitude
* City[,State] name

my ($highs, $lows) = $wwo->forecast_temperatures;

NOTE: api_key and location are required parameters to new() As of May 2013 there is a new API that will replace the old. One can set use_new_api to 1 in the constructor to retrieve from the new api.

Methods

forecast_temperatures

Get the high and low temperatures for the number of days specified.

Returns: Array of two ArrayRefs being the high and low temperatures
Example: my ($highs, $lows) = $wwo->forecast_temperaures;

highs

Get an ArrayRef[Int] of the forecasted high temperatures.

lows

Get an ArrayRef[Int] of the forecasted low temperatures.

winds

Get an ArrayRef[Int] of the forecasted wind speeds.

get_forecast_data_by_key

Get the values for a single forecast metric. Examples are: tempMinF, tempMaxC, windspeedMiles etc...

NOTE: One can dump the data attribute to see the exact data structure and keys available.

query_string

Construct the query string based on object attributes.

query_URL

Construct the to URL to get by putting the source URL and query_string together.

current_conditions

The current conditions data structure.

weather_forecast

The weather forecast data structure.

request

Information about the request.

Authors

Mateu Hunter hunter@missoula.org

Copyright

Copyright 2010, 2011, 2013 Mateu Hunter

License

You may distribute this code under the same terms as Perl itself.