Skip to content

Instantly share code, notes, and snippets.

@jbinfo
Last active February 5, 2023 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbinfo/9e9261d7f43cf140b724 to your computer and use it in GitHub Desktop.
Save jbinfo/9e9261d7f43cf140b724 to your computer and use it in GitHub Desktop.
auto twitter follow script
;(function(global, $) {
/**** PARAMETERS BLOCK ************************/
var miniFollowersToIgnore = 0,
miniFollowingToKeep = 1000,
secondes = Math.floor((Math.random() * 10) + 10),
enableBioFilter = false,
userBioKeywords = [
'devel', 'code', 'analysis',
'cloud', 'unix', 'tech', 'computer',
'.net', 'freelance', 'guru', 'UX',
'program', 'social', 'python', 'ios',
'php', 'web', 'technology', 'design',
'software', 'engineer', 'geek',
'technical', 'commerce', 'research',
'IT', 'tecno', 'university', 'ruby'
]
;
/**** END PARAMETERS BLOCK ********************/
var isInFollowingTab = global.top.location.pathname.indexOf('following') > -1,
delayBwActions = 0
;
var actionBtnClick = function(item) {
if($(item).find('.following-text').is(isInFollowingTab ? ':visible': ':hidden')) {
delayBwActions += secondes;
setTimeout(
function() {
$(item).click();
},
delayBwActions * 1000
);
}
}
$($('.user-actions-follow-button').get().reverse()).each(function(index, item) {
if (isInFollowingTab && index < miniFollowingToKeep) {
return;
}
if (!isInFollowingTab && index < miniFollowersToIgnore) {
return;
}
if (isInFollowingTab || !enableBioFilter) {
actionBtnClick(item);
return;
}
var bio = $(item).parents('.ProfileCard-content').find('.ProfileCard-bio').text().toLowerCase();
$.each(userBioKeywords, function(keywIndex, keyw) {
if (bio.indexOf(keyw) > -1) {
actionBtnClick(item);
return false;
}
});
});
})(window, $);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment