Skip to content

Instantly share code, notes, and snippets.

@tomtom87
Last active May 9, 2019 05:19
Show Gist options
  • Save tomtom87/12a1bd91b28839a250713b1287c8a611 to your computer and use it in GitHub Desktop.
Save tomtom87/12a1bd91b28839a250713b1287c8a611 to your computer and use it in GitHub Desktop.
// Run this on followers tab (e.g /_followers)
// Scroll the page to get many
var simulateClick = function (elem) {
console.log('clicking');
var evt = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
});
var canceled = !elem.dispatchEvent(evt);
};
var buttons = document.getElementsByTagName('button');
//For twitter uncomment below line
//var buttons = document.getElementsByTagName('span');
for(var i = 0; i < buttons.length; i++){
if(buttons[i].innerText.search('Follow')===0){
setTimeout(simulateClick, (Math.floor(Math.random() * 40000) + 1),buttons[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment