은승우

Update app.js

Showing 1 changed file with 0 additions and 3 deletions
...@@ -82,14 +82,12 @@ async function handleEvent(event) { ...@@ -82,14 +82,12 @@ async function handleEvent(event) {
82 } 82 }
83 else if (event.type == 'message'&& event.message.type == 'image') { 83 else if (event.type == 'message'&& event.message.type == 'image') {
84 return new Promise(async(resolve,reject)=>{ 84 return new Promise(async(resolve,reject)=>{
85 - var file;
86 85
87 await client.getMessageContent(event.message.id) 86 await client.getMessageContent(event.message.id)
88 .then( 87 .then(
89 async(stream) => { 88 async(stream) => {
90 await stream.on('data', (chunk) => { 89 await stream.on('data', (chunk) => {
91 fs.writeFileSync('./photo/1.png',chunk); 90 fs.writeFileSync('./photo/1.png',chunk);
92 - console.log(file);
93 var cheerio = require('cheerio'); 91 var cheerio = require('cheerio');
94 var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'; 92 var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
95 var options = { 93 var options = {
...@@ -114,7 +112,6 @@ async function handleEvent(event) { ...@@ -114,7 +112,6 @@ async function handleEvent(event) {
114 text+=data.substring(0,data.indexOf("\\"))+" "; 112 text+=data.substring(0,data.indexOf("\\"))+" ";
115 } 113 }
116 text="나의모든날들"; 114 text="나의모든날들";
117 - console.log(text);
118 var url="https://www.genie.co.kr/search/searchLyrics?query="+ encodeURI(text); 115 var url="https://www.genie.co.kr/search/searchLyrics?query="+ encodeURI(text);
119 request(url, function(error, response, html){ 116 request(url, function(error, response, html){
120 var $ = cheerio.load(html); 117 var $ = cheerio.load(html);
......