Como diga, señor.
Se encuentra en este enlace:
http://search.cpan.org/~avenj/Weather-O ... therMap.pm*******************************************************************
use Weather::OpenWeatherMap;
my $api_key = 'foo';
my $wx = Weather::OpenWeatherMap->new(
api_key => $api_key,
);
# Current conditions:
my $current = $wx->get_weather(
location => 'Manchester, NH',
);
my $tempf = $current->temp_f;
my $wind = $current->wind_speed_mph;
# (see Weather::OpenWeatherMap::Result::Current)
# Forecast conditions:
my $forecast = $wx->get_weather(
location => 'Manchester, NH',
forecast => 1,
days => 3,
);
for my $day ($forecast->list) {
my $date = $day->dt->mdy;
my $temp_lo = $day->temp_min_f,
my $temp_hi = $day->temp_max_f,
# (see Weather::OpenWeatherMap::Result::Forecast::Day)
}
# (see Weather::OpenWeatherMap::Result::Forecast)
# Find a city:
my $search = $wx->get_weather(
location => 'Manchester',
find => 1,
max => 5,
);
for my $place ($search->list) {
my $region = $place->country;
# ...
}
# (see Weather::OpenWeatherMap::Result::Find)
********************************************************