This post is migrated from previous hosting provider. There are still some issues with old posts. Please make a comment on this post with any issues.

Preventing comment spam using LinkSleeve

Tags: .NET, C#, XML, Website

I have a lot of problem with comment spam on the blog as well as spamming on the trackbacks and the problem is spread widely over the blogging world. A lot of you turn off comments or have registration or other methods to get rid of the comment spamming.

LinkSleeve (SLV - Spam Link Verification) is a link spam solution that checks a text for well-known URL's in a text and tells if it contains any known spam addresses. This service is provided via an XML-RPC service without any licensing.

This service is ideal for you out there who have built their own blog application, and here is a simple implementation of it in C#:

public class LinkSleeve{        // http://www.linksleeve.org/
    public static bool IsSpam(string text){
        ILinkSleeve proxy = (ILinkSleeve) XmlRpcProxyGen.Create( typeof(ILinkSleeve) );
        return proxy.Check(text) == 0 ? true : false;      }
    [XmlRpcUrl("http://www.linksleeve.org/slv.php")]
    public interface ILinkSleeve{
        //INFO: must be public for .NET 2.0 support
        [XmlRpcMethod("slv")]
        int Check(string text);
    }
}

The Check method returns true if the text seems to contain spam and otherwise false.

To be able to use this you need to have XML-RPC.NET library.

4 Comments

Comments have been disabled for this content.

About Wictor...

Wictor Wilén is the Nordic Digital Workplace Lead working at Avanade. Wictor has achieved the Microsoft Certified Architect (MCA) - SharePoint 2010, Microsoft Certified Solutions Master (MCSM) - SharePoint  and Microsoft Certified Master (MCM) - SharePoint 2010 certifications. He has also been awarded Microsoft Most Valuable Professional (MVP) for seven consecutive years.

And a word from our sponsors...