Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save hackingbutlegal/2d9090be5f5d01e1930d5c16642896ff to your computer and use it in GitHub Desktop.

Select an option

Save hackingbutlegal/2d9090be5f5d01e1930d5c16642896ff to your computer and use it in GitHub Desktop.
Browser console script to click Like buttons on X with randomized delays.
/*
# Auto Liker Script
## Overview
Automated script to click like buttons on a webpage with randomized delays.
## Features
- Finds and clicks like buttons with random intervals
- Scrolls down page dynamically
- Prevents detection as automated script
## Usage
1. Open browser console
2. Paste entire script
3. Run to start auto-liking
4. Call `stopAutoLike()` to stop
## Customization
- Adjust `randomDelay()` parameters to modify click timing
- Change button selector as needed
## Caution
Respect website terms of service. Automated interactions may violate usage policies.
*/
function randomDelay(min = 500, max = 2000) {
return new Promise(resolve =>
setTimeout(resolve, Math.random() * (max - min) + min)
);
}
async function autoLike() {
// Find like buttons
const likeButtons = document.querySelectorAll('button[data-testid="like"]');
// Click buttons with random delays
for (const button of likeButtons) {
try {
await randomDelay();
button.click();
} catch (error) {
console.error('Error clicking button:', error);
}
}
// Scroll down with slight randomness
window.scrollBy(0, window.innerHeight + Math.random() * 100);
// Schedule next round with variable timing
setTimeout(autoLike, Math.random() * 3000 + 2000);
}
// Start the auto-like process
autoLike();
// Optional: Add a way to stop the process
function stopAutoLike() {
clearTimeout(autoLike);
}
// To stop, call stopAutoLike() in console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment