doc = Nokogiri::HTML(open(response['url']))
node = doc.search(".lyricbox").first
rescue
- raise Lyricli::LyricsNotFoundException
+ raise Exceptions::LyricsNotFoundError
end
node.search(".rtMatcher").each do |n|
n.remove
end
+ node.search("script").each do |n|
+ n.remove
+ end
+
node.search("br").each do |br|
br.replace "\n"
end
- node.inner_text
+ node.inner_text.gsub(/\s+$/, "")
end
end
end