app.js 946 Bytes
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' : 10
    },
    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")){
                selectable_theaters.push(info.place_name);
                console.log(info.place_name + " : " + info.place_url);
            }
        });
    }
});

module.exports = router;