Created
February 16, 2022 18:58
-
-
Save rodrigolopezguerra/97c4a2c240c08efc27dd5425c6cdc13e to your computer and use it in GitHub Desktop.
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 checkAvailability() { | |
var options = { | |
"method" : "GET", | |
}; | |
try { | |
var i; | |
var url = "https://www.cgeonline.com.ar/informacion/apertura-de-citas.html"; | |
var result = UrlFetchApp.fetch(url,options); | |
var response = result.getContentText("iso-8859-1"); | |
var start = "<table" | |
var end ="</table>" | |
var response = response.substring(response.indexOf(start)+start.length, response.indexOf(end)); | |
response = response.split("<tr>"); | |
for(i=0;i<response.length;i++) { | |
r = response[i]; | |
if(r.indexOf("y primera vez") > -1) { | |
a = r.split("<td>"); | |
if(a[3].indexOf("fecha por confirmar") > -1){ | |
} else { | |
var mail = "[email protected]" | |
var asunto = "MONITOR CITAS ES PASAPORTE - SACAR TURNO URGENTE! "+new Date(); | |
var mensaje = "Saca urgente desde la compu renovación para el pasaporte de TONI que los turnos tienen ventanas y duran menos de 1 hora: https://www.cgeonline.com.ar/tramites/citas/opciones-pasaporte.html / \n \n"; | |
GmailApp.sendEmail(mail,asunto,mensaje) | |
} | |
} | |
} | |
} | |
catch (e) { | |
Logger.log(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment