Skip to content

Instantly share code, notes, and snippets.

@cauethenorio
Forked from rootux/WhatsApp Web Send Random Heart
Last active November 8, 2016 15:18
Show Gist options
  • Save cauethenorio/41a030760e1fbccfe5e55b8c19c53674 to your computer and use it in GitHub Desktop.
Save cauethenorio/41a030760e1fbccfe5e55b8c19c53674 to your computer and use it in GitHub Desktop.
Just a simple WhatsApp Web Heart Sender
/*
Simple WhatsApp Web Spam Bot Originally written by Pablode. Modified by Gal Bracha.
Use with love <3. Do not act reckless.
====================================================================================
DISCLAIMER: I do not take any responsibility for any damage caused with this script.
WhatsApp might be able identify script users if this becomes a problem. Do only use
this if you are aware of the consquences.
====================================================================================
Usage: Copy all of this script (Ctrl+A, Ctrl+C). Add a new Bookmark. In the URL section,
write "javascript:" and paste (Ctrl+V) this script. Visit WhatsApp Web, select your
desired contact and click the Bookmark.
Press f5 to reload the page and stop the script in execution before it finishes.
You may adjust the variables to get the emoji of your desire.
====================================================================================
*/
/* User config */
var msgcount = 100;
var interval = 600 * 1000;
var delay = 250;
var emojiTab = 2; /* There is no 0, from 1 to 6. */
function getRandomEmojiPosition() {
var emojis = ['1490', '1493', '1498', '1475', '1501', '1486', '1476', '1521', '0077'];
return emojis[Math.floor(Math.random() * 100 % emojis.length)]
}
var emojiNumber = Math.floor(Math.random() * 5) + 1 ; /* No 0 either. */
/* The actual code */
function getElementByXpath(path) { return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; }
var winnniey = 0;
function sendMessage() {
setTimeout(function () {
var emojiButton = getElementByXpath('//*[@id="main"]/footer/div/button[1]');
emojiButton.click();
setTimeout(function () {
var tab = getElementByXpath('//*[@id="main"]/footer/div[2]/div/div[1]/button[' + emojiTab + ']');
tab.click();
setTimeout(function () {
var emojiId = getRandomEmojiPosition();
var emoji = getElementByXpath('//*[@id="main"]/footer/div[2]/div/div/div/span/div/div/span[@class="emojik emojiordered' + emojiId + '"]')
emoji.click();
setTimeout(function () {
var sendButton = getElementByXpath('//*[@id="main"]/footer/div/button[2]');
sendButton.click();
setTimeout(function () {
winnniey++;
if (winnniey < msgcount) {
setTimeout(sendMessage, interval);
}
}, delay);
}, delay);
}, delay);
}, delay);
}, delay);
}
sendMessage();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment