diff options
author | Vasil Zlatanov <v@skozl.com> | 2017-10-17 18:24:07 +0100 |
---|---|---|
committer | Vasil Zlatanov <v@skozl.com> | 2017-10-17 18:24:07 +0100 |
commit | 8141b4227780faddc9672041bda60d84206b8422 (patch) | |
tree | 10b8894b9718b5642baf08b66faad9b67a662042 /weather | |
download | speech-8141b4227780faddc9672041bda60d84206b8422.tar.gz speech-8141b4227780faddc9672041bda60d84206b8422.tar.bz2 speech-8141b4227780faddc9672041bda60d84206b8422.zip |
make speech project public
Diffstat (limited to 'weather')
-rw-r--r-- | weather/.api.sh.un~ | bin | 0 -> 1479 bytes | |||
-rw-r--r-- | weather/.test.perl.un~ | bin | 0 -> 9295 bytes | |||
-rw-r--r-- | weather/.test.pl.un~ | bin | 0 -> 14600 bytes | |||
-rw-r--r-- | weather/.weather.pl.un~ | bin | 0 -> 67098 bytes | |||
-rwxr-xr-x | weather/weather.pl | 37 |
5 files changed, 37 insertions, 0 deletions
diff --git a/weather/.api.sh.un~ b/weather/.api.sh.un~ Binary files differnew file mode 100644 index 0000000..ee14c0f --- /dev/null +++ b/weather/.api.sh.un~ diff --git a/weather/.test.perl.un~ b/weather/.test.perl.un~ Binary files differnew file mode 100644 index 0000000..604f035 --- /dev/null +++ b/weather/.test.perl.un~ diff --git a/weather/.test.pl.un~ b/weather/.test.pl.un~ Binary files differnew file mode 100644 index 0000000..b462ed2 --- /dev/null +++ b/weather/.test.pl.un~ diff --git a/weather/.weather.pl.un~ b/weather/.weather.pl.un~ Binary files differnew file mode 100644 index 0000000..5c42ce2 --- /dev/null +++ b/weather/.weather.pl.un~ diff --git a/weather/weather.pl b/weather/weather.pl new file mode 100755 index 0000000..2d9a10a --- /dev/null +++ b/weather/weather.pl @@ -0,0 +1,37 @@ +#!/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($_); +#} |