Skip to content

Instantly share code, notes, and snippets.

@dr-dimitru
Last active May 5, 2019 21:34
Show Gist options
  • Save dr-dimitru/b914a886b68f520f542dd10a2c0a4a16 to your computer and use it in GitHub Desktop.
Save dr-dimitru/b914a886b68f520f542dd10a2c0a4a16 to your computer and use it in GitHub Desktop.
Follow all accounts displayed on a page
// Better to execute this in Google Chrome
// 0. Go to twitter on the page where you would like to Follow other users (with [follow] buttons)
// 1. Right click on any place of page
// 2. Inspect Element
// 3. In opened panel - choose "console" tab
// 4. Copy-paste code you se below and hit "Enter" key
// Note: Twitter will block if you're going to follow a lot users instantly
// Script below adds between 1.5 and 4 seconds between each "follow" (button click), so you can start it and leave it for a while
(function(){
var newscript = document.createElement('script');
newscript.type = 'text/javascript';
newscript.async = true;
newscript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(newscript);
})();
var delay = 0;
var followed = 0;
var buttons = $('button.follow-text');
buttons.each(function(index, element, all){
setTimeout(function () {
console.dir(`Followed ${++followed} out of ${buttons.length}`);
$(this.element).click();
}.bind({element, index}), delay);
delay = delay + (Math.random() * 2128 + 1512);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment