Showing
5 changed files
with
0 additions
and
73 deletions
.gitignore
deleted
100644 → 0
File moved
package-lock.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
package.json
deleted
100644 → 0
| 1 | -{ | ||
| 2 | - "name": "coin-trade-assistant", | ||
| 3 | - "version": "1.0.0", | ||
| 4 | - "description": "", | ||
| 5 | - "main": "test.js", | ||
| 6 | - "scripts": { | ||
| 7 | - "test": "echo \"Error: no test specified\" && exit 1" | ||
| 8 | - }, | ||
| 9 | - "repository": { | ||
| 10 | - "type": "git", | ||
| 11 | - "url": "http://khuhub.khu.ac.kr/2018102235/Coin-trade-assistant.git" | ||
| 12 | - }, | ||
| 13 | - "author": "", | ||
| 14 | - "license": "ISC", | ||
| 15 | - "dependencies": { | ||
| 16 | - "@types/node": "^15.6.1", | ||
| 17 | - "express": "^4.17.1", | ||
| 18 | - "node-fetch": "^2.6.1", | ||
| 19 | - "ws": "^7.4.6" | ||
| 20 | - } | ||
| 21 | -} |
test.js
deleted
100644 → 0
| 1 | -const express = require('express'); | ||
| 2 | -const app = express(); | ||
| 3 | - | ||
| 4 | -const fetch = require('node-fetch'); | ||
| 5 | -const api_key = '';//Delete before commit API ddaro bonae jum. | ||
| 6 | - | ||
| 7 | -const url = 'https://api.whale-alert.io/v1/status?api_key=' + api_key; | ||
| 8 | -const options = {method: 'GET', headers: {Accept: 'application/json'}}; | ||
| 9 | - | ||
| 10 | -fetch(url, options) | ||
| 11 | - .then(res => res.json()) | ||
| 12 | - .then(json => console.log(json)) | ||
| 13 | - .catch(err => console.error('error:' + err)); | ||
| 14 | - | ||
| 15 | - | ||
| 16 | -const url2 = 'https://api.whale-alert.io/v1/transactions?api_key=' + api_key; | ||
| 17 | - | ||
| 18 | -function data_collector(data){ | ||
| 19 | - var ret = ''; | ||
| 20 | - var str = ''; | ||
| 21 | - for(var i = 0; i < data.transactions.length; i++){ | ||
| 22 | - str = '#' + (i+1)+' ChainName: '+data.transactions[i].blockchain+'\tAmount: '+data.transactions[i].amount+' USD' | ||
| 23 | - if(data.transactions[i].amount > 1000000){ | ||
| 24 | - str = '=====!WARNING!=====\n</br>' + str + '\n</br>=====!WARNING!=====' | ||
| 25 | - console.log(str) | ||
| 26 | - } | ||
| 27 | - else{ | ||
| 28 | - console.log(str) | ||
| 29 | - } | ||
| 30 | - ret += '</br>' + str; | ||
| 31 | - } | ||
| 32 | - console.log(data.transactions) | ||
| 33 | - console.log(typeof(data.transactions)) | ||
| 34 | - return ret; | ||
| 35 | -} | ||
| 36 | - | ||
| 37 | -app.get('/', function (req, res) { | ||
| 38 | - result = "" | ||
| 39 | - if(req.query.hi == "hi"){ | ||
| 40 | - result = "yes!" | ||
| 41 | - } | ||
| 42 | - else{ | ||
| 43 | - result = "no!" | ||
| 44 | - } | ||
| 45 | - res.send(result) | ||
| 46 | -}) | ||
| 47 | - | ||
| 48 | -var server = app.listen(23023) | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment