Last active
June 16, 2022 12:17
Revisions
-
kmikiy revised this gist
Aug 10, 2020 . 1 changed file with 2 additions and 21 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,31 +7,12 @@ function BINANCE_PRICE(coinsymbol, pair) { return data.price } /* USAGE example Enter: =BINANCE_PRICE("LTC", "BTC") in a cell to get the last trade price of LTC/BTC on binance */ -
kmikiy revised this gist
Jan 16, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -29,9 +29,9 @@ function CRYPTO_PRICE(site, symbol, pair) { /* USAGE example Enter: =CRYPTO_PRICE("Binance","ELF","BTC") in a cell to get the last trade price of ELF/BTC on binance */ -
kmikiy created this gist
Jan 15, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ function BINANCE_PRICE(coinsymbol, pair) { var url = "https://api.binance.com/api/v3/ticker/price?symbol="+coinsymbol.toUpperCase()+pair.toUpperCase() var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var json = response.getContentText(); var data = JSON.parse(json); return data.price } function CRYPTOPIA_PRICE(coinsymbol, pair) { var url = "https://www.cryptopia.co.nz/api/GetMarket/"+coinsymbol.toUpperCase()+"_"+pair.toUpperCase() var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); var json = response.getContentText(); var data = JSON.parse(json); return data.Data.LastPrice } function CRYPTO_PRICE(site, symbol, pair) { if (site.toLowerCase() == "binance") { return BINANCE_PRICE(symbol, pair) } if (site.toLowerCase() == "cryptopia") { return CRYPTOPIA_PRICE(symbol, pair) } return 0 } /* USAGE example Enter in a cell =CRYPTO_PRICE("Binance","ELF","BTC") to get the last trade price of ELF/BTC on binance */