Created
December 25, 2025 00:15
-
-
Save alnahian2003/3061f4cc3d373cdd824f696dc98bf41f to your computer and use it in GitHub Desktop.
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
| /** | |
| * Medium 50-Clap Automator | |
| * * Instructions: | |
| * 1. Open a Medium article. | |
| * 2. Open Browser Console (F12 or Ctrl+Shift+I or Cmd+Option+J on Mac). | |
| * 3. Paste this code and hit Enter. | |
| * * Warning: DO NOT USE THIS FOR SPAMMING. | |
| */ | |
| (function() { | |
| const clapButton = document.querySelector('button[data-testid="headerClapButton"]') || | |
| document.querySelector('button[data-testid="footerClapButton"]'); | |
| if (clapButton) { | |
| let claps = 0; | |
| const limit = 50; | |
| const intervalTime = 200; // ms | |
| console.log("%c Clapper initialized. Starting...", "color: #1a8917; font-weight: bold;"); | |
| const interval = setInterval(() => { | |
| clapButton.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true })); | |
| clapButton.dispatchEvent(new MouseEvent('mousedown', { bubbles: true })); | |
| clapButton.click(); | |
| claps++; | |
| // Log progress every 10 claps for a cleaner console | |
| if (claps % 10 === 0 || claps === limit) { | |
| console.log(`Clapped ${claps}/${limit}`); | |
| } | |
| if (claps >= limit) { | |
| clearInterval(interval); | |
| console.log("%c Finished! 50 claps given. Enjoy the article!", "color: #1a8917; font-weight: bold;"); | |
| } | |
| }, intervalTime); | |
| } else { | |
| console.error("Clap button not found. Please ensure the article is fully loaded and you are logged in."); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment