Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://moneropric.es/fiat.json
- // Bitcoincharts.com - Weighted Prices
- var url = "http://api.bitcoincharts.com/v1/weighted_prices.json";
- var response = UrlFetchApp.fetch(url);
- var json = response.getContentText();
- var bcharts_data = JSON.parse(json);
- function bit24hr(inNum){
- var x = bcharts_data["USD"]["24h"];
- if (typeof inNum != "number") { // check to make sure input is a number
- throw "input must be a number"; // throw an exception with the error message
- }
- var y = inNum * x
- return y;
- }
- // Monero Price in USD
- var url = "https://moneropric.es/fiat.json";
- var response = UrlFetchApp.fetch(url);
- var json = response.getContentText();
- var monero_data = JSON.parse(json);
- function monero(inNum){
- var x = monero_data["US Dollar"]["fiat-rate"];
- if (typeof inNum != "number") { // check to make sure input is a number
- throw "input must be a number"; // throw an exception with the error message
- }
- var y = inNum * x
- return y;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement