#!/usr/bin/perl use Forecast::IO; use Data::Dumper; my $lat = 55.6; my $long = 13.0; my $key = "1f154a62adc6843a77cc29de6ac1cc4b"; my $forecast = Forecast::IO->new( key => $key, longitude => $long, latitude => $lat, ); if(!$ARGV[0] || $ARGV[0] eq 'daily'){ $query='daily'; $text='The daily forecast is '; }elsif($ARGV[0] eq 'hourly'){ $query='hourly'; $text='It will be '; }elsif($ARGV[0] eq 'currently'){ $query='currently'; $text='Currently, the weather is '; } system "~/Dropbox/speech/tts.sh \"$text $forecast->{$query}->{summary}\""; print "$forecast->{$query}->{summary}"; print "\n"; #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($_); #}