Created
January 24, 2015 17:08
-
-
Save yask123/d085d4b7a486d00dd103 to your computer and use it in GitHub Desktop.
Send messages on whatsapp by Javascript
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
document.getElementsByClassName("input")[1].innerHTML="This message was written via JS script! "; // Fills the text box message | |
var input = document.getElementsByClassName("icon btn-icon icon-send");//Grabs the send button | |
input[0].click();// Clicks the send button |
If you are looking for a whatsapp spammer bot, I have updated it with instructions and working 29 september 2018
https://gist.github.com/igormuba/f37b8630cadbb511c53e7765de34bc6c
/**
* 1) Open a contact or group on Whatsapp Web;
* 2) Copy the Javascript code below;
* 3) Open the developer tools: CTRL + SHIFT + I;
* 4) Go to the "Console" tab and paste the code;
* 5) The function was added on the page;
* 6) Now, still on the console, type: spam ();
* 7) A pop-up will be displayed requesting the spam message and
* how many messages you want to send per second (I recommend placing 2 to 5).
*/
function spam() {
let prompt1 = prompt("Enter the spam message", "");
const prompt2 = prompt("Send how many messages per second?", 1);
const input = document.getElementsByClassName("_3FRCZ")[1];
window.InputEvent = window.Event || window.InputEvent;
let count = 0;
if (prompt1 === "") {
prompt1 = "​";
}
console.log("Spam started ...");
window.setInterval(function() {
count++;
input.innerHTML = prompt1;
input.dispatchEvent(new InputEvent("input", {
bubbles: true
}));
let enviar = document.getElementsByClassName("_1U1xa")[0];
enviar.click();
console.log('Messasages sent: ' + count);
}, 1000 / prompt2);
}
/** * 1) Open a contact or group on Whatsapp Web; * 2) Copy the Javascript code below; * 3) Open the developer tools: CTRL + SHIFT + I; * 4) Go to the "Console" tab and paste the code; * 5) The function was added on the page; * 6) Now, still on the console, type: spam (); * 7) A pop-up will be displayed requesting the spam message and * how many messages you want to send per second (I recommend placing 2 to 5). */ function spam() { let prompt1 = prompt("Enter the spam message", ""); const prompt2 = prompt("Send how many messages per second?", 1); const input = document.getElementsByClassName("_3FRCZ")[1]; window.InputEvent = window.Event || window.InputEvent; let count = 0; if (prompt1 === "") { prompt1 = "​"; } console.log("Spam started ..."); window.setInterval(function() { count++; input.innerHTML = prompt1; input.dispatchEvent(new InputEvent("input", { bubbles: true })); let enviar = document.getElementsByClassName("_1U1xa")[0]; enviar.click(); console.log('Messasages sent: ' + count); }, 1000 / prompt2); }
It shows
Uncaught TypeError: Cannot set property 'innerHTML' of undefined
at :19:25
How to send with media ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UPDATE + SPAM SEND EVERY X SECONDS + MORE LEGIBLE CODE (credits to rafaelxavierborges for the skeleton of the code)
Tested on Google Chrome = does not work
Tested on Firefox = works