Skip to content

Instantly share code, notes, and snippets.

@jmaroeder
Created April 2, 2016 00:10
Show Gist options
  • Select an option

  • Save jmaroeder/6e9a34692a587c5a2c6115bffd27f6b2 to your computer and use it in GitHub Desktop.

Select an option

Save jmaroeder/6e9a34692a587c5a2c6115bffd27f6b2 to your computer and use it in GitHub Desktop.
Script to clear out spam in www.reddit.com/robin
var spamCount = 0;
var badMonkeys = [
/\[Robin Autovoter/,
/\[Robin-Grow/,
/༼ つ ◕_◕ ༽つ/,
/Mins remaining/,
/go౦ԁ pAsta/,
/4cxkw7/,
/4cwk2s/,
/╠═══╣/,
/THE RABBIT/,
/[\u0080-\uFFFF]/,
/^(voted to|I automatically|###|~~~|\$\$\$|O-o|>>>)/,
/^\[/,
/(.\s){4,}/,
/join(rhino|squirrel)/,
/60s pong/,
/Exotic_Russian_Women/
];
// Let's attach an event to the Chat Window, to get the latest messages.
$("#robinChatWindow").on('DOMNodeInserted', function(e) {
"use strict";
var i, badmonkey;
//Then we get the content or the latest message
var message = $(e.target).find("span")[1].textContent;
//AND its User's name
var username = $(e.target).find("span")[0].textContent;
for (i = 0; i < badMonkeys.length; i++) {
if (message.search(badMonkeys[i]) >= 0) {
spamCount++;
e.target.parentNode.removeChild(e.target);
console.log("Removed " + spamCount + " spams.");
break;
}
}
badMonkeys.forEach(function(badMonkey) {
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment