Created
February 5, 2021 00:02
-
-
Save carlosrivera/681071f24329b7014ee86e4eba263569 to your computer and use it in GitHub Desktop.
Work-around para MiVacuna
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
// Verificar registro y descargar comprobante | |
var data = new FormData(); | |
// cambiar por el CURP a verificar | |
data.append("curphd", "LOOA531113HTCPBN07"); | |
var xhr = new XMLHttpRequest(); | |
xhr.withCredentials = true; | |
xhr.addEventListener("readystatechange", function() { | |
if(this.readyState === 4) { | |
console.log(this.responseText); | |
} | |
}); | |
xhr.open("POST", "https://mivacuna.salud.gob.mx/pdf.php"); | |
xhr.send(data); |
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
let data = new FormData() | |
// datos extraídos de la CURP (primera pantalla) | |
data.append('nombre', 'LOPEZ') // en nombre va el primer apellido | |
data.append('paterno', 'OBRADOR') // apellido materno | |
data.append('materno', 'ANDRES MANUEL') // nombre(s), :v | |
data.append('curp', 'LOOA531113HTCPBN07') | |
data.append('fechanac', '1953-11-13') // yyyy-mm-dd | |
data.append('entidad', '') //vacío | |
data.append('sexo', 'HOMBRE') // MUJER | HOMBRE | |
// segunda pantalla, mismo <form> | |
// datos sobre lugar para aplicación de la vacuna + contacto | |
data.append('entidadd', '27') // posición en orden alfabético | |
data.append('municipio', '12') // viene en la credencial del INE | |
data.append('cp', '86706') | |
data.append('telefono_1', '5550934800') | |
data.append('telefono_2', '5550934800') | |
data.append('correoe', '[email protected]') | |
data.append('correoea', '[email protected]') // confirmar email | |
data.append('nota', '') | |
data.append('confirmar', 'Enviar') // enviado por el 'submit' | |
let xhr = new XMLHttpRequest() | |
xhr.withCredentials = true | |
xhr.addEventListener('readystatechange', function () { | |
if (this.readyState === 4) { | |
console.log(this.responseText) | |
} | |
}) | |
xhr.open('POST', 'https://mivacuna.salud.gob.mx/index.php') | |
xhr.send(data) | |
/* municipio viene en la credencial del INE, o se puede obtener | |
haciendo el siguiente POST a ./entidadd.php | |
let entidad = 14; | |
let url = "https://mivacuna.salud.gob.mx/entidadd.php"; | |
$.post(url, { entidadd: entidad }, (data) => { | |
console.log(data) | |
});*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment