R

Size: a a a
R

DZ
EN
DZ
R
R
EN
EN
R
R
DZ
DZ
EN
R
function coinmarketcap(crpt, info, refresh) {
var url = 'https://api.coinmarketcap.com/v1/ticker/';
var full_url = url + crpt;
var response = UrlFetchApp.fetch(full_url);
var data = JSON.parse(response.getContentText());
return Number(data[0][info]);
}
function getRates() {
var cr = [['bitcoin', 'price_usd', 1],['bitcoin-cash', 'price_usd', 1],['dash', 'price_usd', 1],['ethereum', 'price_usd', 1],['litecoin', 'price_usd', 1],['zcash', 'price_usd', 1]];
var rates = [];
for(var x=0; x<cr.length; x++){
var data = coinmarketcap(cr[x][0], cr[x][1], cr[x][2], cr[x][3], cr[x][4], cr[x][5], 1);
rates.push(data)
}
return [rates]
}
function pasteRates(){
var parsed = getRates();
var range = 'AG1:AM1';
var first = SpreadsheetApp.openById('SHEETID1');
var second = SpreadsheetApp.openById('SHEETID2');
var third = SpreadsheetApp.openById('SHEETID3');
var firstsheet = first.getSheetByName(new Date().getDate());
var secondsheet = second.getSheetByName(new Date().getDate());
var thirdsheet = third.getSheetByName(new Date().getDate());
firstsheet.getRange(range).setValue(parsed)
secondsheet.getRange(range).setValue(parsed)
thirdsheet.getRange(range).setValue(parsed)R
R
DZ
R
R