This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require('lodash'); | |
const request = require('request'); | |
// Algorithm will run every 5 seconds | |
setInterval(() => { | |
// API request to Coin Market Cap for top 20 cryptocurrencies | |
request('https://api.coinmarketcap.com/v1/ticker/', (error, response, body) => { | |
const coins = JSON.parse(body); |