Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이진영
/
stockAlarm
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Ubuntu
2021-06-09 16:30:53 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4332060f4378cbbfd3db56a3fbaa17b3ac228409
4332060f
1 parent
c98ff882
Debug
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
10 deletions
app.js
app.js
View file @
4332060
...
...
@@ -26,11 +26,6 @@ fs.readFile('./stock_names.txt', 'utf8', (err,data) => { // 파일 import하고
for
(
let
i
=
0
;
i
<
tempstockList
.
length
;
i
++
){
stockList
[
i
]
=
(
tempstockList
[
i
].
split
(
"\t"
));
// ex) stockList = [[012312,~~],[1230012,~~],[1923,~~],[192310,~~],[...]]
}
// console.log(111)
// console.log(stockList.length)
// for (i in stockList) {
// console.log(stockList[i]);
// }
})
app
.
post
(
'/hook'
,
function
(
req
,
res
)
{
...
...
@@ -46,13 +41,11 @@ app.post('/hook', function (req, res) {
console
.
log
(
'[request message]'
,
eventObj
.
message
);
var
s_code
=
get_stock_code
(
stockList
,
stock_code
,
eventObj
.
replyToken
,
eventObj
.
message
.
text
);
// var wanted_price = get_wanted_price(eventObj.replyToken,eventObj.message.text);
//console.log("s_code:", s_code)
if
(
s_code
!=
-
1
){
cron
.
schedule
(
'*/2 * * * *'
,
()
=>
{
compare
(
s_code
[
0
],
s_code
[
1
],
eventObj
.
replyToken
);
});
// compare(s_code[0], s_code[1],eventObj.replyToken);
}
res
.
sendStatus
(
200
);
...
...
@@ -91,9 +84,7 @@ function get_stock_code(stockList,stock_code,replyToken,message){
//console.log(temp)
var
wanted_stock_name
=
temp
[
0
];
var
wanted_stock_price
=
temp
[
1
];
var
is_in_list
=
false
;
console
.
log
(
"stockList:"
,
stockList
.
length
);
var
is_in_list
=
false
;
if
(
wanted_stock_price
<
0
){
// 원하는 가격 입력받음 (0 이상만)
request
.
post
(
...
...
Please
register
or
login
to post a comment