Created
September 30, 2014 15:10
Revisions
-
masterkrang created this gist
Sep 30, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ var numberOfUsers = 3000 // the nubmer of users you want to follow (it will break after about 5000) function harvest() { // keep scrolling the page to the bottom $("#search").scrollTop($("#search")[0].scrollHeight); // get all the follow buttons var bs = $('*[data-capture="noiseClicked"]')//.length // figure out how many follow buttons you have var len = bs.length // show the number of people you have on the page because you're impatient console.log(len) // if you have more than said number then stop harvesting if ( len > numberOfUsers) { } else { // choose a random number of time for when to call harvest again, since internet speeds differ setTimeout(harvest, Math.floor(Math.random() * 500) + 1); } } // start harvesting harvest(); var i = 0; // counter // get all the follow buttons on the page var buttons = $('*[data-capture="noiseClicked"]') function follow() { // simulate a click on the button $(buttons[i]).trigger("click") // show that you followed it console.log("follow") // increment the counter i = i + 1 // check all the buttons have been clicked if (i < buttons.length - 1) { // all the buttons haven't been clicked, click more, bitch! setTimeout(follow, 400); } } // start it follow()