Last active
October 27, 2023 00:24
-
-
Save devinschumacher/de01430ab9ff1bd4a800430b159c3424 to your computer and use it in GitHub Desktop.
MediumClapper, by SERP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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