Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정홍주
/
Coin-trade-assistant
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
배지승
2021-06-04 19:54:36 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
bddc282ec13129197a3fba98a6399f1edf6df628
bddc282e
2 parents
79492b0d
74ef2b3d
Pull whale_alert
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
test.js
test.js
View file @
bddc282
const
express
=
require
(
'express'
);
const
app
=
express
();
const
fetch
=
require
(
'node-fetch'
);
const
api_key
=
''
;
//Delete before commit API ddaro bonae jum.
const
url
=
'https://api.whale-alert.io/v1/status?api_key='
+
api_key
;
const
options
=
{
method
:
'GET'
,
headers
:
{
Accept
:
'application/json'
}};
fetch
(
url
,
options
)
.
then
(
res
=>
res
.
json
())
.
then
(
json
=>
console
.
log
(
json
))
.
catch
(
err
=>
console
.
error
(
'error:'
+
err
));
const
url2
=
'https://api.whale-alert.io/v1/transactions?api_key='
+
api_key
;
function
data_collector
(
data
){
var
ret
=
''
;
var
str
=
''
;
for
(
var
i
=
0
;
i
<
data
.
transactions
.
length
;
i
++
){
str
=
'#'
+
(
i
+
1
)
+
' ChainName: '
+
data
.
transactions
[
i
].
blockchain
+
'\tAmount: '
+
data
.
transactions
[
i
].
amount
+
' USD'
if
(
data
.
transactions
[
i
].
amount
>
1000000
){
str
=
'=====!WARNING!=====\n</br>'
+
str
+
'\n</br>=====!WARNING!====='
console
.
log
(
str
)
}
else
{
console
.
log
(
str
)
}
ret
+=
'</br>'
+
str
;
}
console
.
log
(
data
.
transactions
)
console
.
log
(
typeof
(
data
.
transactions
))
return
ret
;
}
app
.
get
(
'/'
,
function
(
req
,
res
)
{
result
=
""
if
(
req
.
query
.
hi
==
"hi"
){
...
...
Please
register
or
login
to post a comment