Last active
February 11, 2020 21:41
-
-
Save milesflo/bf1c8c117e14a9c7b1327038ecc2c0d3 to your computer and use it in GitHub Desktop.
A tiny GUI-automation script for following accounts on Twitter
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
/** | |
Why?: | |
This script is useful for following a large list of accounts straight from your browser. | |
There are many reasons to use this... Maybe you want to follow everyone in a community but you | |
can't be bothered to click on all those buttons... Maybe you want to follow all these accounts | |
in the hopes that they'll follow you back, giving you lots of free followers for doing nothing | |
How: | |
1. Navigate to a twitter page with multiple [Follow] buttons visible... | |
- Scrolling to the bottom of a page may list more... Do this for maximum efficiency | |
2. Open your browser's command prompt | |
- Chrome: https://developers.google.com/web/tools/chrome-devtools/console/ | |
- Firefox: https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console | |
3. Paste the script below into the line and run | |
*/ | |
var targetUsers = [...document | |
.getElementsByClassName('EdgeButton EdgeButton--secondary EdgeButton--small button-text follow-text')] | |
.filter(button => button.innerText.startsWith('Follow\nFollow')) | |
for (var i = 0; i < targetUsers.length; i++) { | |
let button = targetUsers[i] | |
// Twitter will get mad if you spam this... Clicking buttons on a 1-second cooldown | |
setTimeout(() => { | |
button.click() | |
}, 1000 * i) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@architekco Sounds good to me! I wasn’t planning on this being a living document, but the logic could/will break any time they do a UI overhaul.
Appreciate the contribution, and best of luck “stimulating growth” 😂