Forked from callmeloureiro/comoSerChatoNoWhatsapp.js
Created
October 18, 2017 13:53
-
-
Save pvsousalima/c820a20175671d82244faf97d8203f1a to your computer and use it in GitHub Desktop.
Como fazer alguém te responder no whatsapp
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
var counter = 0; | |
var mensagens = document.getElementsByClassName("message-in"); | |
var quantidadeMsg = mensagens.length | |
var i = setInterval(function(){ | |
window.InputEvent = window.Event || window.InputEvent; | |
var d = new Date(); | |
var event = new InputEvent('input', {bubbles: true}); | |
var textbox = document.querySelector('#main > footer > div.block-compose > div.input-container > div.pluggable-input.pluggable-input-compose > div.pluggable-input-body.copyable-text.selectable-text'); | |
textbox.textContent = "Me responde!"; | |
textbox.dispatchEvent(event); | |
document.querySelector("button.compose-btn-send").click(); | |
counter++; | |
console.log("Já enviei " + counter + ' mensagens.') | |
if(quantidadeMsg != mensagens.length) | |
clearInterval(i); | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment