Weather::YR::LocationForecast - Object-oriented interface to Yr.no's "location forecast" API.
Don't use this class directly. Instead, access it from the Weather::YR class.
Returns the URL to YR.no's location forecast service. This is handy if you want to retrieve the XML from YR.no yourself;
my $yr = Weather::YR->new( lat => 63.590833, lon => 10.741389, ); my $url = $yr->location_forecast->url; my $xml = My FancyHttpClient->new->get( $url ); my $yr = Weather::YR->new( xml => $xml, tz => DateTime::TimeZone->new( name => 'Europe/Oslo' ), ); my $forecast = $yr->location_forecast;
Returns the URL to YR.no' location forecast service XML schema. This is used internally for validating the XML output from YR.no itself.
Returns an array reference of Weather::YR::LocationForecast::DataPoint instances.
Returns an array reference of Weather::YR::LocationForecast::Day instances.
Returns a Weather::YR::LocationForecast::Day instance, representing the closest forecast in time.
Returns a Weather::YR::LocationForecast::Day instance, representing today's weather.
Returns a Weather::YR::LocationForecast::Day instance, representing tomorrow's weather.
To install Weather::YR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Weather::YR
CPAN shell
perl -MCPAN -e shell install Weather::YR
For more information on module installation, please visit the detailed CPAN module installation guide.