Spam protection with Akismet
Filed under: PHP, Security, spam, tools | Tags: akismet, antispam, PHP, security, spam |
Akismet, or Automattic Kismet, is a text spam filtering service created by Automattic, the corporation which employs most of the main developers of WordPress.
When a new comment is posted on your site, Akismet webs service catches the comment and tests whether a comment is valued as “spam” or “not spam”.
This is a good protection because a lot of bloggers and the WordPress software use Akismet and flag new spam pattern to the Akismet site.
If you have a comment form on your webapp you can protect it with the Akismet-service and some PHP code around. I use it for a python application and it catches a lot of comment spam day for day and as Douglas Adams says “I may not have gone where I intended to go, but I think I have ended up where I needed to be.”.
First you need to generate a WordPress API key on this page. You don’t need to get a blog, choose the “just an account” option when signing up.
http://wordpress.com/signup/
There are two (and sure more) classes, that make a implementation in your own webapp easy as possible.
Take a look at the docs on both sites:
PHP 4 class by Bret Kuhns:
http://miphp.net/pages/akismet_docs
PHP 5 class by Alex Potsides:
http://www.achingbrain.net/stuff/akismet/#usage
Leave a Reply