Created
September 3, 2019 16:34
-
-
Save dotenorio/289d48435b3f79de88b4cd74c4b3acf0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 abrirPessoas () { | |
elemento = document.querySelector('.gV3Svc') | |
elemento.click() | |
} | |
function abrirChat () { | |
elemento = document.querySelector('.HKarue') | |
elemento.click() | |
} | |
function publicarNomesChat (nomesRandomizados) { | |
paraPublicar = nomesRandomizados.join('\n') | |
chatInput = document.querySelector('.KHxj8b') | |
chatInput.value = paraPublicar | |
} | |
function getNomesRandomizados () { | |
pessoas = document.querySelectorAll('.cS7aqe') | |
if (!pessoas.length) { | |
return setTimeout(() => { | |
getNomesRandomizados() | |
}, 1000) | |
} | |
soNomes = [ ...pessoas ].map(pessoa => { | |
return pessoa.innerText | |
.replace(' (You)', '') | |
}) | |
nomesRandomizados = soNomes | |
.map((a) => ({sort: Math.random(), value: a})) | |
.sort((a, b) => a.sort - b.sort) | |
.map((a) => a.value) | |
setTimeout(() => { | |
abrirChat() | |
publicarNomesChat(nomesRandomizados) | |
}, 100) | |
} | |
abrirPessoas() | |
getNomesRandomizados() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hahahahaha