Created
November 17, 2015 22:40
-
-
Save Anderson-Juhasc/ae2368048021e6b68bd6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function BTCFoxBitCompra(currency){ | |
if (currency == null) { | |
currency = "brl"; | |
} | |
var url = "https://api.blinktrade.com/api/v1/BRL/orderbook..."; | |
setInterval(function(){ | |
var response = UrlFetchApp.fetch(url).getResponseCode(); | |
if (response = 200) { | |
var btcbasedata = UrlFetchApp.fetch(url).getContentText(); | |
var object = JSON.parse(btcbasedata); | |
return (object["bids"][0][0]); | |
} else { | |
return "Não consegui contato com o servidor"; | |
} | |
}, 3000);// 3000 ms | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment