summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8c0c62f)
raw | patch | inline | side by side (parent: 8c0c62f)
author | Thomas Jansen <mithi@mithi.net> | |
Sat, 3 Oct 2009 18:09:25 +0000 (20:09 +0200) | ||
committer | Thomas Jansen <mithi@mithi.net> | |
Sat, 3 Oct 2009 18:09:25 +0000 (20:09 +0200) |
lyrics/02-lyricwiki.rb | patch | blob | history |
diff --git a/lyrics/02-lyricwiki.rb b/lyrics/02-lyricwiki.rb
index 2e1aed79a6a639d2febfb3ae0396917fd8ae4463..b3b702825a4414f67f8c067b77d8d033bdaf06cb 100755 (executable)
--- a/lyrics/02-lyricwiki.rb
+++ b/lyrics/02-lyricwiki.rb
exit(1)
end
-url = $1.gsub(/wikia.com/, "wikia.com/lyrics");
-exit(69) if $1 =~ /action=edit$/
+url = $1
+exit(69) if url =~ /action=edit$/
response = Net::HTTP.get(URI.parse(url))
if not response =~ /<div class='lyricbox'>\s*(.*?)\s*<!--/im
exit(1)
end
+if not $1 =~ /^.*<\/div>(.*?)$/im
+ $stderr.puts "Couldn't remove leading XML tags in lyricbox!\n"
+ exit(1)
+end
+
puts $1.gsub(/<br \/>/, "\n")