Forecast::IO - Provides Perl API to Forecast.io
use 5.016; use Forecast::IO; use Data::Dumper; my $lat = 43.6667; my $long = -79.4167; my $key = "c9ce1c59d139c3dc62961cbd63097d13"; # example Forecast.io API key my $forecast = Forecast::IO->new( key => $key, longitude => $long, latitude => $lat, ); say "current temperature: " . $forecast->{currently}->{temperature}; my @daily_data_points = @{ $forecast->{daily}->{data} }; # Use your imagination about how to use this data. # in the meantime, inspect it by dumping it. for (@daily_data_points) { print Dumper($_); }
This module is a wrapper around the Forecast.io API.
Git repository: https://github.com/mlbright/Forecast-IO
Forecast.io API docs: https://developer.forecast.io/docs/v2
Copyright (c) 2013 "AUTHOR"
This library is free software and may be distributed under the same terms as perl itself. See http://dev.perl.org/licenses/.
To install Forecast::IO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Forecast::IO
CPAN shell
perl -MCPAN -e shell install Forecast::IO
For more information on module installation, please visit the detailed CPAN module installation guide.