Last active
May 9, 2019 05:19
-
-
Save tomtom87/12a1bd91b28839a250713b1287c8a611 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
// 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