summaryrefslogtreecommitdiff
path: root/bin/vweather
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-27 00:00:35 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-27 00:00:46 +0200
commit7669f50c0650196f855d724849e3678355a3f91d (patch)
tree0cd51dabee4a238946e7d6d76d9520432c60bc18 /bin/vweather
parent323707f63f416d6143b14640da4c44db71db223a (diff)
Update for changed icon names
Diffstat (limited to 'bin/vweather')
-rwxr-xr-xbin/vweather11
1 files changed, 9 insertions, 2 deletions
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;