Subject: | Add Spotify support [patch] |
The attached patch adds support for spotify via the spotify.url.fi service.
Subject: | spotify.diff |
--- lib/URI/Title.pm~ 2008-09-30 07:36:32.000000000 +0100
+++ lib/URI/Title.pm 2009-07-27 13:05:31.000000000 +0100
@@ -224,6 +224,9 @@
$data = 1; # we don't need it, fake it.
} else {
+ # special case for spotify
+ $url =~ s{^(?:http://open.spotify.com/|spotify:)(\w+)[:/]}
+ {http://spotify.url.fi/$1/};
($data, $cset) = get_limited($url);
}
}
--- lib/URI/Title/HTML.pm~ 2008-05-22 16:46:16.000000000 +0100
+++ lib/URI/Title/HTML.pm 2009-07-27 13:09:22.000000000 +0100
@@ -73,6 +73,8 @@
# google can be used as a calculator. Try to find the result.
$special_case = 'calc_img.*<td nowrap>(.+?)</td';
+ } elsif ($url =~ /spotify\.url\.fi/) {
+ $special_case = '<title>\s*(.+?)\s+—\s+Decode\s+Spotify\s+URIs\s*</title>';
}