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-07 11:47:57 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d5681d1e78e5f2e91e21241196e69f7a91761fc3
d5681d1e
1 parent
872cbdb4
Translate stock name to stock code 22
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
app.js
app.js
View file @
d5681d1
...
...
@@ -8,8 +8,9 @@ const HTTPS = require('https');
const
domain
=
"2020105648.oss2021.tk"
const
sslport
=
23023
;
const
bodyParser
=
require
(
'body-parser'
);
const
fs
=
require
(
'fs'
);
var
app
=
express
();
//var lan = "en
"
var
stock_code
=
"005930
"
app
.
use
(
bodyParser
.
json
());
...
...
@@ -20,7 +21,29 @@ app.post('/hook', function (req, res) {
var
message
=
eventObj
.
message
;
let
storkList
=
[]
let
stockList
=
[];
import
'./stock_names.txt'
;
fs
.
readFile
(
'./stock_names.txt'
,
'utf8'
,
(
err
,
data
)
=>
{
if
(
err
){
console
.
error
(
err
)
return
}
console
.
log
(
data
)
})
// fs.readFile('./stock_names.txt', 'utf8', (err,data) => {
// if (err){
// console.error(err)
// return
// }
// var stockList = data.toString().split("\n");
// for (i in stockList) {
// console.log(stockList[i]);
// }
// })
// ########
// file import
...
...
@@ -28,12 +51,16 @@ app.post('/hook', function (req, res) {
// [000660, SK하이닉스]
// stockList = [[000660, sk하이닉스], []]
}
//
}
for
(
let
i
=
0
;
i
<
stockList
.
length
;
i
++
){
if
(
stockList
[
i
][
1
]
==
SK
하이닉스
)
return
stickList
[
i
][
0
]
}
// for (let i=0; i<stockList.length; i++){
// if (eventObj.message.text == stockList[i][1]){
// stock_code = stockList[i][0]
// }
// else{
// print('Not in list');
// }
// }
// ############
// request log
...
...
Please
register
or
login
to post a comment