summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-01-07 18:24:18 -0500
committerJesse Luehrs <doy@tozt.net>2014-01-07 18:24:28 -0500
commit1581692d39b10eca543c74f53083fa3ec2ae4f31 (patch)
tree89705eb7a227aaef4361690568c3f8ec127506fc /bin
parent693b06808b16ebd44449ed1c00b6499b627979d0 (diff)
downloadconf-1581692d39b10eca543c74f53083fa3ec2ae4f31.tar.gz
conf-1581692d39b10eca543c74f53083fa3ec2ae4f31.zip
more weather images
Diffstat (limited to 'bin')
-rwxr-xr-xbin/weather25
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');