Arne Brachhold

Akismet C# API for the .Net Framework 1.1 and 2.0

Filed under: .Net,Wordpress — arne on April 18, 2006
Latest release:
1.0
2006-04-18

This is a little Microsoft .Net class which allows you to use the powerful Akismet comment spam protection in your .Net wiki/blog/website/software.

It’s well documented and available as a precompiled library or C# project. It’s compiled as .Net 1.1, but also works great with 2.0. Note that you need to obtain a WordPress.com API key to use it.

Commercial use:
The personal use of Akismet is completely free, but if you are a really heavy user or want to use it in a commercial way, please see this offers for details.

Licence:
This library is licensed under the GPL. Because it is licensed free of charge, I do not accept any responsibility for any damages, direct or indirect, that may arise from using the library. This software is provided “AS IS” without warranty of any kind. Please refer to the full version of the GPL for more details.

Download:
Download Icon http://www.arnebrachhold.de/get/akismet/AkismetBin.zip Precompiled, strong named binary
Download Icon http://www.arnebrachhold.de/get/akismet/AkismetProject.zip Project with source code

Please contact me or comment on this post if you encounter any problems or bugs.

Usage:
Usage is very simple, Intellisense is available for all methods and fields.

  1. //The manager handles all API stuff
  2. AkismetManager mngr = new AkismetManager("YOUR-API-KEY","http://www.yourwebsite.com");
  3.  
  4. //An item is a single comment or registration data
  5. AkismetItem comment = new AkismetItem("Ip-of-commenter","Useragent-of-commenter");
  6. comment.AuthorName="Comment Author";
  7. comment.AuthorEmail="best@prices-are-sooo-low.com";
  8. //There are many more fields to specify. Submit as much fields as possible to get the most accurate and fastest results.
  9.  
  10. //Validate your API key
  11. if(mngr.IsValidKey()) {
  12.     //Check if the comment is spam
  13.     if(mngr.IsSpam(comment)) {
  14.         //Store in DB and mark it as spam
  15.         //or Submit it as ham (not spam)!
  16.         mngr.SubmitHam(comment);
  17.  
  18.     } else {
  19.         //Store in DB and publish
  20.         //or submit as spam!
  21.         mngr.SubmitSpam(comment);
  22.     }
  23. }

3 Comment(s)

Comment by Andre

Posted on July 26, 2006

How does one use this with standard asp?

Comment by arne

Posted on July 26, 2006

Hi Andre,

ASP.net is completely different to classic ASP. I’m sorry but I don’t know ASP so I can’t tell you how to implement it.

Best regards,

Arne

Comment by Alistair

Posted on August 4, 2006

Arne,

I believe if you were to implement some simple COM interfaces for your class, that you could instantiate it using ASP3.

Regards,
Al.

6 Trackbacks

Sorry, the comment form is closed at this time.