은승우

Update app.js

Showing 1 changed file with 3 additions and 10 deletions
......@@ -85,7 +85,6 @@ async function handleEvent(event) {
var cheerio = require('cheerio');
var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
var imageUrl=event.message.text;
console.log(imageUrl);
var options = {
uri: uriBase,
qs: {
......@@ -108,6 +107,7 @@ async function handleEvent(event) {
data=data.substring(data.indexOf('text\\')+9);
text+=data.substring(0,data.indexOf("\\"))+" ";
}
text="나의모든날들";
var url="https://www.genie.co.kr/search/searchLyrics?query="+ encodeURI(text);
request(url, function(error, response, html){
var $ = cheerio.load(html);
......@@ -132,16 +132,9 @@ async function handleEvent(event) {
client.replyMessage(event.replyToken,result).then(resolve).catch(reject);
});
});
});
}
);
});
});
}
else if(event.type == 'message' && event.message.type == 'text')
{
......