Skip to content

Instantly share code, notes, and snippets.

@maury91
Created May 13, 2016 19:21
Show Gist options
  • Save maury91/749fb66006dc36b11a3c828a9454e803 to your computer and use it in GitHub Desktop.
Save maury91/749fb66006dc36b11a3c828a9454e803 to your computer and use it in GitHub Desktop.
//Paste this script on the console
//Config var, change this var at runtime to change the message
var autoMessage = prompt('Message to send');
//Support var
var isActive = false;
//Check every 200ms if the status of the textarea is changed
setInterval(function() {
var isActiveNow = !document.querySelector('textarea.chatmsg').disabled;
//If the textarea was previously disabled and now is enabled, means that we are meeting a new stranger
//And obviously check if we have a message to send
if ( !isActive && isActiveNow && autoMessage ) {
//Write the message
document.querySelector('textarea.chatmsg').value = autoMessage;
//Send the message after 500ms
setTimeout(function() {
document.querySelector('button.sendbtn').click();
},500);
}
//Update textarea status always
isActive = isActiveNow;
},200);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment