Toggle navigation
Toggle navigation
This project
Loading...
Sign in
은승우
/
LINEBOT
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
은승우
2019-12-05 19:23:26 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
77c318dcff509f320a7e117ebac829219358c0e7
77c318dc
1 parent
8deb9acd
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
8 deletions
app.js
app.js
View file @
77c318d
...
...
@@ -82,16 +82,10 @@ async function handleEvent(event) {
}
else
if
(
event
.
type
==
'message'
&&
event
.
message
.
type
==
"text"
&&
event
.
message
.
text
.
indexOf
(
'http://'
)
!=-
1
)
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
await
client
.
getMessageContent
(
event
.
message
.
id
)
.
then
(
async
(
stream
)
=>
{
await
stream
.
on
(
'data'
,
(
chunk
)
=>
{
console
.
log
(
typeof
(
chunk
));
fs
.
writeFileSync
(
"./photo/1.png"
,
chunk
);
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
:
{
...
...
@@ -114,7 +108,6 @@ 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
);
...
...
Please
register
or
login
to post a comment