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-04 23:58:05 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
86e276177418a4d563d9f872d040869f456049e2
86e27617
1 parent
aab5ea33
fixing error...
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
app.js
app.js
View file @
86e2761
...
...
@@ -121,9 +121,6 @@ function handleEvent(event)
else
if
(
event
.
message
.
text
.
substring
(
0
,
5
)
==
'순위 보기'
)
{
// music list 출력
return
new
Promise
(
function
(
resolve
,
reject
){
var
result
=
{
type
:
'text'
,
text
:
''
};
var
url
=
"https://www.genie.co.kr/chart/top200"
;
request
(
url
,
function
(
error
,
response
,
html
){
...
...
@@ -131,8 +128,7 @@ function handleEvent(event)
var
songList
=
[];
const
$bodyList
=
$
(
'#body-content > div.newest-list > div > table > tbody > tr'
);
$bodyList
.
each
(
function
(
i
,
elem
)
{
$bodyList
.
each
(
function
(
i
,
elem
){
if
(
i
<
20
)
{
songList
.
push
(
...
...
@@ -147,13 +143,17 @@ function handleEvent(event)
return
;
}
});
});
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
result
=
{
type
:
'text'
,
text
:
''
};
for
(
var
i
=
0
;
i
<
songList
.
length
;
i
++
)
{
result
.
text
+=
i
+
1
+
". "
+
songList
[
i
].
singer
+
" - "
+
songList
[
i
].
song
+
"\n"
;
}
console
.
log
(
result
.
text
);
});
client
.
replyMessage
(
event
.
replyToken
,
result
).
then
(
resolve
).
catch
(
reject
);
});
}
...
...
Please
register
or
login
to post a comment