Created
          April 1, 2016 23:13 
        
      - 
      
 - 
        
Save julianh2o/1a3be7f1dc981982b0428645048c8093 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
julianh2o created this gist
Apr 1, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ // ==UserScript== // @name Reddit Robin Spam Filter // @namespace http://julianhartline.com/ // @version 0.13 // @description Adds mute functionality and spam filter // @author Julian Hartline (julianh2o) // @match https://www.reddit.com/robin // @grant none // ==/UserScript== var storageKey = "RedditRobinMutedUsers"; var savedMutes = localStorage.getItem(storageKey) || ''; $("#robinDesktopNotifier").after($("<input id='mutedUsers' placeholder='Muted usernames, separated by comma'>").val(savedMutes).change(function() { localStorage.setItem(storageKey,$(this).val()); })); $("#robinChatMessageList").on("DOMNodeInserted",function(e) { if ($(e.target).is(".robin-message")) { var mutedUsers = $("#mutedUsers").val().replace(/ /g,"").split(","); var uname = $(e.target).find(".robin--username").text(); if ($.inArray(uname,mutedUsers) !== -1) { console.log("Spam Filtered Message: ",$(e.target).text()); $(e.target).hide(); } } });