Created
January 9, 2021 04:24
-
-
Save joeyguerra/3704d30c30c5e07ec459057fdab56202 to your computer and use it in GitHub Desktop.
BitCoin price
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
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