From: Thomas Jansen Date: Wed, 9 Sep 2009 07:19:33 +0000 (+0200) Subject: updated lyricwiki plugin X-Git-Tag: release-0.15~26 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dbebc69f5b2473f0833409cc0e99deceee6dd4fb;p=ncmpc.git updated lyricwiki plugin Lyricwiki doesn't provide lyrics directly through it's API anymore. Instead, a link to the lyrics is returned if they were found. Follow that link to get the real thing. --- diff --git a/lyrics/02-lyricwiki.rb b/lyrics/02-lyricwiki.rb index 9c9f663..08938b8 100755 --- a/lyrics/02-lyricwiki.rb +++ b/lyrics/02-lyricwiki.rb @@ -30,4 +30,11 @@ response = Net::HTTP.get(URI.parse(url)) exit(2) unless response =~ /
\s*(.*?)\s*<\/pre>/im
 exit(2) if $1 == "Not found"
-puts $1
+
+url = $1
+url =~ //im
+
+response = Net::HTTP.get(URI.parse(url))
+exit(2) unless response =~ /
\s*(.*?)\s*

/im + +puts $1.gsub(/
/, "\n")