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:26:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d1260d946c7c8e61206a62eaed302cd27f476d78
d1260d94
1 parent
77c318dc
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
app.js
app.js
View file @
d1260d9
...
...
@@ -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'
)
{
...
...
Please
register
or
login
to post a comment