최현영

Expressfee.json added:

:
...@@ -3,18 +3,23 @@ const request = require('request'); ...@@ -3,18 +3,23 @@ const request = require('request');
3 const bodyParser = require('body-parser'); 3 const bodyParser = require('body-parser');
4 var app = express(); 4 var app = express();
5 var static = require('serve-static'); 5 var static = require('serve-static');
6 +//const xlsx = require('xlsx');
7 +
6 8
7 const fs = require('fs'); 9 const fs = require('fs');
8 const path = require('path'); 10 const path = require('path');
9 const HTTPS = require('https'); 11 const HTTPS = require('https');
10 const TARGET_URL = 'https://api.line.me/v2/bot/message/reply' 12 const TARGET_URL = 'https://api.line.me/v2/bot/message/reply'
11 const TOKEN = 'sqNjA99TptppqvcoVFAnU7Kawsl+s7l+JgnZ7r2is97qrFQraIn0sLQ6mTsIPvXLG7FNK34rvjkXbgwuy0/bgrUn4J5eYPn4H/IH27MdimpiXo/yv+obIN9IKlqR+EF2gLmuXSxMU/LWzyGxCk1G0gdB04t89/1O/w1cDnyilFU=' 13 const TOKEN = 'sqNjA99TptppqvcoVFAnU7Kawsl+s7l+JgnZ7r2is97qrFQraIn0sLQ6mTsIPvXLG7FNK34rvjkXbgwuy0/bgrUn4J5eYPn4H/IH27MdimpiXo/yv+obIN9IKlqR+EF2gLmuXSxMU/LWzyGxCk1G0gdB04t89/1O/w1cDnyilFU='
12 -//const PAPAGO_URL = 'https://openapi.naver.com/v1/papago/n2mt' 14 +//const workbook = xlsx.readFile(__dirname + '/pyblic/Expressfee.xlsx');
13 -//const PAPAGO_ID = 'AH9WUFCtTrz9xnJ6dpxB'
14 -//const PAPAGO_SECRET = 'um7UxSvbxD'
15 15
16 const domain = "www.chyoss.tk" 16 const domain = "www.chyoss.tk"
17 const sslport = 23023; 17 const sslport = 23023;
18 +const buffer = fs.readFileSync('/public/Expressfee.json');
19 +const datafeejson = buffer.toString();
20 +const feedata = JSON.parse(datafeejson);
21 +console.log("Expressfee.json 파일 읽기");
22 +
18 23
19 app.use(bodyParser.json()); 24 app.use(bodyParser.json());
20 //전역변수 선언 25 //전역변수 선언
...@@ -693,7 +698,7 @@ function roadcongest(eventObj, msg ){ ...@@ -693,7 +698,7 @@ function roadcongest(eventObj, msg ){
693 for(var i = 0; i < jsonForcongest.list.length; i++){ 698 for(var i = 0; i < jsonForcongest.list.length; i++){
694 if(jsonForcongest.list[i].routeNo.indexOf(number) >= 0){ 699 if(jsonForcongest.list[i].routeNo.indexOf(number) >= 0){
695 count += 1; 700 count += 1;
696 - roadnumberstring += ("- 노선이름: " + jsonForcongest.list[i].routeName + ", 정체구간: " + jsonForcongest.list[i].conzoneName + ', 기점종점방향: ' + jsonForcongest.list[i].updownTypeCode + ', 교통량: ' + jsonForcongest.list[i].trafficAmout + ', 평균속도: ' + jsonForcongest.list[i].speed + " "); 701 + roadnumberstring += ("# 노선이름: " + jsonForcongest.list[i].routeName + ", 정체구간: " + jsonForcongest.list[i].conzoneName + ', 기점종점방향: ' + jsonForcongest.list[i].updownTypeCode + ', 교통량: ' + jsonForcongest.list[i].trafficAmout + ', 평균속도: ' + jsonForcongest.list[i].speed + " ");
697 } 702 }
698 } 703 }
699 704
......
This diff could not be displayed because it is too large.