JavaScript snippet to hide spam

Discussion in 'Javascript' started by Ken Snyder, Feb 10, 2011.

  1. Ken Snyder

    Ken Snyder Guest

    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.
    Ken Snyder, Feb 10, 2011
    #1
    1. Advertising

  2. Ken Snyder

    David Mark Guest

    On Feb 10, 4:05 pm, Ken Snyder <> wrote:
    > 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. ;)
    David Mark, Feb 10, 2011
    #2
    1. Advertising

  3. Ken Snyder

    David Mark Guest

    Re: Slickspeed Was: Re: JavaScript snippet to hide spam

    On Feb 10, 5:05 pm, Andrew Poulos <> wrote:
    > On 11/02/2011 8:28 AM, David Mark wrote:
    >
    > >http://www.cinsoft.net/slickspeed.html

    >
    > 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.
    David Mark, Feb 10, 2011
    #3
  4. Ken Snyder

    David Mark Guest

    Re: Slickspeed Was: Re: JavaScript snippet to hide spam

    On Feb 10, 5:21 pm, Andrew Poulos <> wrote:
    > On 11/02/2011 9:11 AM, David Mark wrote:
    >
    >
    >
    > > On Feb 10, 5:05 pm, Andrew Poulos<>  wrote:
    > >> On 11/02/2011 8:28 AM, David Mark wrote:

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

    >
    > >> 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.

    >
    > With IE9's Compatibility View everything except My Library erred. My
    > Library timed at 346ms.


    That's what I'm talking about. :)
    David Mark, Feb 10, 2011
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rene Pijlman
    Replies:
    22
    Views:
    725
    Fredrik Lundh
    Dec 10, 2003
  2. Sergio Correia
    Replies:
    7
    Views:
    291
    Ben Finney
    Sep 18, 2007
  3. Replies:
    3
    Views:
    492
  4. zax75
    Replies:
    1
    Views:
    1,095
  5. David Binnie
    Replies:
    2
    Views:
    450
    Rich Webb
    May 22, 2009
Loading...

Share This Page