Skip to content

Instantly share code, notes, and snippets.

@zengargoyle
Created December 15, 2011 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zengargoyle/1479829 to your computer and use it in GitHub Desktop.
Save zengargoyle/1479829 to your computer and use it in GitHub Desktop.
simple weather
#!/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