Weather::YR::Textforecast - Used to fetch text based forecast from YR
use Weather::YR::Textforecast; my $text = Weather::YR::Textforecast->new( { 'language' => 'nb', 'forecast' => 'land', } ); $text_forecast = $text->forecast; print $text_forecast->{'title'};
This module returns textforecasts from YR according to specified parameters.
This module uses the data from URLs such as these: http://api.yr.no/weatherapi/textforecast/1.2/?forecast=land;language=nb
The URL to the web service for getting the textforecasts. Defaults to version 2 of the API: http://api.yr.no/weatherapi/textforecast/1.2/.
The type of forecast to get. Defaults to land.
The language of the forecast. Defaults to norwegian bokmål, nb.
Retrieves the forecast in a data structure representing the XML document.
This method parses the response from YR and returns a structure of objects.
\%time
This method parses the time period of the forecast and the forecasts.
It returns a HASHREF of to, from and forecasts.
\%forecast
This method parses a forecast with many locations and areas.
The class of an area does not exist yet, but we just needed a name for the collection (Weather::YR::Textforecast::Area).
It returns an instance of Weather::YR::Textforecast::Forecast.
This method parses a list of forecast locations. The forecasts are expected to be found in the HASH key of location.
It returns a list of Weather::YR::Textforecast::Location (unfortunately this class does not exist, but we just needed a name on it).
This method parses and creates a product object to store the description about the product.
Assembles the complete URL for the textforecast service with the forecast type and language.
Weather::YR, Weather::YR::Base
Knut-Olav, <knut-olav@hoven.ws>
Copyright (C) 2008 by Knut-Olav Hoven
This library is free software; you can redireibute it and/or modify it under the terms as GNU GPL version 2.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'bokmål,'. Assuming UTF-8
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.