Skip to content

Instantly share code, notes, and snippets.

@masterkrang
Created September 30, 2014 15:10

Revisions

  1. masterkrang created this gist Sep 30, 2014.
    41 changes: 41 additions & 0 deletions gistfile1.js
    Original 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()