Tumblrisms

Gab.ai Unfollow Bot (for Greasemonkey / Tampermonkey)

Oct 9th, 2016
924
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Gab.ai Unfollow Bot
  3. // @author      @Tumblrisms on twitter, @Fact on gab.ai
  4. // @description Make sure Greasemonkey is ON, DISABLE the FOLLOW BOT (if you use it), and then load your /following page on gab.ai. After a few seconds the script will unfollow all visible accounts and then refresh the page to get more followed accounts. Leave it running in a tab and eventually your account will no longer follow anyone.
  5. // @namespace   gabai
  6. // @include     https://gab.ai/*/following
  7. // @version     1
  8. // @grant       none
  9. // ==/UserScript==
  10.  
  11. function ReloadThisPage()
  12. {
  13.     // Engage!
  14.     window.location.href = window.location.href;
  15. }
  16.  
  17. function UnfollowEveryoneOnThisPage()
  18. {
  19.     // Find all unfollow buttons on the current page
  20.     var nodes = document.evaluate("//a[contains(text(),'Unfollow')]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  21.  
  22.     // Loop through and click all the found unfollow buttons that are visible
  23.     for (var i = 0; i < nodes.snapshotLength; i++)
  24.     {
  25.         if (nodes.snapshotItem(i).text == "Unfollow" && nodes.snapshotItem(i).style.display != "none")
  26.         {
  27.             nodes.snapshotItem(i).click();
  28.         }
  29.     }
  30.  
  31.     // In two seconds all the unfollow requests will definitely have gone through and we can reload
  32.     setTimeout(ReloadThisPage, 2000);
  33. }
  34.  
  35.  
  36. setTimeout(UnfollowEveryoneOnThisPage, Math.floor((Math.random() * 2000) + 1000));
Advertisement
Add Comment
Please, Sign In to add comment