app.js
1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const express = require("express");
const app = express();
const bodyParser = require('body-parser');
const request = require("request");
const router = express.Router();
let kakaoOptions = {
url : "https://dapi.kakao.com/v2/local/search/keyword",
method : "GET",
headers : {
'Authorization': 'KakaoAK 56e51abe725086bc9db03da986e47fed'
},
qs: {
'query': 'CGV 광명',
//'category_group_code' : 'CT1',
'size' : 5
},
encoding : 'UTF-8'
};
request(kakaoOptions, function (err, res, body) {
info_list = JSON.parse(body).documents;
let selectable_theaters = [];
if(!err && res.statusCode == 200){
info_list.forEach(info => {
if(info.category_name.endsWith("CGV")){
const theater_info = {
"theater_name" : info.place_name,
"theater_url" : info.place_url
};
selectable_theaters.push(theater_info);
//console.log(theater_info);
}
});
}
});
module.exports = router;