Subject: | Fails to fetch now that Dilbert page has changed |
Now that the Dilbert website has changed, WWW::Dilbert can no longer
find the comic.
A patch is attached which resolves it for me.
Subject: | Dilbert.pm.patch |
--- Dilbert.pm.orig 2008-04-25 09:50:58.000000000 +0100
+++ Dilbert.pm 2008-04-25 09:55:28.000000000 +0100
@@ -98,10 +98,10 @@
my $response = $ua->get('http://www.dilbert.com');
if ($response->is_success) {
my $html = $response->content;
- if ($html =~ m#<img\s+src="((?:https?://[\w\.:\d\/]+)?
- /comics/dilbert/archive/images/dilbert.+?)"#imsx) {
+ if ($html =~ m{<img \s+ src="( [^"]+ strip.print.gif)"}imsx) {
my $url = $1;
- $url = "http://www.dilbert.com$1" unless $url =~ /^https?:\/\//i;
+ $url = "http://www.dilbert.com$1"
+ unless $url =~ m{^https?://}i;
return $url;
}