Showing
1 changed file
with
1 additions
and
10 deletions
... | @@ -26,11 +26,6 @@ fs.readFile('./stock_names.txt', 'utf8', (err,data) => { // 파일 import하고 | ... | @@ -26,11 +26,6 @@ fs.readFile('./stock_names.txt', 'utf8', (err,data) => { // 파일 import하고 |
26 | for (let i=0; i<tempstockList.length; i++){ | 26 | for (let i=0; i<tempstockList.length; i++){ |
27 | stockList[i] = (tempstockList[i].split("\t")); // ex) stockList = [[012312,~~],[1230012,~~],[1923,~~],[192310,~~],[...]] | 27 | stockList[i] = (tempstockList[i].split("\t")); // ex) stockList = [[012312,~~],[1230012,~~],[1923,~~],[192310,~~],[...]] |
28 | } | 28 | } |
29 | - // console.log(111) | ||
30 | - // console.log(stockList.length) | ||
31 | - // for (i in stockList) { | ||
32 | - // console.log(stockList[i]); | ||
33 | - // } | ||
34 | }) | 29 | }) |
35 | 30 | ||
36 | app.post('/hook', function (req, res) { | 31 | app.post('/hook', function (req, res) { |
... | @@ -46,13 +41,11 @@ app.post('/hook', function (req, res) { | ... | @@ -46,13 +41,11 @@ app.post('/hook', function (req, res) { |
46 | console.log('[request message]', eventObj.message); | 41 | console.log('[request message]', eventObj.message); |
47 | 42 | ||
48 | var s_code = get_stock_code(stockList,stock_code,eventObj.replyToken,eventObj.message.text); | 43 | var s_code = get_stock_code(stockList,stock_code,eventObj.replyToken,eventObj.message.text); |
49 | - // var wanted_price = get_wanted_price(eventObj.replyToken,eventObj.message.text); | ||
50 | //console.log("s_code:", s_code) | 44 | //console.log("s_code:", s_code) |
51 | if (s_code != -1){ | 45 | if (s_code != -1){ |
52 | cron.schedule('*/2 * * * *', () => { | 46 | cron.schedule('*/2 * * * *', () => { |
53 | compare(s_code[0], s_code[1],eventObj.replyToken); | 47 | compare(s_code[0], s_code[1],eventObj.replyToken); |
54 | }); | 48 | }); |
55 | - // compare(s_code[0], s_code[1],eventObj.replyToken); | ||
56 | } | 49 | } |
57 | 50 | ||
58 | res.sendStatus(200); | 51 | res.sendStatus(200); |
... | @@ -91,9 +84,7 @@ function get_stock_code(stockList,stock_code,replyToken,message){ | ... | @@ -91,9 +84,7 @@ function get_stock_code(stockList,stock_code,replyToken,message){ |
91 | //console.log(temp) | 84 | //console.log(temp) |
92 | var wanted_stock_name = temp[0]; | 85 | var wanted_stock_name = temp[0]; |
93 | var wanted_stock_price = temp[1]; | 86 | var wanted_stock_price = temp[1]; |
94 | - var is_in_list = false; | 87 | + var is_in_list = false; |
95 | - | ||
96 | - console.log("stockList:",stockList.length); | ||
97 | 88 | ||
98 | if (wanted_stock_price < 0){ // 원하는 가격 입력받음 (0 이상만) | 89 | if (wanted_stock_price < 0){ // 원하는 가격 입력받음 (0 이상만) |
99 | request.post( | 90 | request.post( | ... | ... |
-
Please register or login to post a comment