Showing
5 changed files
with
70 additions
and
9 deletions
SearchingTheatersAPI/app.js
0 → 100644
1 | +const express = require("express"); | ||
2 | +const app = express(); | ||
3 | +const bodyParser = require('body-parser'); | ||
4 | +const request = require("request"); | ||
5 | +const router = express.Router(); | ||
6 | + | ||
7 | +let kakaoOptions = { | ||
8 | + url : "https://dapi.kakao.com/v2/local/search/keyword", | ||
9 | + method : "GET", | ||
10 | + headers : { | ||
11 | + 'Authorization': 'KakaoAK 56e51abe725086bc9db03da986e47fed' | ||
12 | + }, | ||
13 | + qs: { | ||
14 | + 'query': 'CGV 광명', | ||
15 | + //'category_group_code' : 'CT1', | ||
16 | + 'size' : 5 | ||
17 | + }, | ||
18 | + encoding : 'UTF-8' | ||
19 | +} | ||
20 | + | ||
21 | +request(kakaoOptions, function (err, res, body) { | ||
22 | + theater_list = JSON.parse(body).documents; | ||
23 | + if(!err && res.statusCode == 200){ | ||
24 | + theater_list.forEach(info => { | ||
25 | + if(info.category_name.endsWith("CJCGV")) | ||
26 | + console.log(info.place_name + " : " + info.place_url); | ||
27 | + }); | ||
28 | + } | ||
29 | +}) | ||
30 | + | ||
31 | +module.exports = router; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
SearchingTheatersAPI/package.json
0 → 100644
1 | +{ | ||
2 | + "name": "test01", | ||
3 | + "version": "1.0.0", | ||
4 | + "description": "", | ||
5 | + "main": "index.js", | ||
6 | + "scripts": { | ||
7 | + "test": "echo \"Error: no test specified\" && exit 1" | ||
8 | + }, | ||
9 | + "author": "", | ||
10 | + "license": "ISC", | ||
11 | + "dependencies": { | ||
12 | + "body-parser": "^1.17.1", | ||
13 | + "express": "^4.15.2", | ||
14 | + "express-session": "^1.15.2", | ||
15 | + "java": "^16.0.1", | ||
16 | + "request" : "^2.88.2" | ||
17 | + } | ||
18 | + } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
SearchingTheatersAPI/template.js
0 → 100644
1 | +module.exports= { | ||
2 | + html: function(title,style,list,body,control){ | ||
3 | + return ` | ||
4 | + <!doctype html> | ||
5 | + <html> | ||
6 | + <head> | ||
7 | + <title>WEB - ${title}</title> | ||
8 | + <meta charset="utf-8"> | ||
9 | + </head> | ||
10 | + <body> | ||
11 | + <h1><a href="/">WEB</a></h1> | ||
12 | + <div id="map" style=${style}></div> | ||
13 | + ${list} | ||
14 | + ${control} | ||
15 | + ${body} | ||
16 | + <p></p> | ||
17 | + </body> | ||
18 | + </html> | ||
19 | + `; | ||
20 | + } | ||
21 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
SearchingTheatersAPI/test.html
0 → 100644
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment