이종상

temp modified

......@@ -16,6 +16,7 @@ const bodyParser = require('body-parser');
var app = express();
var stack = 0;
var meal, country, cold, spicy;
var teststring;
app.use(bodyParser.json());
app.post('/hook', function (req, res) {
......@@ -179,6 +180,14 @@ https://developers.naver.com/docs/search/local/
else if(stack == 4 && (eventObj.message.text.indexOf("결과") !== -1))
{
{
const option = {
query: '순대',
start: 1,
display: 3,
sort: 'sim',
filter: 'small'
}
ImageSearch(option);
request.post(
{
......@@ -191,8 +200,9 @@ https://developers.naver.com/docs/search/local/
"messages":[
{
"type":"text",
"text":"잠시만 기다려주세요!" // 결과 도출
"text":teststring // 결과 도출
}
]
}
},(error, response, body) => {
......@@ -203,14 +213,7 @@ https://developers.naver.com/docs/search/local/
console.log('[request message]', country);
console.log('[request message]', cold);
console.log('[request message]', spicy);
const option = {
query: '순대',
start: 1,
display: 3,
sort: 'sim',
filter: 'small'
}
ImageSearch(option);
}
......@@ -287,8 +290,10 @@ function ImageSearch(option) {
}
}, function(err,res,body){
let json = JSON.parse(body)
console.log(json)
const json = JSON.parse(body);
console.log(json.items[0].link);
teststring = json.items[0].link;
})
}
......