Skip to content

Instantly share code, notes, and snippets.

@parameshyss
Created December 2, 2015 12:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save parameshyss/38ca12ae158ae8df593a to your computer and use it in GitHub Desktop.
Save parameshyss/38ca12ae158ae8df593a to your computer and use it in GitHub Desktop.
Whatsapp message Loop
// Impress your gf with this simple js
// Open https://web.whatsapp.com/
// select the person you want to send this msg on loop & type the following script on developer console of your browser
var intervalID = setInterval(function () {
var message = document.createEvent("TextEvent");
message.initTextEvent ("textInput", true, true, window, "I think of you every second", 0, "en-US");
document.getElementsByClassName("input")[1].focus(); // Focus on message box
document.getElementsByClassName("input")[1].dispatchEvent(message); // Type message
document.getElementsByClassName("icon btn-icon icon-send")[0].click(); // Click send
}, 1000); // Repeat every sec
@steoo
Copy link

steoo commented Jun 6, 2016

Awesome work!

@amalmys
Copy link

amalmys commented Dec 8, 2016

cannot read property 'click' of undefined ...................im getting this error

@sachin-karmakar
Copy link

how to stop this code.

@Karthikeyan-2001
Copy link

How to stop the code ?

@guglie
Copy link

guglie commented Jun 20, 2020

😆 If you want to stop annoying your girlfriend you can:

clearInterval(intervalID);

@Nikhil143hub
Copy link

Not working, undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment