Skip to content

Instantly share code, notes, and snippets.

@devinschumacher
Last active October 27, 2023 00:24
Show Gist options
  • Select an option

  • Save devinschumacher/de01430ab9ff1bd4a800430b159c3424 to your computer and use it in GitHub Desktop.

Select an option

Save devinschumacher/de01430ab9ff1bd4a800430b159c3424 to your computer and use it in GitHub Desktop.
MediumClapper, by SERP
let clapButton = document.querySelector('button[data-testid="headerClapButton"]');
if (clapButton) {
const events = ['mousedown', 'mouseup', 'click'];
async function performClap() {
for (let i = 0; i < 50; i++) {
events.forEach(eventType => {
let event = new MouseEvent(eventType, {
'view': window,
'bubbles': true,
'cancelable': true
});
clapButton.dispatchEvent(event);
});
await new Promise(resolve => setTimeout(resolve, 10)); // Introducing a 10ms delay between claps
}
console.log("+50 Claps! Now, go join the SERP community on Discord @ https://serp.ly/@serp/discord !");
}
performClap();
} else {
console.log("Clap button not found!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment