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:16:10 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4f266960139640c7aad53da16db182683682920f
4f266960
1 parent
0ed7d809
search_option6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
app.js
app.js
View file @
4f26696
...
...
@@ -71,14 +71,14 @@ function handleEvent(event) {
else
if
(
event
.
message
.
text
.
substr
(
0
,
4
)
==
"!검색 "
){
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
text_len
=
event
.
message
.
text
.
length
;
var
title
=
event
.
message
.
text
.
substr
(
4
,
text_len
-
4
);
var
search_options
=
{
uri
:
search_api_url
,
qs
:
{
query
:
event
.
message
.
text
.
substr
(
4
,
text_len
-
4
)
,
display
:
1
},
qs
:
{
query
:
title
,
display
:
1
},
headers
:
{
'X-Naver-Client-Id'
:
client_id
,
'X-Naver-Client-Secret'
:
client_secret
}
};
request
.
get
(
search_options
,
function
(
error
,
response
,
body
){
if
(
!
error
&&
response
.
statusCode
==
200
){
var
title
=
JSON
.
parse
(
body
).
items
[
0
].
title
;
var
link
=
JSON
.
parse
(
body
).
items
[
0
].
link
;
var
description
=
JSON
.
parse
(
body
).
items
[
0
].
description
;
...
...
Please
register
or
login
to post a comment