Hello. Following a discussion on #openguides, I've added hooks for spam detection.
The way it works is that you specify the name of a local module in your wiki.conf, and OpenGuides will check all edits against this module before agreeing to commit them. The module should provide a method called "looks_like_spam", which will be passed the content and metadata of the edit, and should return true (it's spam) or false (it's not).
An example:
---------------------------------------------------------------------- package OpenGuides::Local::KakeSpamDetector; use strict;
sub looks_like_spam { my ( $class, %args ) = @_; if ( $args{content} =~ /kitten/i ) { return 1; } } ----------------------------------------------------------------------
Obviously you'll want a more serious check in there :) The neat thing about doing it like this is that your spam detector module can do _anything_ you like, including, for example, logging.
Comments?
Kake
On Tue, May 15, 2007 at 10:20:44PM +0100, Kake L Pugh wrote:
Hello. Following a discussion on #openguides, I've added hooks for spam detection.
The way it works is that you specify the name of a local module in your wiki.conf, and OpenGuides will check all edits against this module before agreeing to commit them. The module should provide a method called "looks_like_spam", which will be passed the content and metadata of the edit, and should return true (it's spam) or false (it's not).
An example:
package OpenGuides::Local::KakeSpamDetector; use strict;
sub looks_like_spam { my ( $class, %args ) = @_; if ( $args{content} =~ /kitten/i ) { return 1; } }
Obviously you'll want a more serious check in there :) The neat thing about doing it like this is that your spam detector module can do _anything_ you like, including, for example, logging.
Comments?
Awesome. Obviously most user will be wanting to use one or more standard spam plugin modules we provide, but this is an excellent start.
Dominic.
On Tue 15 May 2007, Kake L Pugh kake@earth.li wrote:
Hello. Following a discussion on #openguides, I've added hooks for spam detection.
The way it works is that you specify the name of a local module in your wiki.conf, and OpenGuides will check all edits against this module before agreeing to commit them.
As an update on this, we've been running this on RGL and it's working pretty well. There's some rather odd spam that I still need to figure out rules for (nonsense words, not always including a URL, and where there is a URL it's nonsense too), but overall it's catching most of our spam.
Has anyone else tried this out? I am wondering whether it might help with OGL's load problem. This does of course depend on where the main part of the load is coming from, but since almost all of OGL's edits are made by spammers, and the spamtrapping saves a database write, it might help (alternatively, it might make it worse, but you could test this by profiling with and without spamtrapping, right?).
(Incidentally, almost all of our spam at the moment is coming via the "add a comment" link, but we've also had some Real People using that link, so I'm going to keep it for now.)
Kake
openguides-dev@lists.openguides.org