Page Follow

FHM Page Follow Greasemonkey Userscript

Automatically follows all users on a page 1 by 1 in a Twitter friendly fashion.

// ==UserScript==
// @name FHM Page Follow
// @namespace http://forhiremedia.com/development/scripts/page-follow/
// @description Automatically follows all users on a page 1 by 1
// @include *twitter.com*
// ==/UserScript==

els = document.getElementsByTagName(‘tr’);
var users = new Array();

for(var i in els) {
var row = els[i];
var id = row.getAttribute(‘id’);

if(id != null)
if(id.substring(0,4) == “user”)
users[users.length] = row;
}

var unfollowed = new Array();

for(var i in users) {
var user = users[i];
var cl = user.getAttribute(‘class’);
if(cl.indexOf(‘following’) == -1)
unfollowed[unfollowed.length] = user;
}

var butts = new Array();

for(var i in unfollowed) {
var user = unfollowed[i];
var lis = user.getElementsByTagName(‘li’);

for(var n in lis) {
var li = lis[n];
var cl = li.getAttribute(‘class’);
if(cl == “follow-action”) {
butts[butts.length] = li.getElementsByTagName(‘button’)[0];
}
}
}

if(butts.length > 0) {
el = document.createElement(‘div’);
el.setAttribute(‘id’,’friend_adder_bar’);
el.style.position=”fixed”;
el.style.height=”28px”;
el.style.width=”100%”;
el.style.left=”0″;
el.style.bottom=”0″;
el.style.backgroundColor=”#112233″;
el.style.borderTop=”1px solid #123123″;
el.style.zIndex=”100″;

txt = ”

“;

txt += ”

“;
txt += “You have “+butts.length+” unfollowed friends on this page. “;
txt += “
txt += “Follow All”;
txt += “
“;
txt += “

“;
txt += ”

“;
txt += “Page Follow re-encoded by @ForHireMedia“;
txt += ”

“;
txt += ”

“;

el.innerHTML = txt;

document.body.style.paddingBottom=(“50px”);
document.body.appendChild(el);
}

Install FHM Page Follow Userscript

Leave a Reply

Your email address will not be published. Required fields are marked *