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
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
최지민
2019-11-23 21:23:15 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
47a3258db11e1f9631c926e503cdd1df29c63cf2
47a3258d
1 parent
4f266960
search_option7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
app.js
app.js
View file @
47a3258
...
...
@@ -79,13 +79,19 @@ function handleEvent(event) {
};
request
.
get
(
search_options
,
function
(
error
,
response
,
body
){
if
(
!
error
&&
response
.
statusCode
==
200
){
var
link
=
JSON
.
parse
(
body
).
items
[
0
].
link
;
var
description
=
JSON
.
parse
(
body
).
items
[
0
].
description
;
var
result
=
{
type
:
'text'
,
text
:
title
+
" : "
+
description
+
"\n\nlink : "
+
link
};
// 검색 결과가 없을 경우
if
(
JSON
.
parse
(
body
).
items
==
[]){
var
result
=
{
type
:
'text'
,
text
:
"검색 결과가 없습니다."
};
}
else
{
var
link
=
JSON
.
parse
(
body
).
items
[
0
].
link
;
var
description
=
JSON
.
parse
(
body
).
items
[
0
].
description
;
var
result
=
{
type
:
'text'
,
text
:
title
+
" : \n"
+
description
+
"\n\nLink : \n"
+
link
};
}
client
.
replyMessage
(
event
.
replyToken
,
result
).
then
(
resolve
).
catch
(
reject
);
}
...
...
Please
register
or
login
to post a comment