Thomas Freudenberg

Confessions of a caffeine addict

The Akismet Spam Rule included in Alabaster

Though I spoke about my Akismet spam rule a couple of weeks ago, I didn't draw that much attention to it. However, now that the first version of CSMVP's CSModules package, code name Alabaster, is released for more than a week, I'd like to spent some words on it, though Jayson mentioned it in his CS Tidbits: Exploring The CS Spam Blocker.

Akismet provides a web service, which evaluates a comment or trackback based on several tests and returns a thumb up or thumb down. (Additionally, it can be trained, but that's not supported by my spam rule.)

The spam rule I wrote and contributed to Alabaster calls this Akismet web service. The implementation is straight forward, for a general spam rule implementation see Jose Lema's instructions on the CS Forum. Well, there some tips missing, but Keyvan forwarded me an advice from Jose: if you use a web service in my spam rule, make that external call only if absolutely necessary. If the "cheaper" spam rules such as link count already identifies a comment as spam, an "expensive" call to an external service would be redundant.

The spam rule engine in Community Server evaluates comments three-stage. In the implementation of your spam rule you can specify at which stage your rule should be visited. Additionally, you can restrict your rule based on the result of previously visited spam rules. In the case of the Akismet spam rule, I specified that the rule should be visited in the third stage, and only if the comment is not considered spam yet:

    /// <summary>
    /// Gets the pass criteria.
    /// </summary>
    /// <value>The pass criteria.</value>
    public override PassCriteria PassCriteria
    {
        get { return PassCriteria.ThirdPass; }
    }
    
    /// <summary>
    /// Gets the status criteria.
    /// </summary>
    /// <value>The status criteria.</value>
    public override StatusCriteria StatusCriteria
    {
        get { return StatusCriteria.NotSpam; }
    }

Ok, enough about the implementation. The installation is pretty easy. Contrary to CSModules, spam rules do not need to be registered in any .config files. Instead, the spam rule engine finds all rules via reflection on all assemblies in CS' bin folder.

For the configuration, first of all you need a WordPress API key, because Akismet requires it. Though you can get a key for free, the Akismet is free only for personal use. If you are a commercial entity or making more than $500 from your personal blog, you need a commercial key.

Pretending you have your API key now, go to Control Panel -> Administration -> System Tools -> Manage Spam Blocker (~/ControlPanel/Tools/ManageSpamRules.aspx). Tick the Akismet.com spam rule and click on Configure. In the configuration window enter your API key and your desired points for detected spam (I chose 5, so it gets moderated automatically. I trust Akismet Wink). Click Save to close the configuration window and again Save to accept the selected spam rules.

Comments

Community Server Daily News said:

news of the day a grab bag for what's happening in Community Server The Community Server August Newsletter

# August 23, 2006 12:31 PM

Community Server Daily News said:

From the Editor occasional messages that don't fit anywhere else No, no, Nanette. No Daily News for you!

# August 25, 2006 1:49 PM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# August 29, 2006 2:45 PM

Thomas Freudenberg's Blog said:

My Akismet spam rule has a second home. Originally I contributed it to CSMVP's CSModules package aka

# August 31, 2006 2:25 PM

Thomas Freudenberg said:

The news is out : Today Telligent awarded me a Community Server MVP . Though I am not that active in

# October 19, 2006 2:50 PM

Daily News Faq List said:

Jan Schreuder takes anonymous comments offline because of spam at bloggingabout.net , linking to a post

# November 22, 2006 8:27 AM

Daily News Faq List said:

Thomas Freudenberg describes the Akismet Spam Rule he wrote for Alabaster , the CS MVP Module Pack for

# November 22, 2006 8:28 AM

Community Server Bits said:

Jan Schreuder takes anonymous comments offline because of spam at bloggingabout.net , linking to a post

# March 12, 2007 8:33 AM

Community Server Bits said:

Thomas Freudenberg describes the Akismet Spam Rule he wrote for Alabaster , the CS MVP Module Pack for

# March 12, 2007 8:34 AM

Community Blogs said:

I know that my blog is spamified recently but I promise to end it here after this post but before that

# July 16, 2008 7:05 AM