Skip to content

Instantly share code, notes, and snippets.

@joeyguerra
Created January 9, 2021 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeyguerra/3704d30c30c5e07ec459057fdab56202 to your computer and use it in GitHub Desktop.
Save joeyguerra/3704d30c30c5e07ec459057fdab56202 to your computer and use it in GitHub Desktop.
BitCoin price
Notification.requestPermission();
setInterval(async ()=>{
let data = await (await fetch("https://api.coindesk.com/v1/bpi/currentprice.json")).json();
document.body.innerHTML = `${data.time.updated}:%20${data.bpi.USD.rate}`;
if(Notification.permission == "granted") new Notification(`BitCoin Price: $${data.bpi.USD.rate}`);
},10000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment