Showing
1 changed file
with
0 additions
and
35 deletions
... | @@ -11,39 +11,6 @@ let ANIMAL_INFO_API_KEY = process.env.REACT_APP_API_KEY; | ... | @@ -11,39 +11,6 @@ let ANIMAL_INFO_API_KEY = process.env.REACT_APP_API_KEY; |
11 | let user_gu; | 11 | let user_gu; |
12 | let user_latitude; | 12 | let user_latitude; |
13 | let user_longitude; | 13 | let user_longitude; |
14 | -//let hospital_list = []; | ||
15 | - | ||
16 | -// function list_print(res, menu_encode, gu_select_encode){ | ||
17 | -// //api | ||
18 | -// let pet_url = `http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=100&pageNo=1&keyword=${menu_encode}&where=${gu_select_encode}`; | ||
19 | -// request(pet_url, function(err, response, body){ | ||
20 | -// if(err) { | ||
21 | -// console.log(`err => ${err}`) | ||
22 | -// } | ||
23 | -// else { | ||
24 | -// if(res.statusCode == 200) { | ||
25 | -// var result = convert.xml2json(body, {compact: true, spaces: 4}); | ||
26 | -// var petJson = JSON.parse(result) | ||
27 | -// var itemList = petJson.response.body.items; | ||
28 | -// var numRows = itemList.item.length; //개수 | ||
29 | -// for (i=0; i<numRows; i++){ | ||
30 | -// // state 정상인 것만 추리기 | ||
31 | -// if (itemList.item[i].state._text == '정상'){ | ||
32 | -// hospital_list.push(itemList.item[i]); | ||
33 | -// } | ||
34 | -// } | ||
35 | - | ||
36 | -// //테스트용 console.log | ||
37 | -// var titles = ''; | ||
38 | -// for(i=0; i<hospital_list.length; i++){ | ||
39 | -// titles = titles+hospital_list[i].title._text+'\n'; | ||
40 | -// } | ||
41 | -// console.log(titles); | ||
42 | -// } | ||
43 | -// } | ||
44 | -// res.render('result', { category: 'hospital', titles: titles, hospital_list: hospital_list }); | ||
45 | -// }); | ||
46 | -// } | ||
47 | 14 | ||
48 | router.post('/hospital', function(req, res){ | 15 | router.post('/hospital', function(req, res){ |
49 | //gu 받아오기 | 16 | //gu 받아오기 |
... | @@ -55,8 +22,6 @@ router.post('/hospital', function(req, res){ | ... | @@ -55,8 +22,6 @@ router.post('/hospital', function(req, res){ |
55 | var menu_encode = urlencode(menu); | 22 | var menu_encode = urlencode(menu); |
56 | var gu_select_encode = urlencode(gu_select); | 23 | var gu_select_encode = urlencode(gu_select); |
57 | 24 | ||
58 | - //list_print(res, menu_encode, gu_select_encode); | ||
59 | - | ||
60 | //api | 25 | //api |
61 | let pet_url = `http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=100&pageNo=1&keyword=${menu_encode}&where=${gu_select_encode}`; | 26 | let pet_url = `http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=100&pageNo=1&keyword=${menu_encode}&where=${gu_select_encode}`; |
62 | request(pet_url, function(err, response, body){ | 27 | request(pet_url, function(err, response, body){ | ... | ... |
-
Please register or login to post a comment