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-08 11:29:29 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
323cda73d63cab6bee6df569f120ba43287db3b8
323cda73
1 parent
ce074b90
temp
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
175 additions
and
13 deletions
app.js
package-lock.json
app.js
View file @
323cda7
...
...
@@ -8,11 +8,14 @@ const HTTPS = require('https');
const
domain
=
"2020105648.oss2021.tk"
const
sslport
=
23023
;
const
bodyParser
=
require
(
'body-parser'
);
const
axios
=
require
(
'axios'
)
const
cheerio
=
require
(
'cheerio'
)
var
app
=
express
();
//var lan = "en"
var
cron
=
require
(
'node-cron'
);
app
.
use
(
bodyParser
.
json
());
app
.
post
(
'/hook'
,
function
(
req
,
res
)
{
var
eventObj
=
req
.
body
.
events
[
0
];
...
...
@@ -25,18 +28,20 @@ app.post('/hook', function (req, res) {
console
.
log
(
'[request source] '
,
eventObj
.
source
);
console
.
log
(
'[request message]'
,
eventObj
.
message
);
// if (eventObj.message.text == "영어"){
// lan = "en"
// }
// else if (eventObj.message.text == "일본어"){
// lan = "ja"
// }
// else if (eventObj.message.text == "프랑스어"){
// lan = "fr"
// }
// else{
// trans(eventObj.replyToken, eventObj.message.text);
// }
cron
.
schedule
(
'*/5 * * * *'
,
()
=>
{
const
temp
=
axios
.
get
(
`https://finance.naver.com/item/main.nhn?code=
${
stock_code
}
%22`
).
then
(
res
=>
{
let
urList
=
[];
const
$
=
cheerio
.
load
(
res
.
data
)
const
$bodyList
=
$
(
"dl.blind"
).
children
(
"dd"
).
text
();
const
result
=
$bodyList
.
slice
(
73
,
80
)
// 실시간으로 변하는 주식 가격 scrape
console
.
log
(
result
)
}
)
});
request
.
post
(
{
url
:
TARGET_URL
,
...
...
package-lock.json
View file @
323cda7
...
...
@@ -55,6 +55,14 @@
"resolved"
:
"https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz"
,
"integrity"
:
"sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
},
"axios"
:
{
"version"
:
"0.21.1"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-0.21.1.tgz"
,
"integrity"
:
"sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA=="
,
"requires"
:
{
"follow-redirects"
:
"^1.10.0"
}
},
"bcrypt-pbkdf"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz"
,
...
...
@@ -80,6 +88,11 @@
"type-is"
:
"~1.6.17"
}
},
"boolbase"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz"
,
"integrity"
:
"sha1-aN/1++YMUes3cl6p4+0xDcwed24="
},
"bytes"
:
{
"version"
:
"3.1.0"
,
"resolved"
:
"https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz"
,
...
...
@@ -90,6 +103,32 @@
"resolved"
:
"https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz"
,
"integrity"
:
"sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
"cheerio"
:
{
"version"
:
"1.0.0-rc.9"
,
"resolved"
:
"https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.9.tgz"
,
"integrity"
:
"sha512-QF6XVdrLONO6DXRF5iaolY+odmhj2CLj+xzNod7INPWMi/x9X4SOylH0S/vaPpX+AUU6t04s34SQNh7DbkuCng=="
,
"requires"
:
{
"cheerio-select"
:
"^1.4.0"
,
"dom-serializer"
:
"^1.3.1"
,
"domhandler"
:
"^4.2.0"
,
"htmlparser2"
:
"^6.1.0"
,
"parse5"
:
"^6.0.1"
,
"parse5-htmlparser2-tree-adapter"
:
"^6.0.1"
,
"tslib"
:
"^2.2.0"
}
},
"cheerio-select"
:
{
"version"
:
"1.5.0"
,
"resolved"
:
"https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz"
,
"integrity"
:
"sha512-qocaHPv5ypefh6YNxvnbABM07KMxExbtbfuJoIie3iZXX1ERwYmJcIiRrr9H05ucQP1k28dav8rpdDgjQd8drg=="
,
"requires"
:
{
"css-select"
:
"^4.1.3"
,
"css-what"
:
"^5.0.1"
,
"domelementtype"
:
"^2.2.0"
,
"domhandler"
:
"^4.2.0"
,
"domutils"
:
"^2.7.0"
}
},
"combined-stream"
:
{
"version"
:
"1.0.8"
,
"resolved"
:
"https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz"
,
...
...
@@ -126,6 +165,23 @@
"resolved"
:
"https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
,
"integrity"
:
"sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"css-select"
:
{
"version"
:
"4.1.3"
,
"resolved"
:
"https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz"
,
"integrity"
:
"sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA=="
,
"requires"
:
{
"boolbase"
:
"^1.0.0"
,
"css-what"
:
"^5.0.0"
,
"domhandler"
:
"^4.2.0"
,
"domutils"
:
"^2.6.0"
,
"nth-check"
:
"^2.0.0"
}
},
"css-what"
:
{
"version"
:
"5.0.1"
,
"resolved"
:
"https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz"
,
"integrity"
:
"sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg=="
},
"dashdash"
:
{
"version"
:
"1.14.1"
,
"resolved"
:
"https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz"
,
...
...
@@ -157,6 +213,39 @@
"resolved"
:
"https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz"
,
"integrity"
:
"sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"dom-serializer"
:
{
"version"
:
"1.3.2"
,
"resolved"
:
"https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz"
,
"integrity"
:
"sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig=="
,
"requires"
:
{
"domelementtype"
:
"^2.0.1"
,
"domhandler"
:
"^4.2.0"
,
"entities"
:
"^2.0.0"
}
},
"domelementtype"
:
{
"version"
:
"2.2.0"
,
"resolved"
:
"https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz"
,
"integrity"
:
"sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A=="
},
"domhandler"
:
{
"version"
:
"4.2.0"
,
"resolved"
:
"https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz"
,
"integrity"
:
"sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA=="
,
"requires"
:
{
"domelementtype"
:
"^2.2.0"
}
},
"domutils"
:
{
"version"
:
"2.7.0"
,
"resolved"
:
"https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz"
,
"integrity"
:
"sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg=="
,
"requires"
:
{
"dom-serializer"
:
"^1.0.1"
,
"domelementtype"
:
"^2.2.0"
,
"domhandler"
:
"^4.2.0"
}
},
"ecc-jsbn"
:
{
"version"
:
"0.1.2"
,
"resolved"
:
"https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz"
,
...
...
@@ -176,6 +265,11 @@
"resolved"
:
"https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz"
,
"integrity"
:
"sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"entities"
:
{
"version"
:
"2.2.0"
,
"resolved"
:
"https://registry.npmjs.org/entities/-/entities-2.2.0.tgz"
,
"integrity"
:
"sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A=="
},
"escape-html"
:
{
"version"
:
"1.0.3"
,
"resolved"
:
"https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz"
,
...
...
@@ -257,6 +351,11 @@
"unpipe"
:
"~1.0.0"
}
},
"follow-redirects"
:
{
"version"
:
"1.14.1"
,
"resolved"
:
"https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz"
,
"integrity"
:
"sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg=="
},
"forever-agent"
:
{
"version"
:
"0.6.1"
,
"resolved"
:
"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
,
...
...
@@ -304,6 +403,17 @@
"har-schema"
:
"^2.0.0"
}
},
"htmlparser2"
:
{
"version"
:
"6.1.0"
,
"resolved"
:
"https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz"
,
"integrity"
:
"sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A=="
,
"requires"
:
{
"domelementtype"
:
"^2.0.1"
,
"domhandler"
:
"^4.0.0"
,
"domutils"
:
"^2.5.2"
,
"entities"
:
"^2.0.0"
}
},
"http-errors"
:
{
"version"
:
"1.7.2"
,
"resolved"
:
"https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz"
,
...
...
@@ -418,6 +528,19 @@
"mime-db"
:
"1.48.0"
}
},
"moment"
:
{
"version"
:
"2.29.1"
,
"resolved"
:
"https://registry.npmjs.org/moment/-/moment-2.29.1.tgz"
,
"integrity"
:
"sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
},
"moment-timezone"
:
{
"version"
:
"0.5.33"
,
"resolved"
:
"https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz"
,
"integrity"
:
"sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w=="
,
"requires"
:
{
"moment"
:
">= 2.9.0"
}
},
"ms"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"
,
...
...
@@ -428,6 +551,22 @@
"resolved"
:
"https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz"
,
"integrity"
:
"sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
"node-cron"
:
{
"version"
:
"3.0.0"
,
"resolved"
:
"https://registry.npmjs.org/node-cron/-/node-cron-3.0.0.tgz"
,
"integrity"
:
"sha512-DDwIvvuCwrNiaU7HEivFDULcaQualDv7KoNlB/UU1wPW0n1tDEmBJKhEIE6DlF2FuoOHcNbLJ8ITL2Iv/3AWmA=="
,
"requires"
:
{
"moment-timezone"
:
"^0.5.31"
}
},
"nth-check"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz"
,
"integrity"
:
"sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q=="
,
"requires"
:
{
"boolbase"
:
"^1.0.0"
}
},
"oauth-sign"
:
{
"version"
:
"0.9.0"
,
"resolved"
:
"https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz"
,
...
...
@@ -441,6 +580,19 @@
"ee-first"
:
"1.1.1"
}
},
"parse5"
:
{
"version"
:
"6.0.1"
,
"resolved"
:
"https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz"
,
"integrity"
:
"sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw=="
},
"parse5-htmlparser2-tree-adapter"
:
{
"version"
:
"6.0.1"
,
"resolved"
:
"https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz"
,
"integrity"
:
"sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA=="
,
"requires"
:
{
"parse5"
:
"^6.0.1"
}
},
"parseurl"
:
{
"version"
:
"1.3.3"
,
"resolved"
:
"https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz"
,
...
...
@@ -618,6 +770,11 @@
"punycode"
:
"^2.1.1"
}
},
"tslib"
:
{
"version"
:
"2.2.0"
,
"resolved"
:
"https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz"
,
"integrity"
:
"sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w=="
},
"tunnel-agent"
:
{
"version"
:
"0.6.0"
,
"resolved"
:
"https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz"
,
...
...
Please
register
or
login
to post a comment