Skip to content

Instantly share code, notes, and snippets.

@Veedrac
Last active August 29, 2015 13:56
Show Gist options
  • Save Veedrac/9152964 to your computer and use it in GitHub Desktop.
Save Veedrac/9152964 to your computer and use it in GitHub Desktop.
This filters out "left", "right", "up", etc. as well as
* Small mistypes (aka "up]")
* "naked jenna" spam
Derived shamelessly from the other public filter scripts; I just changed the matching pattern. Paste in console (CTRL+ALT+J in Chrome). PS: Only do so to scripts you trust, as they can be malicious.
WARNING: MAY NEED YOU TO REFRESH FIRST TO REMOVE OTHER SIMILAR SCRIPTS THAT ARE RUNNING.
--------
var FILTER_REGEX=/^\s*((.+www\.naked.+|.?l.?e.?f.?|.?r.?i.?g.?h.?|.?u.?p?.?|.?d.?o.?w.?|.?s.?t.?a.?r.?|.?s.?e.?l.?e.?c.?t|a.?|b.?|democracy|anarchy)\d?)+\s*$/i;$("<style type='text/css' >.segmented_tabs li li a.CommandsToggle {width: 50px;padding-left: 0px;padding-top: 0;height: 8px;line-height: 115%;}.segmented_tabs li li a.ChatToggle {width: 35px;padding-left: 15px;padding-top: 0;height: 8px;line-height: 115%;}#chat_line_list li { display:none }#chat_line_list li.fromjtv,#chat_line_list.showSpam li.cSpam,#chat_line_list.showSafe li.cSafe {display:inherit;} </style>").appendTo("head");var CHAT_BUTTON=$("ul.segmented_tabs li a").first();CHAT_BUTTON.css("width",CHAT_BUTTON.width()-71),$("<li><a class='CommandsToggle'>Commands</a><a class='ChatToggle'>Talk</a></li>").insertAfter(CHAT_BUTTON),$(".CommandsToggle").click(function(){$(this).toggleClass("selected"),$("#chat_line_list").toggleClass("showSpam")}),$(".ChatToggle").click(function(){$(this).toggleClass("selected"),$("#chat_line_list").toggleClass("showSafe")}),$(".ChatToggle").click(),CurrentChat.line_buffer=800,setInterval(function(){"use strict";$("#chat_line_list li:not(.cSpam):not(.cSafe)").each(function(){var a=$(this),b=a.find(".chat_line");a.length>0&&(b.text().match(FILTER_REGEX)?a.addClass("cSpam"):a.addClass("cSafe"))}),CurrentChat.currently_scrolling&&CurrentChat.scroll_chat()},100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment