Skip to content

Instantly share code, notes, and snippets.

@atomize
Created September 12, 2018 17:59
Show Gist options
  • Save atomize/31c37d540841d5efb2c8eb32f1986a8b to your computer and use it in GitHub Desktop.
Save atomize/31c37d540841d5efb2c8eb32f1986a8b to your computer and use it in GitHub Desktop.
CCC Study
function tradeStreamer(fsym) {
var dataUrl = "https://min-api.cryptocompare.com/data/subs?fsym=" + fsym;
return fetch(dataUrl, {
"credentials": "omit",
"headers": {},
"referrer": "https://cryptoqween.github.io/streamer/trade/",
"referrerPolicy": "no-referrer-when-downgrade",
"body": null,
"method": "GET",
"mode": "cors"
}).then(res=>res.json())
}
tradeStreamer("ADA").then(res=>{
console.log(Object.entries(res))
var myMap = new Map(Object.entries(res));
console.log(myMap.get('LTC').TRADES)
}
)
// Needs error handling which will also tell if subscription is available for selected exchange
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment