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