Twitter Unfollower

Automatic Twitter unfollower tool. Last Update: 11-22-2014

  1. // ==UserScript==
  2. // @name Twitter Unfollower
  3. // @version 0.5
  4. // @description Automatic Twitter unfollower tool. Last Update: 11-22-2014
  5. // @author ekin@gmx.us
  6. // @namespace https://greasyfork.org/en/users/6473-ekin
  7. // @match https://twitter.com/following
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. window.onload = function () {
  12. var config = {
  13. loadingTime: 1000,
  14. intervalTime: 2000,
  15. debug: true
  16. };
  17. $(".UserActions-editButton").before('<button type="button" id="unfollowBtn" class="edit-button btn"><span class="button-text unfollow-text">Start Unfollowing</span></button> ');
  18. function unfollowAll() {
  19. log("Clicked unfollow buttons.");
  20. $(".user-actions").each(function() {
  21. if (/not-following/i.test($(this).attr("class")) == false) {
  22. $(this).children(".follow-button").trigger("click");
  23. }
  24. });
  25. }
  26. function unfollowInit() {
  27. setInterval(function() {
  28. if ($(window).scrollTop() + $(window).height() == $(document).height() == false) {
  29. unfollowAll();
  30. setTimeout(function() {
  31. log("Go scroll bottom.");
  32. $("html, body").animate({ scrollTop: $(document).height() }, 500);
  33. }, config.loadingTime);
  34. }
  35. }, config.intervalTime);
  36. }
  37. $("#unfollowBtn").click(function() {
  38. log("Clicked start button.");
  39. unfollowInit();
  40. });
  41. function log(text) {
  42. delete console.log;
  43. if (config.debug) {
  44. console.log(Date() + ": " + text + "\n");
  45. }
  46. }
  47. log("Twitter Unfollower is ready.");
  48. };