NAME
Weather::YR::LocationForecast - Object-oriented interface to Yr.no's "location forecast" API.
DESCRIPTION
Don't use this class directly. Instead, access it from the Weather::YR class.
METHODS
url
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.5908,
lon
=> 10.7414,
);
my
$url
=
$yr
->location_forecast->url;
my
$xml
= MyFancyHttpClient->new->get(
$url
);
my
$yr
= Weather::YR->new(
xml
=>
$xml
,
tz
=> DateTime::TimeZone->new(
name
=>
'Europe/Oslo'
),
);
my
$forecast
=
$yr
->location_forecast;
schema_url
Returns the URL to YR.no' location forecast service XML schema. This is used internally for validating the XML output from YR.no itself.
datapoints
Returns an array reference of Weather::YR::LocationForecast::DataPoint instances.
days
Returns an array reference of Weather::YR::LocationForecast::Day instances.
now
Returns a Weather::YR::LocationForecast::Day instance, representing the closest forecast in time.
today
Returns a Weather::YR::LocationForecast::Day instance, representing today's weather.
tomorrow
Returns a Weather::YR::LocationForecast::Day instance, representing tomorrow's weather.