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 22:44:51 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
ba1012afb2bc6351b55085c9f62d8f957f46dd95
ba1012af
2 parents
26f0f78f
84ac6338
Merge branch 'master' of
ssh://khuhub.khu.ac.kr:12959/2018102214/LINEBOT
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
app.js
app.js
View file @
ba1012a
...
...
@@ -201,6 +201,7 @@ function handleEvent(event) {
request
.
post
(
options
,
function
(
error
,
response
,
body
)
{
var
data
=
JSON
.
stringify
(
body
);
console
.
log
(
data
);
var
text
=
''
;
while
(
data
.
indexOf
(
'text\\'
)
!=-
1
)
{
...
...
@@ -208,6 +209,8 @@ function handleEvent(event) {
text
+=
data
.
substring
(
0
,
data
.
indexOf
(
"\\"
))
+
" "
;
}
text
=
text
.
substring
(
text
.
length
/
10
+
1
,
text
.
length
/
8
+
2
);
text
=
text
.
replace
(
' '
,
''
);
text
=
text
.
substr
(
0
,
text
.
indexOf
(
' '
));
console
.
log
(
text
);
var
url
=
"https://www.genie.co.kr/search/searchLyrics?query="
+
text
;
request
(
url
,
function
(
error
,
response
,
html
)
...
...
@@ -226,13 +229,17 @@ function handleEvent(event) {
}
})
console
.
log
(
songs
);
var
resultm
=
''
;
for
(
var
i
=
0
;
i
<
song
List
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
song
s
.
length
;
i
++
){
if
(
songs
[
i
].
singer
!=
''
){
resultm
+=
songs
[
i
].
singer
+
", "
+
songs
[
i
].
song
+
"\n"
;
console
.
log
(
resultm
);
}
}
var
result
=
{
type
:
'text'
,
text
:
resultm
};
console
.
log
(
resultm
);
var
result
=
{
type
:
'text'
,
text
:
resultm
};
console
.
log
(
result
);
client
.
replyMessage
(
event
.
replyToken
,
result
).
then
(
resolve
).
catch
(
reject
);
});
...
...
Please
register
or
login
to post a comment