From dbebc69f5b2473f0833409cc0e99deceee6dd4fb Mon Sep 17 00:00:00 2001 From: Thomas Jansen Date: Wed, 9 Sep 2009 09:19:33 +0200 Subject: [PATCH] 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. --- lyrics/02-lyricwiki.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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") -- 2.30.2