Skip to content

Instantly share code, notes, and snippets.

@samvignoli
Created September 20, 2016 12:37
Show Gist options
  • Save samvignoli/25f9efd539a0e7823884d687a97a9e29 to your computer and use it in GitHub Desktop.
Save samvignoli/25f9efd539a0e7823884d687a97a9e29 to your computer and use it in GitHub Desktop.
function push_pagespeedinsights()
{
var retorno = buscaDados('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=https://www.letras.mus.br');
var valor = retorno.ruleGroups.SPEED.score;
var doc = SpreadsheetApp.getActiveSpreadsheet();
var temp = doc.getSheetByName("MAIN DASHBOARD");
var cell = temp.getRange("M24");
cell.setValue(valor);
var retorno = buscaDados('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=https://m.letras.mus.br');
var valor = retorno.ruleGroups.SPEED.score;
var doc = SpreadsheetApp.getActiveSpreadsheet();
var temp = doc.getSheetByName("MAIN DASHBOARD");
var cell = temp.getRange("M25");
cell.setValue(valor);
var retorno = buscaDados('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=https://m.cifraclub.com.br');
var valor = retorno.ruleGroups.SPEED.score;
var doc = SpreadsheetApp.getActiveSpreadsheet();
var temp = doc.getSheetByName("MAIN DASHBOARD");
var cell = temp.getRange("M29");
cell.setValue(valor);
var retorno = buscaDados('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=https://www.cifraclub.com.br');
var valor = retorno.ruleGroups.SPEED.score;
var doc = SpreadsheetApp.getActiveSpreadsheet();
var temp = doc.getSheetByName("MAIN DASHBOARD");
var cell = temp.getRange("M28");
cell.setValue(valor);
var retorno = buscaDados('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=https://www.palcomp3.com');
var valor = retorno.ruleGroups.SPEED.score;
var doc = SpreadsheetApp.getActiveSpreadsheet();
var temp = doc.getSheetByName("MAIN DASHBOARD");
var cell = temp.getRange("M26");
cell.setValue(valor);
var retorno = buscaDados('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=https://m.palcomp3.com');
var valor = retorno.ruleGroups.SPEED.score;
var doc = SpreadsheetApp.getActiveSpreadsheet();
var temp = doc.getSheetByName("MAIN DASHBOARD");
var cell = temp.getRange("M27");
cell.setValue(valor);
var retorno = buscaDados('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=https://www.ouvirmusica.com.br');
var valor = retorno.ruleGroups.SPEED.score;
var doc = SpreadsheetApp.getActiveSpreadsheet();
var temp = doc.getSheetByName("MAIN DASHBOARD");
var cell = temp.getRange("M31");
cell.setValue(valor);
var retorno = buscaDados('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=https://m.ouvirmusica.com.br');
var valor = retorno.ruleGroups.SPEED.score;
var doc = SpreadsheetApp.getActiveSpreadsheet();
var temp = doc.getSheetByName("MAIN DASHBOARD");
var cell = temp.getRange("N31");
cell.setValue(valor);
// throw new Error(valor);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment