This file contains 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
// Replace the variables in this block with real values. | |
// You can find the "Instance connection name" in the Google Cloud | |
// Platform Console, on the instance Overview page. | |
var connectionName = 'xxx'; | |
var user = 'xxx'; | |
var userPwd = 'xxx'; | |
var db = 'xxx'; | |
var dbUrl = 'jdbc:google:mysql://' + connectionName + '/' + db; |
This file contains 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
javascript:(function(){output="<html><head><title>Extraer preguntas de Google</title></head><body>";var preguntas = document.getElementsByClassName("kno-ato");for(var i = 0; i < preguntas.length; i++){var pregunta = preguntas[i].innerText;output+=pregunta+"<br />";};with(window.open()){document.write(output);document.close();}})(); |
This file contains 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
/*Obtenemos el status code*/ | |
function getStatusCode(url){ | |
var options = { | |
'muteHttpExceptions': true, | |
'followRedirects': false | |
}; | |
var url_trimmed = url.trim(); | |
var response = UrlFetchApp.fetch(url_trimmed, options); |
This file contains 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
/* | |
* HTML para poner enlaces, que Google no sigue | |
*/ | |
<button onclick="location.href='#'"> Anchor </button> |
This file contains 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 addCalendario() { | |
//1- Acceso al calendario | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); // acceso al sheet | |
var calendarId = spreadsheet.getRange("B2").getValue(); //celda donde esta el ID | |
var tasktCal = CalendarApp.getCalendarById(calendarId);//le pasamos el ID | |
//2. hacer un array con la informacion a meter |
This file contains 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
/** | |
* Función para calcular el % de cambio | |
* | |
* @param {numero} antiguoValor Valor Antiguo | |
* @param {numero} nuevoValor Valor Orginal | |
* @return El % de cambio entre los dos valores | |
* @customfunction | |
*/ | |
function porcentajeCambio(antiguoValor, nuevoValor) { |
This file contains 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
//Obtener la categoria según la URL | |
function getCategory(url) { | |
//var url = "https://www.mismascotas.es/219-golosinas-snacks-gatos"; | |
let mapa= new Map(); | |
mapa.set("Cat Perros","perros"); | |
mapa.set("Cat Gatos","gatos"); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 sendEmail() { | |
let fechahoy = new Date().toLocaleDateString() | |
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("comparativa"); | |
var data = ss.getRange ("A1:D5").getValues(); | |
var message = getTable(data); | |
var mensaje = { | |
to: "destino", |
This file contains 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 crearURL(str) { | |
var regex = /\[?\b(?:de|del|para|la)\b\]?/gi,//Expresió regular con las palabras que queremos eliminar | |
str = str.toLowerCase(); //todo en miniscula | |
str = str.split(" ").join("-"); //separamos por espacios y unimos | |
str = str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); //quitamos acentos | |
str = str.replace (/^/,'/'); //buscamos el inicio y ponemos una /, ponemos el "triangulo entre barras para escapar el caracter /^/ | |
str = str.replace(regex, ''); //quitamos las stopwords | |
str = str.replace("--","-"); // como nos generaba un espacio creaba algo asi palas--padel, remplaazamos -- por - |
OlderNewer