I’m basically trying to get the Lyric tag from the response I make to the ChartLyrics API. Here is the code I’ve written:
require 'nokogiri'
require 'open-uri'
request = Net::HTTP.get(URI.parse('http://api.chartlyrics.com/apiv1.asmx/GetLyric?lyricId=1710&lyricCheckSum=a4a56a99ee00cd8e67872a7764d6f9c6'))
puts request
response = Nokogiri::XML(request)
puts response.xpath("//Lyric")[0].to_s
I’ve read to the documentation but I did not find an answer. What I am doing wrong here?
Try the below code