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 --- .gitignore | 10 ++++++++-- bin/vweather | 11 +++++++++-- share/weather/partlycloudy | 1 + share/weather/scatteredthunderstorms | 1 + 4 files changed, 19 insertions(+), 4 deletions(-) create mode 120000 share/weather/partlycloudy create mode 120000 share/weather/scatteredthunderstorms diff --git a/.gitignore b/.gitignore index 8f6a118..dd1492a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ +/_build /Build -/_build/ -/blib/ +/blib +/cover_db /lib/Derf/Visual/WeatherIcons.pm +/MANIFEST +/MANIFEST.bak +/MANIFEST.SKIP +/MANIFEST.SKIP.bak +/MYMETA.yml 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; diff --git a/share/weather/partlycloudy b/share/weather/partlycloudy new file mode 120000 index 0000000..d1cf0f7 --- /dev/null +++ b/share/weather/partlycloudy @@ -0,0 +1 @@ +cloudy_40.png \ No newline at end of file diff --git a/share/weather/scatteredthunderstorms b/share/weather/scatteredthunderstorms new file mode 120000 index 0000000..da4e8e6 --- /dev/null +++ b/share/weather/scatteredthunderstorms @@ -0,0 +1 @@ +clouds_rain_40.png \ No newline at end of file -- cgit v1.2.3