Sixapart, the people behind Movabletype, as well as services like Vox and Typepad, recently released a new free service to combat spam, Typepad Antispam. The service is based on the same API as Akismet's spam service. Since we do anonymous comments on our Photo Diary service phiary.com, I have been on the outlook for a spam filter to supplement the recaptchas.
Doing a quick search on search.cpan.org revealed there's a module to talk to Akismet. However, it's hardcoded to talk to their web server, and generally not as flexible as I like, so I reimplemeted it and released it to CPAN as Net::Akismet::Protocol. Having done that, I figured it would be nice to have it integrated into our MVC framework of choice, Catalyst. Thus, I've also released Catalyst::Model::Akismet.
It talks to Typepad's anti spam service by default, so once you have registered at their site, and installed it, adding it to your app is as simple as :
$ ./script/myapp_create.pl model Akismet Akismet key=<your key> url=<your site>
After that you can validate your comments in the controller like this :
if( $c->model('Akismet')->check(
comment_content => $c->req->params->{content},
comment_author => $c->req->params->{name},
comment_author_email => $c->req->params->{email},
comment_author_url => $c->req->params->{site},
)) {
return $c->stash->{error} = 'Spam detected';
}
Hope this helps someone out there, and thanks to Sixapart for providing such a great community service! :)



You should also pass in ‘article_date’, which is pretty helpful also. This is the date of the parent post, not of the comment itself. (Submit the date in a ‘YYYYMMDDHHMMSS’ format. Timezone isn’t important— I don’t think the time is actually used.)