최지민

search_option6

Showing 1 changed file with 2 additions and 2 deletions
......@@ -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;
......