Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -100,7 +100,6 @@ async function handleEvent(event) { | ... | @@ -100,7 +100,6 @@ async function handleEvent(event) { |
100 | request.post(options, function (error, response, body) { | 100 | request.post(options, function (error, response, body) { |
101 | let jsonResponse = JSON.stringify(JSON.parse(body), null, ' '); | 101 | let jsonResponse = JSON.stringify(JSON.parse(body), null, ' '); |
102 | jsonResponse=jsonResponse.toString() | 102 | jsonResponse=jsonResponse.toString() |
103 | - console.log(jsonResponse); | ||
104 | text=''; | 103 | text=''; |
105 | while(jsonResponse.indexOf('text')!=-1) | 104 | while(jsonResponse.indexOf('text')!=-1) |
106 | { | 105 | { |
... | @@ -108,7 +107,8 @@ async function handleEvent(event) { | ... | @@ -108,7 +107,8 @@ async function handleEvent(event) { |
108 | text+=jsonResponse.substring(0,jsonResponse.indexOf("}")-1)+" "; | 107 | text+=jsonResponse.substring(0,jsonResponse.indexOf("}")-1)+" "; |
109 | 108 | ||
110 | } | 109 | } |
111 | - | 110 | + |
111 | + text.replace('\n',' '); | ||
112 | var url="https://www.genie.co.kr/search/searchLyrics?query="+ encodeURI(text); | 112 | var url="https://www.genie.co.kr/search/searchLyrics?query="+ encodeURI(text); |
113 | request(url, function(error, response, html){ | 113 | request(url, function(error, response, html){ |
114 | var $ = cheerio.load(html); | 114 | var $ = cheerio.load(html); | ... | ... |
-
Please register or login to post a comment