Permalink
Browse files

Handle changes to LyricWiki.org site.

They now only HTML-encode the start of the <lyrics> tag in the edit box, e.g.
"&gt;lyrics>" rather than "&gt;lyrics&lt;".
  • Loading branch information...
1 parent 5eeb23e commit 278f0ae4238bcfba82dc10c15244a8e10b971b64 @bigpresh committed Jan 17, 2011
Showing with 10 additions and 2 deletions.
  1. +4 −0 Changes
  2. +6 −2 lib/Lyrics/Fetcher/LyricWiki.pm
View
@@ -1,5 +1,9 @@
Revision history for Perl extension Lyrics::Fetcher::LyricWiki
+0.10 2011/01/17
+ - Handle changes in LyricWiki.org site (they now HTML-encode only the start
+ of the <lyrics>...</lyrics> tag, e.g. "&gt;lyrics>")
+
0.09 2010/12/21
- Another failing test due to song lyric wording change.
@@ -8,7 +8,7 @@ use warnings;
use LWP::UserAgent;
use Carp;
-our $VERSION = '0.09';
+our $VERSION = '0.10';
# the HTTP User-Agent we'll send:
our $AGENT = "Perl/Lyrics::Fetcher::LyricWiki $VERSION";
@@ -99,7 +99,11 @@ sub fetch {
# OK, parse the HTML:
my $html = $resp->content;
- my ($lyrics) = $html =~ m{ &lt;lyrics?&gt; (.+?) &lt;/lyrics?&gt;}xms;
+ my ($lyrics) = $html =~ m{
+ &lt;lyrics?(?:&gt;|>)
+ (.+?)
+ &lt;/lyrics?(?:&gt;|>)
+ }xms;
if ($lyrics) {
# Looks like we got something usable:

0 comments on commit 278f0ae

Please sign in to comment.