From 8141b4227780faddc9672041bda60d84206b8422 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Tue, 17 Oct 2017 18:24:07 +0100 Subject: make speech project public --- weather/.api.sh.un~ | Bin 0 -> 1479 bytes weather/.test.perl.un~ | Bin 0 -> 9295 bytes weather/.test.pl.un~ | Bin 0 -> 14600 bytes weather/.weather.pl.un~ | Bin 0 -> 67098 bytes weather/weather.pl | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 37 insertions(+) create mode 100644 weather/.api.sh.un~ create mode 100644 weather/.test.perl.un~ create mode 100644 weather/.test.pl.un~ create mode 100644 weather/.weather.pl.un~ create mode 100755 weather/weather.pl (limited to 'weather') diff --git a/weather/.api.sh.un~ b/weather/.api.sh.un~ new file mode 100644 index 0000000..ee14c0f Binary files /dev/null and b/weather/.api.sh.un~ differ diff --git a/weather/.test.perl.un~ b/weather/.test.perl.un~ new file mode 100644 index 0000000..604f035 Binary files /dev/null and b/weather/.test.perl.un~ differ diff --git a/weather/.test.pl.un~ b/weather/.test.pl.un~ new file mode 100644 index 0000000..b462ed2 Binary files /dev/null and b/weather/.test.pl.un~ differ diff --git a/weather/.weather.pl.un~ b/weather/.weather.pl.un~ new file mode 100644 index 0000000..5c42ce2 Binary files /dev/null and b/weather/.weather.pl.un~ differ 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($_); +#} -- cgit v1.2.3-54-g00ecf