Permalink
Browse files

Added lyrics.wikia.com scraper

Signed-off-by: Sergey Alirzaev <zl29ah@gmail.com>
  • Loading branch information...
Voker57 authored and l29ah committed May 30, 2011
1 parent 4f2edde commit e6d40028592d493ab6750fe0bb3a0a6c173b51e7
Showing with 9 additions and 0 deletions.
  1. +3 −0 lyrics.wikia.com/lyrics-html
  2. +6 −0 lyrics.wikia.com/lyrics-txt
@@ -0,0 +1,3 @@
#!/usr/bin/env ruby
require 'open-uri'
puts open("http://lyrics.wikia.com/#{URI.escape(ARGV[0])}:#{URI.escape(ARGV[1])}").read.scan(%r|<div class='lyricbox'><div class='rtMatcher'>.*?</div>(.*?)<!--|m)[0][0]
@@ -0,0 +1,6 @@
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'hpricot'
puts Hpricot.parse(open("http://lyrics.wikia.com/#{URI.escape(ARGV[0])}:#{URI.escape(ARGV[1])}")).at('div.lyricbox').children.select {|a| a.name != "div"}.map {|s| s.to_plain_text}.join("") #.to_plain_text

0 comments on commit e6d4002

Please sign in to comment.