diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-01-07 18:24:18 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-01-07 18:24:28 -0500 |
commit | 1581692d39b10eca543c74f53083fa3ec2ae4f31 (patch) | |
tree | 89705eb7a227aaef4361690568c3f8ec127506fc /bin | |
parent | 693b06808b16ebd44449ed1c00b6499b627979d0 (diff) | |
download | conf-1581692d39b10eca543c74f53083fa3ec2ae4f31.tar.gz conf-1581692d39b10eca543c74f53083fa3ec2ae4f31.zip |
more weather images
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/weather | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/bin/weather b/bin/weather index 9edb704..a19e817 100755 --- a/bin/weather +++ b/bin/weather @@ -12,18 +12,15 @@ use WWW::Wunderground::API; chomp(my $api_key = file("$ENV{HOME}/.wunderground")->slurp); my %weather_pics = ( - 'Thunderstorm' => "\x{26a1}", - 'Rain' => "\x{2614}", - 'Heavy Rain' => "\x{2614}", - 'Light Rain' => "\x{2614}", - 'Light Drizzle' => "\x{2614}", - 'Partly Cloudy' => "\x{2601}", - 'Mostly Cloudy' => "\x{2601}", - 'Scattered Clouds' => "\x{2601}", - 'Overcast' => "\x{2601}", - 'Fog' => "\x{2601}", - 'Clear' => "\x{2600}", - 'Light Snow' => "\x{2744}", + 'Thunderstorm' => "\x{26a1}", + 'Rain' => "\x{2614}", + 'Drizzle' => "\x{2614}", + 'Cloudy' => "\x{2601}", + 'Clouds' => "\x{2601}", + 'Overcast' => "\x{2601}", + 'Fog' => "\x{2601}", + 'Clear' => "\x{2600}", + 'Snow' => "\x{2744}", ); my $wu = WWW::Wunderground::API->new( @@ -40,7 +37,9 @@ my $high = $forecast->{high}{fahrenheit}; my $low = $forecast->{low}{fahrenheit}; my $feelslike = int($conditions->feelslike_f); my $precip = $forecast->{pop}; -my $weather = $weather_pics{$conditions->weather} // '?'; + +(my $description = $conditions->weather) =~ s/.* //; +my $weather = $weather_pics{$description} // '?'; my $time = DateTime->now(time_zone => 'local'); |