From 7669f50c0650196f855d724849e3678355a3f91d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 27 May 2011 00:00:35 +0200 Subject: Update for changed icon names --- bin/vweather | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bin/vweather') diff --git a/bin/vweather b/bin/vweather index b04a203..7c19e6d 100755 --- a/bin/vweather +++ b/bin/vweather @@ -17,6 +17,13 @@ my %opt; my $alpha; my $dump; my $iconstore = Derf::Visual::WeatherIcons->new(); +my $icon_re = qr{ + / + (?: weather_ )? + ([^/]+?) + (?: -40 )? + \. gif $ +}x; my $weather = Weather::Google->new( 'Essen, Germany', @@ -43,7 +50,7 @@ sub show_weather_console { ); if ($dump) { - say $day->{'icon'}; + say ($day->{'icon'} =~ $icon_re); } } } @@ -73,7 +80,7 @@ sub show_weather_png { my $wday = substr($day->{'day_of_week'}, 0, 2); my $low = sprintf('%2d', $day->{'low'}); my $high = sprintf('%2d', $day->{'high'}); - my ($icon) = ($day->{'icon'} =~ m{ / ([^/]+) \. gif $ }x); + my ($icon) = ($day->{'icon'} =~ $icon_re); if (not defined $day) { last; -- cgit v1.2.3