권은령

error fixed

......@@ -146,12 +146,12 @@ function handleEvent(event)
}
});
var result='';
var result = { type: 'text', text:''};
for(var i=0; i<songList.length; i++)
{
result+=i+1 + ". "+ songList[i].singer+" - "+songList[i].song+"\n";
result.text+=i+1 + ". "+ songList[i].singer+" - "+songList[i].song+"\n";
}
console.log(result);
console.log(result.text);
});
client.replyMessage(event.replyToken, result).then(resolve).catch(reject);
});
......
......@@ -4,6 +4,7 @@ var request = require('request');
var url="https://www.genie.co.kr/chart/top200";
request(url, function(error, response, html)
{
var $ = cheerio.load(html);
......@@ -52,7 +53,10 @@ request(url, function(error, response, html)
{
var $ = cheerio.load(html);
var lyric=$('#pLyrics > p').text();
var result=lyric.substring(0, 150);
console.log(songList[randnum].song);
console.log($('#pLyrics > p').text());
console.log(result);
});
})
\ No newline at end of file
......