Weather::Underground::Forecast - Simple API to Weather Underground Forecast Data
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()
new()
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;
Get an ArrayRef[Int] of the forecasted high temperatures.
Get an ArrayRef[Int] of the forecasted low temperatures.
Get an ArrayRef[Int] of the forecasted chance of precipitation.
Example: my $chance_of_precip = $wunder->precipitation;
It is possible that a location could have more than one forecast. The behavior of that possibility has not been tested.
Mateu Hunter hunter@missoula.org
hunter@missoula.org
Copyright 2010, Mateu Hunter
You may distribute this code under the same terms as Perl itself.
To install Weather::Underground::Forecast, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Weather::Underground::Forecast
CPAN shell
perl -MCPAN -e shell install Weather::Underground::Forecast
For more information on module installation, please visit the detailed CPAN module installation guide.