]>
git.r.bdr.sh - rbdr/lyricli.rb/blob - lib/lyricli/lyrics_engine.rb
65e36dbf95d23786412225ee56a47f0f7f3509ec
6 def initialize(artist
, song
)
7 @provider = URI("http://lyrics.wikia.com/api.php?artist=#{sanitize_param artist}&song=#{sanitize_param song}&fmt=realjson")
12 response
= Net
::HTTP.get(@provider)
13 response
= MultiJson
.decode(response
)
15 doc
= Nokogiri
::HTML(open(response
['url']))
16 node
= doc
.search(".lyricbox").first
18 raise Lyricli
::LyricsNotFoundException
21 node
.search(".rtMatcher").each
do |n
|
25 node
.search("br").each
do |br
|