diff options
author | dakkar <dakkar@thenautilus.net> | 2013-05-13 19:31:29 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2013-05-16 20:28:28 +0100 |
commit | 3de4c4b1486f1930602f000858d49180e81eb393 (patch) | |
tree | 4fb765918739e56cffcebefa0dff0430a7d6627d /forecast.pl | |
parent | TfL bus API docs (diff) | |
download | HomePanel-3de4c4b1486f1930602f000858d49180e81eb393.tar.gz HomePanel-3de4c4b1486f1930602f000858d49180e81eb393.tar.bz2 HomePanel-3de4c4b1486f1930602f000858d49180e81eb393.zip |
weather forecast
Diffstat (limited to 'forecast.pl')
-rw-r--r-- | forecast.pl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/forecast.pl b/forecast.pl new file mode 100644 index 0000000..814c730 --- /dev/null +++ b/forecast.pl @@ -0,0 +1,27 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.014; +use LWP::Simple; +use URI; +use JSON; +use Data::Printer; + +my $key=$ARGV[0]; + +my $base = URI->new('https://api.forecast.io/forecast'); + +sub URI::path_segments_push { + my ($uri,@segments) = @_; + $uri->path_segments($uri->path_segments,@segments); +} + +# home +$base->path_segments_push( + $key,"51.54,-0.37", +); + +my $content = get($base); + +my $output = decode_json($content); +p $output; |