Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Gab.ai Follow Bot
- // @author @Tumblrisms on twitter, @Fact on gab.ai
- // @description Make sure Greasemonkey/Tampermonkey is ON and then load any /followers or /following page on gab.ai, for example https://gab.ai/fact/following. After a few seconds the script will follow everyone who isn't already followed and then load a random new /followers page to repeat the process. Leave it running in a tab while you do something else and pretty soon you will have 1000+ follows and a couple hundred followers.
- // @namespace gabai
- // @include https://gab.ai/*/followers*
- // @include https://gab.ai/*/following*
- // @version 1.1
- // @grant none
- // ==/UserScript==
- var pctChanceUndo = 75; // 1 to 100 chance of reverting to a random earlier success page if we get stuck, rather than trying a following/follower page switch
- var urlParams = new URLSearchParams(window.location.search);
- var success1 = urlParams.get("success1");
- var success2 = urlParams.get("success2");
- var success3 = urlParams.get("success3");
- function GoToRandomUser()
- {
- // Find all usernames on the current page
- var nodes = document.evaluate("//a[@class='profile-badge__username']", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
- // Did we find any?
- if (nodes.snapshotLength > 0)
- {
- // More than 10 so keep a note of this page in case we get stuck on a private page in the future
- if (nodes.snapshotLength > 10)
- {
- success3 = success2;
- success2 = success1;
- success1 = window.location.pathname;
- }
- // Let's go to a random one next
- var url = "https://gab.ai/" + nodes.snapshotItem(Math.floor((Math.random() * nodes.snapshotLength) + 0)).text.slice(1) + "/followers";
- }
- else
- {
- if (Math.floor((Math.random() * 100) + 1) < pctChanceUndo)
- {
- var roll = Math.floor((Math.random() * 3) + 1);
- if (roll == 3 && success3 != null && success3 != "null")
- {
- url = "https://gab.ai" + success3;
- }
- else if (roll == 2 && success2 != null && success2 != "null")
- {
- url = "https://gab.ai" + success2;
- }
- else if (roll == 1 && success1 != null && success1 != "null")
- {
- url = "https://gab.ai" + success1;
- }
- else
- {
- // User started the script on a page with no available users, so use my page as a start instead
- url = "https://gab.ai/fact/followers";
- }
- }
- else
- {
- // No users found here, so we'll use their /following instead
- var splits = window.location.href.split("/");
- var url = "https://gab.ai/" + splits[3] + "/following";
- }
- }
- // Engage!
- window.location.href = url + "?success1=" + success1 + "&success2=" + success2 + "&success3=" + success3;
- }
- function FollowEveryoneOnThisPage()
- {
- // Find all follow buttons on the current page
- var nodes = document.evaluate("//a[contains(text(),'Follow')]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
- // Loop through and click all the found follow buttons that are visible
- for (var i = 0; i < nodes.snapshotLength; i++)
- {
- if (nodes.snapshotItem(i).text == "Follow" && nodes.snapshotItem(i).style.display != "none")
- {
- nodes.snapshotItem(i).click();
- }
- }
- // In two seconds all the follow requests will definitely have gone through and we can go to another user
- setTimeout(GoToRandomUser, 2000);
- }
- // Random 2 to 5 second delay to give the page time to load and tricky tricky @a ;-)))))
- setTimeout(FollowEveryoneOnThisPage, Math.floor((Math.random() * 5000) + 2000));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement