ad

Tuesday, 25 August 2015

Javascript to mass follow users on twitter!

Well as we all know, social media's become one of the thing your site cannot live without. In this quick post I'll show you guys how to mass follow twitter users.

Here's how it's done.
1. Open a well known user's profile and click on followers.






Now you will see a big list of people that company/person is following. You will also notice the 'following' blue button, which ofcourse are meant to be used to follow these people. Now there should be plenty of people and following each and everyone manually would be just a waste of time.

So to prevent that from happening, we're going to use client side scripting language Javascript! What we're going to do is following.

1. We're first going to target all the buttons using document.getElementsByClassName.This method will return an index array with each user's following button link.
2.  Next we're going to use for loop and loop through that array. While doing so, we're also going to use .click method to click each 'following' button.


Here's the script. Just paste this in your web console and run it. Every time you click the run button page will be scrolled down, so you can continue following people. If it says undefined, it means you're on a wrong page and it couldn't find the element that we're asking it to look for.

var inputs = document.getElementsByClassName('button-text follow-text');
$(document).scrollTop($(document).height());
for(var i=0; i<inputs.length; i++){
  inputs[i].click();
}

No comments:

Post a Comment