Created
December 15, 2011 04:06
-
-
Save zengargoyle/1479795 to your computer and use it in GitHub Desktop.
weather
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use 5.014; | |
use warnings; | |
use Weather::Google; | |
use Data::Dump qw(pp dd); | |
use LWP::UserAgent; | |
my $gw = Weather::Google->new('Glendale, CA'); | |
my $current = $gw->current; | |
#print STDERR pp $current; | |
#my $ua = LWP::UserAgent->new; | |
#my $icon = $current->{icon} =~ s!.*/!!r; | |
#$ua->mirror("http://www.google.com" . $current->{icon}, $icon); | |
#printf q[${image %s -p 0,0 -s 20x20}${offset 20} %02d°]."\n", $icon, $current->{temp_f}; | |
my @fc = @{ $gw->forecast }; | |
printf "%s %02d/%-02d %s\n", | |
$_->{day_of_week}, $_->{high}, $_->{low}, $_->{condition} | |
for @fc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment