Ok, this is the scenario: You gave your best making a beauty and useful comment form to increase your site interactiveness but like 90% of the posts are f…… spams. What to do?

Akismet provides a web service where you can submit your blog posts and see what it thinks about the comment contents, it will return true if the comment is supposed to be a spam and false otherwise. Ok, so the Akismet Web Service is the right solution!

But visiting Akismet Development Section I realized that a library for ASP 3.0 is not available, so what to do? It’s shocking that none has done it before, Akismet is a well known service and Classic ASP has it’s ultra popular era! It’s ok again, the guys behind this project are so nice that they left their api documentation available to any developer to implement their service in any language!

The good about all this talk is that I just finished today an Akismet API interface to Classic ASP. With the Akismet Class you have a really easy way to talk with Akismet service. Let’s see some examples:

requesting Akismet to test a comment

dim SpamSentinel : set SpamSentinel = new Akismet
SpamSentinel.initialize "123456789abc", "http://blog.domain.com"
SpamSentinel.setPermalink "http://blog.domain.com/entry-permalink/"
SpamSentinel.setCommentType "comment"
SpamSentinel.setCommentAuthor "Author"
SpamSentinel.setCommentAuthorEmail "author@isp.com"
SpamSentinel.setCommentAuthorUrl "http://author.isp.com"
SpamSentinel.setCommentContent "The content that was submit"
Response.write SpamSentinel.isSpam()
set SpamSentinel = nothing

submiting a spam

dim SpamSentinel : set SpamSentinel = new Akismet
SpamSentinel.initialize "123456789abc", "http://blog.domain.com"
SpamSentinel.setPermalink "http://blog.domain.com/entry-permalink/"
SpamSentinel.setCommentType "comment"
SpamSentinel.setCommentAuthor "Author"
SpamSentinel.setCommentAuthorEmail "author@isp.com"
SpamSentinel.setCommentAuthorUrl "http://author.isp.com"
SpamSentinel.setCommentContent "The content that was submit"
Response.write SpamSentinel.submitSpam()
set SpamSentinel = nothing

submiting a ham

dim SpamSentinel : set SpamSentinel = new Akismet
SpamSentinel.initialize "123456789abc", "http://blog.domain.com"
SpamSentinel.setPermalink "http://blog.domain.com/entry-permalink/"
SpamSentinel.setCommentType "comment"
SpamSentinel.setCommentAuthor "Author"
SpamSentinel.setCommentAuthorEmail "author@isp.com"
SpamSentinel.setCommentAuthorUrl "http://author.isp.com"
SpamSentinel.setCommentContent "The content that was submit"
Response.write SpamSentinel.submitHam()
set SpamSentinel = nothing