Skip to content

Instantly share code, notes, and snippets.

@techguybiswa
Created March 19, 2019 15:02
Show Gist options
  • Save techguybiswa/9ad99fdb666229f6eec1fcb75cd391b9 to your computer and use it in GitHub Desktop.
Save techguybiswa/9ad99fdb666229f6eec1fcb75cd391b9 to your computer and use it in GitHub Desktop.
let textToSend = "Hey There. I wanted to wish you Happy New Year. Hope you are doing great.";
textToSend = textToSend.split(".");
let count = 0;
let textbox = document.querySelector('div._2S1VP');
let event = new InputEvent('input', {
bubbles: true
});
let messageLoop = setInterval(function(){
textbox.textContent =textToSend[count] ;
textbox.dispatchEvent(event);
document.querySelector("button._35EW6").click();
count++;
console.log("Sending message number : " + count);
if(count>2){
console.log("I am inside clearInterval");
clearInterval(messageLoop);
}
@atharvaunde
Copy link

Hey there, thanks for this awesome script!
I have 2 doubts:

  1. What is diff in this and automation script?
  2. With automation script, if I want to send 4 line message to everyone with every line as newline do I need to format it using JS syntax or just copy and paste the message?

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