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-07 22:50:41 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cddaf1e6965642267c38ecb2e6af099f36dec5bf
cddaf1e6
1 parent
e4a7ce14
Delete test.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
33 deletions
test.js
test.js
deleted
100644 → 0
View file @
e4a7ce1
const
fetch
=
require
(
'node-fetch'
);
var
fs
=
require
(
'fs'
);
fs
.
readFile
(
'coin_name.txt'
,
'utf8'
,
function
(
err
,
data
){
arr
=
data
.
split
(
","
);
// console.log(arr);
var
responseList
=
new
Array
();
for
(
j
=
0
;
j
<
2
;
j
++
){
for
(
i
=
j
*
10
;
i
<
(
j
+
1
)
*
10
;
i
++
){
(
function
(
i
){
setTimeout
(
function
(){
const
url
=
'https://api.upbit.com/v1/candles/minutes/1?market='
+
arr
[
i
]
+
'&count=1'
;
const
options
=
{
method
:
'GET'
,
headers
:
{
Accept
:
'application/json'
}};
var
coinJson
=
new
Object
();
fetch
(
url
,
options
)
.
then
(
res
=>
res
.
json
())
.
then
(
json
=>
{
coinJson
.
coin
=
arr
[
i
];
coinJson
.
price
=
json
[
0
].
trade_price
;
responseList
.
push
(
coinJson
);
// console.log(responseList)
console
.
log
(
i
)
})
.
catch
(
err
=>
console
.
error
(
'error:'
+
err
));
},
i
*
10
);
})(
i
);
}
}
})
Please
register
or
login
to post a comment