Name
Weather::Underground::Forecast - Simple API to Weather Underground Forecast Data
Synopsis
Get the weather forecast:
my $forecast = Weather::Underground::Forecast->new(
location => $location,
temperature_units => 'fahrenheit', # or 'celsius'
);
Where the $location can be:
* 'city,state' Example: location => 'Bloomington,IN'
* zip_code Example: location => 11030
* 'latitude,longitude' Example: location => '21.3069444,-157.8583333'
my ($highs, $lows) = $forecast->temperatures;
NOTE: location is the only required parameter to new()
Methods
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) = $wunder->temperatures;
highs
Get an ArrayRef[Int] of the forecasted high temperatures.
lows
Get an ArrayRef[Int] of the forecasted low temperatures.
precipitation
Get an ArrayRef[Int] of the forecasted chance of precipitation.
Example: my $chance_of_precip = $wunder->precipitation;
Limitations
It is possible that a location could have more than one forecast. The behavior of that possibility has not been tested.
Authors
Mateu Hunter hunter@missoula.org
Copyright
Copyright 2010, Mateu Hunter
License
You may distribute this code under the same terms as Perl itself.