Skip to content

Instantly share code, notes, and snippets.

@testerzs
Last active November 17, 2020 12:53
Show Gist options
  • Save testerzs/b353d8eb6646d1a4a129a4a4c575e79b to your computer and use it in GitHub Desktop.
Save testerzs/b353d8eb6646d1a4a129a4a4c575e79b to your computer and use it in GitHub Desktop.
Send "1337" on 13:37 to a selected WhatsApp chat, Run the code in your console
function sendMessage(message) {
window.InputEvent = window.Event || window.InputEvent;
var event = new InputEvent('input', {
bubbles: true
});
var textbox = document.querySelector('div._3FRCZ');
textbox.textContent = message;
textbox.dispatchEvent(event);
document.querySelector("button._1U1xa").click();
}
function addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
var startCheck = setInterval(checkTime, 1000);
function checkTime() {
var d = new Date();
var h = addZero(d.getHours());
var m = addZero(d.getMinutes());
var s = addZero(d.getSeconds());
console.log(h + ":" + m + ":" + s);
if (h === 13 && m === 37) {
sendMessage("1337");
console.log("Message is successfully sent ");
clearInterval(startCheck);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment