Skip to main content
4 of 7
added 74 characters in body
Doorknob
  • 45.5k
  • 15
  • 102
  • 196

NOTICE: salesforce.SE is under attack! I'm almost of flag ammo! Please come help! aug 22

Doorknob's SpamHelper v2.2

I like Jan's spam helper a lot, but I personally think the question boxes are too big, so I can't see lots of posts at once. I made a little script to rectify this (just run it in the console at http://stackexchange.com/questions?tab=realtime):

s=document.createElement('style');s.innerHTML='.metaInfo,.siteLink,.realtime-body-summary{display:none}.question-container{padding:2px!important}#mainArea a:visited{color:#F44!important}';document.head.appendChild(s)

// Spam detection (only works in Chrome, Firefox, latest Safari,
// and latest Opera) (added in v2)
t=document.getElementsByTagName('title')[0],l=t.innerHTML;(new(window.MutationObserver||window.WebKitMutationObserver)(function(m){m.forEach(function(l){for(var i=0;i<l.addedNodes.length;i++){n=l.addedNodes[i],h=n.innerHTML;if(/<h2>[\s\S]*?\b(live|watch|vs)\W*\b[\s\S]*?<\/h2>/i.test(h)){t.innerHTML='### SPAM FOUND ###';n.style.backgroundColor='#FAA'}}})})).observe(document.getElementById('mainArea'),{childList:true});window.onfocus=function(){t.innerHTML=l}

I doubt it works with Jan's script (:() but I find it very helpful as I can get an overview.

Here's what it looks like (click image to enlarge):

image

Red link means you have visited it. This is so you don't revisit a post you already flagged.


Spam highlighting coming soon! Version 2: spam highlighting added! (click to enlarge)

image

I had to post fake spam to test my script because no spam was coming up :P Don't worry, I deleted it instantly after I saw that it was working.

Here's how I test for spam (h is the text of the question):

if(/<h2>[\s\S]*?\b(live|watch|vs)\W*\b[\s\S]*?<\/h2>/i.test(h)){

Spam also changes the title of the page to ### SPAM FOUND ###. It changes back to the old title when you look at the spam. I might make desktop notifications like Jan's script in a later version.

Changelog:

  • v2.2: fixed bug where sometimes spam wasn't detected
  • v2.1: only search title for spam detection
  • v2: spam detection, fixed bug with red link bleeding.
  • v1: original version.
Doorknob
  • 45.5k
  • 15
  • 102
  • 196