JavaScript snippet to hide spam

K

Ken Snyder

I just wrote a quick JavaScript snippet to hide spam posts on c.l.j.--
or really any google group. You can run it from the command line or
save it as a greasemonkey script. It uses document.querySelectorAll,
so the browser must support that.

https://gist.github.com/821334

Basically it just hides posts with titles or bodies containing phrases
like "online order" and "hot videos". Not 100% accurate, but it make
c.l.j. MUCH more useful.
 
D

David Mark

I just wrote a quick JavaScript snippet to hide spam posts on c.l.j.--
or really any google group. You can run it from the command line or
save it as a greasemonkey script. It uses document.querySelectorAll,
so the browser must support that.

Why didn't you just use jQuery?! It's popular and it makes all
browsers work the same. And queries are its specialty. It's mature
too! At least that's what they are saying about v1.4.4 (or
something). They finally made it--the perfect script for all browsers
and all applications!

I'm kidding of course. :)

http://www.cinsoft.net/slickspeed.html

That's where those stupid JS query engines ended up after five years.
A total bust.

If I wanted to do a query, I'd use QSA as well (after feature testing
of course). What about all of the old browsers that don't feature
QSA? I wouldn't tie a critical feature to QSA, nor would I trust old
browsers to brittle BS like jQuery (it doesn't come close to
replicating QSA in IE).
https://gist.github.com/821334

Basically it just hides posts with titles or bodies containing phrases
like "online order" and "hot videos". Not 100% accurate, but it make
c.l.j. MUCH more useful.

Or you could use a newsreader. ;)
 
D

David Mark

Averaging a number of iterations, IE 9 RC gives these final times on
Vista (though Iguess jQuery should be updated to 1.5):

   5 NWMatcher 1.2.1
262 Prototype 1.6.0.2 (gave errors)
  10 Prototype 1.6.1.0
114 JQuery 1.2.6 (gave errors)
   7 JQuery 1.3.2
   4 JQuery 1.4.0
203 YUI 2.7.0 (gave errors)
   6 YUI 3.0
  34 Dojo 1.3.2 (gave errors)
  37 Dojo 1.4.0 (gave errors)
136 My Library 1.0
  10 My Library 1.0 QSA

jQuery 1.3.2 and 1.4, NWMatcher 1.2.1, and  YUI 3 were *fastest*.

You have to remember that they are all handing off to the browsers
(e.g. using QSA). So removing the disqualifications (errored) and
those that do not use QSA at all:-

5 NWMatcher 1.2.1
10 Prototype 1.6.1.0
7 JQuery 1.3.2
4 JQuery 1.4.0
6 YUI 3.0
10 My Library 1.0 QSA

The results are too close to be relevant (as should be expected when
testing QSA).

More importantly, in IE9's Compatibility Mode (which surely will lack
QSA), all of the others will be disqualified (with extreme prejudice)
due to errors and miscounts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top