Akismet Fights Spam the Easy Way

Jul

29

posted at: 9:40 PM

Have you ever had a time where you knew about a great technology that was out there, but you just couldn't quite get over the hump of adopting it? For me, it was signing up for Vonage. I've heard nothing but good things about their service reliability, call quality, customer service, and cost consistency (sic). Oh, did you also know that it is really easy to install?

vonage joke

Pardon the sarcasm, I had to take my technology crack of the day. I actually felt like I was living in the stone age because I hadn't ever tried this great service called Akismet.

What did you just call me?

Akismet is a service for bloggers, available via API or through a Wordpress plugin, that checks for comment spam. Programmatically. It's brilliant and a shame I had actually heard of this years ago, yet had never implemented it (despite my horrendous comment spam problem). I have to say a catchier name for the service probably would have had me using it sooner. I think I actually once told a client about this great service called Askimet. Dyslexia works strange wonders.

The advantage to something like this for those who have never had to deal with comment spam before, is that you no longer have to deal with CAPTCHAs and the tremendous usability hurdles that accompany them. The less stuff users have to enter in order to contribute to a community, the more likely they will be willing to dive-in.

spam

How do I make it go VROOOM?

Easy! Put your .NET hats on, boys and girls. You first go to CodePlex and download the API Library. After you unzip it, add a reference to the DLL in your project. On the CodePlex page, they have some sample code for how to use the library. I was seriously up and running in less than five minutes. I just had to change a couple things to grab some server variables:

c.UserIp = Request.ServerVariables["REMOTE_ADDR"].ToString();
c.UserAgent = Request.ServerVariables["HTTP_USER_AGENT"].ToString();

I also had to change the exception handling for the VerifyKey method, as I insist all of my exceptions be prolifically self-evident:

if (!api.VerifyKey()) { throw new Exception("Frickin Dangit!!!"); }

The only thing left is to sign up for an account at Wordpress.com, and they will e-mail you a Wordpress key that you can use in the Akismet API. That's it. Easy as cake!

How do I know it works?

Well, what Akismet doesn't do is filter out profanity, obscenity etc. What it does do is use what available data it has to attempt to detect if it is a spam posting, which it appears to be quite effective at. This is why you pass in information like the HTTP User Agent, e-mail address, and the markup of the actual comment content. You'll notice in a previous post that Brando tried to push the limits of the software by calling me a somewhat offensive explitive. I think this is actually a common misconception.

Misconception about how Akismet works.. not me being said explitive, of course.

post a comment {1}

Comments

  • 1

    vibram fivefingers, says... Jun 08 | 12:27 AM

    Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us valuable informative post, I totally agree the standpoint of upstairs. www. vibram fivefingers classic men I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum!

Post Commentary

Name: *

 

Website / Blog:

Comment: *