Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Created March 26, 2021 14:45
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 ssaurel/8a3fc8379ba6bf01c0999dc2c4719f1d to your computer and use it in GitHub Desktop.
Save ssaurel/8a3fc8379ba6bf01c0999dc2c4719f1d to your computer and use it in GitHub Desktop.
BPI Call For Bitcoin Price in Words
function bitcoinPrice() {
var xmlhttp = new XMLHttpRequest();
var url = "https://api.coindesk.com/v1/bpi/currentprice.json";
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var json = JSON.parse(this.responseText);
parseJson(json);
}
};
xmlhttp.open("GET", url, true);
xmlhttp.send();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment