Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save juliomoreira666/bd1037eaa9ade296a658333721ce2fe7 to your computer and use it in GitHub Desktop.
Save juliomoreira666/bd1037eaa9ade296a658333721ce2fe7 to your computer and use it in GitHub Desktop.
Como fazer alguém te responder no facebook...
var counter = 0;
// Limite de mensagens
// Se quiser enviar sem limites da zueira (porque the zuera never ends), basta modificar o valor para 0.
var limit = 100;
// Mensagem que será enviada
var textToSend = "Me responde!";
var i = setInterval(function() {
window.InputEvent = window.Event || window.InputEvent;
var event = new InputEvent('input', {
bubbles: true
});
var textbox = document.querySelector('._1mf._1mj');
if ( counter > 0 ) {
var lastMessage = document.querySelectorAll('._20bp ._4_j4 #js_1 div._3058');
lastMessage = lastMessage[lastMessage.length - 1]
if (!lastMessage.classList.contains('_43by') ) {
textToSend = "Finalmente respondeu!";
clearInterval(i);
}
}
textbox.textContent = textToSend;
textbox.dispatchEvent(event);
document.querySelector("._30yy._38lh._39bl").click();
counter++;
if (counter === limit && limit !== 0)
clearInterval(i);
console.log("Já enviei " + counter + ' mensagens.')
}, 1000); // 1000 = 1 segundo, tempo que será enviada cada mensagem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment