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:28:41 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
750956fbbbe3e4f42e91c6bb04dac4f032eb2dee
750956fb
1 parent
d1260d94
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
app.js
app.js
View file @
750956f
...
...
@@ -99,15 +99,13 @@ async function handleEvent(event) {
};
request
.
post
(
options
,
function
(
error
,
response
,
body
)
{
var
data
=
body
;
console
.
log
(
data
);
let
jsonResponse
=
JSON
.
stringify
(
JSON
.
parse
(
body
),
null
,
' '
);
var
text
=
''
;
while
(
data
.
indexOf
(
'text\\'
)
!=-
1
)
while
(
jsonResponse
.
indexOf
(
'text\\'
)
!=-
1
)
{
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,7 +130,7 @@ async function handleEvent(event) {
client
.
replyMessage
(
event
.
replyToken
,
result
).
then
(
resolve
).
catch
(
reject
);
});
});
});
}
...
...
Please
register
or
login
to post a comment