Skip to content

Instantly share code, notes, and snippets.

@LeonanCarvalho
Created December 18, 2025 21:03
Show Gist options
  • Select an option

  • Save LeonanCarvalho/826351e1767fda5a6fe09239801ed737 to your computer and use it in GitHub Desktop.

Select an option

Save LeonanCarvalho/826351e1767fda5a6fe09239801ed737 to your computer and use it in GitHub Desktop.
Generate CPFs
async function farmCpf(count = 10) {
const cpfs = [];
for (let i = 0; i < count; i++) {
const cpf = await fetch("https://www.4devs.com.br/ferramentas_online.php", {
headers: {
accept: "*/*",
"accept-language": "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
priority: "u=1, i",
"sec-ch-ua":
'"Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Linux"',
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-requested-with": "XMLHttpRequest",
},
referrer: "https://www.4devs.com.br/gerador_de_cpf",
body: "acao=gerar_cpf&pontuacao=S&cpf_estado=",
method: "POST",
mode: "cors",
credentials: "include",
})
.then((response) => response.body)
.then((rb) => {
console.log(rb);
const reader = rb.getReader();
return new ReadableStream({
start(controller) {
function push() {
reader.read().then(({ done, value }) => {
if (done) {
console.log("done", done);
controller.close();
return;
}
controller.enqueue(value);
console.log(done, value);
push();
});
}
push();
},
});
})
.then((stream) =>
// Respond with our stream
new Response(stream, {
headers: { "Content-Type": "text/html" },
}).text()
);
cpfs.push(cpf);
}
return cpfs;
}
await farmCpf(10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment