Re: How I got rid of those spam posts on c.l.t



On Wed, 23 Apr 2008 02:11:17 +1000, Alexandre Ferrieux <alexandre.ferrieux@xxxxxxxxx> wrote:

On Apr 22, 3:00 pm, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:
On Apr 22, 1:23 am, "Kam-Hung Soh" <kamhung....@xxxxxxxxx> wrote:



> On Tue, 22 Apr 2008 07:30:59 +1000, Alexandre Ferrieux

> <alexandre.ferri...@xxxxxxxxx> wrote:
> > Hi,

> > If like me you are using Google Groups with Firefox, and are suffering
> > from the huge amount of spam posts, maybe you'll like this little
> > trick: use the fabulous Firefox extension "GreaseMonkey", which is a
> > generic filter allowing to run arbitrary Javascript code (possibly
> > modifying the contents) after loading webpages.

> > Using the GreaseMonkey script located at

> > http://paste.tclers.tk/887

> > you'll see that all those "Gucci ... Replica .. whatever" garbage
> > lines are replaced by whitespace in the Topic List view of Google
> > Groups. So far that's the best I can do with my 30mn of experience
> > with the tool. But surely after a bit of work we can remove the lines
> > entirely.

> > If you want to extend the filter, you'll quickly spot the regexp near
> > the top:

> > /.*(replica |gucci|wholesale|discount).*/gi

> > Enjoy !

> > -Alex

> > PS: Instructions to set it all up:
> > Once the extension is installed, Tools->GreaseMonkey->New User Script
> > In the Includes field, type or paste:
> >http://groups.google.com/group/comp.lang.tcl/*
> > In the namesapce field, type any string: foo
> > Then choose and open an editor, paste the above script, save and exit,
> > then OK, and Reload the current page.
> > After each cycle editing the script, Reload again.
> > The Enabled status of GreaseMonkey is sticky, so after stabilizing
> > your regexp you can forget completely about it.

> > PS2: Share your regexps !!!

> Also try this GresaeMonkey script, "Google Groups Killfile", from http://www.penney.org/google-groups-killfile-343-released.html

Wow ! This dwarfs my little attempt :-)
Many thanks for putting me on the right track.

One question about this nice script: is there documentation
somewhere ? Indeed I see it can killfile exact topics, but apparently
regexp wildcards don't work (the code explicitly escapes them, so that
a topic "A+B" is interpreted literally).
Of course I can modify the Javascript to remove the escaping, but I
wanted to make sure there was no GUI-level way of doing it...


FWIW, the following patch to the script removes the regexp-escaping,
thus allowing to generalize the kill-patterns. To use it, after
clicking the cross, when prompted to edit the kill-pattern, if you get
for example:

Topic: Wholesale Replica Gucci Hermes

edit it to

Topic:.*(Wholesale|Replica|Gucci|Hermes)

and you'll get rid of a very large class of junk in no time.

-Alex

--- orig.googlegroupskillfile.user.js 2008-04-22 18:05:18.000000000
+0200
+++ googlegroupskillfile.user.js 2008-04-22 18:06:37.000000000
+0200
@@ -53,7 +53,6 @@
var data = "";
var list = new Array();
var newList = new Array();
- killspec = RegExpEscape(killspec);

// initialize variables

@@ -85,7 +84,7 @@
data = unescape(GM_getValue("GoogleKillFile", "-----"));
list = data.split(splitCh);

- list.push(RegExpEscape(killspec));
+ list.push(killspec);

alert(killspec + ' has been added to the KillFile.\nRefresh page to
see changes.');

You can also reduce the number of patterns to enter by using a case-insensitive matching; just add a "i" argument in each ".compile()" function call.

--
Kam-Hung Soh <a href="http://kamhungsoh.com/blog";>Software Salariman</a>
.



Relevant Pages

  • Re: How I got rid of those spam posts on c.l.t
    ... After each cycle editing the script, ... your regexp you can forget completely about it. ... thus allowing to generalize the kill-patterns. ... clicking the cross, when prompted to edit the kill-pattern, if you get ...
    (comp.lang.tcl)
  • Re: How I got rid of those spam posts on c.l.t
    ... If like me you are using Google Groups with Firefox, ... If you want to extend the filter, you'll quickly spot the regexp near ... Then choose and open an editor, paste the above script, save and exit, ...
    (comp.lang.tcl)
  • How I got rid of those spam posts on c.l.t
    ... If like me you are using Google Groups with Firefox, ... If you want to extend the filter, you'll quickly spot the regexp near ... Then choose and open an editor, paste the above script, save and exit, ...
    (comp.lang.tcl)
  • Re: Google & Greasemonkey..It Works.
    ... did you have to write any script to make this work? ... for GreaseMonkey (a Firefox extention), and one for the latest Google ... and go to the next link, "Latest Google Groups Killfile Script:" ...
    (alt.smokers.pipes)
  • M4/Autotools question
    ... and google groups showed a few previous posts about ... it in my configure.ac/autoconf functions it's making a substitution. ... Oddly though if I swap $2 for $FOO ... It all works exactly as I expected in a plain shell script, ...
    (comp.unix.programmer)