C# ASP.NET SQL SERVER

Stop Forum Spam

I'm impressed with a site that my friend Huw Reddick recently alerted me to called Stop Forum Spam. It's a database of IP's, user name's and emails that have been used to spam forums. If you run a forum or maintain forum software then it's a great resource to query when someone's registering on your forum to try and cut down on spammers joining your forum. You can also submit spammer information to their database (manually) at this link. If, however, you're like me and hate spammers but are also very lazy then you'll want to automate this process as much as possible. Here's some C# code that will submit the spammers info for you:

        public bool SubmitForumSpammer(string ip, string username, string email, string apikey)
        {
            WebRequest req = WebRequest.Create("http://www.stopforumspam.com/add");
            string postData = String.Format("username={0}&email={1}&ip_addr={2}&api_key={3}", username, email, ip, apikey);

            byte[] send = Encoding.Default.GetBytes(postData);
            req.Method = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            req.ContentLength = send.Length;

            Stream sout = req.GetRequestStream();
            sout.Write(send, 0, send.Length);
            sout.Flush();
            sout.Close();

            WebResponse res = req.GetResponse();
            StreamReader sr = new StreamReader(res.GetResponseStream());
            string returnvalue = sr.ReadToEnd();

            return returnvalue.Contains("Data submitted successfully");
        }
 

» Similar Posts

  1. SpamBayes performance on Outlook 2007
  2. Automatically keeping CSS file current on any web page
  3. Defeating Spam Bots with country selection

» Trackbacks & Pingbacks

    No trackbacks yet.
Trackback link for this post:
http://guyellisrocks.com/trackback.ashx?id=71

» Comments

  1. Mike avatar

    Hey Guy,

    I wanted to make you aware of a service similar to Stop Forum Spam. It's called "BotScout.com" and they're also useful in screening out spammers and bots that try to register on forums, abuse contact pages, etc.

    They have an easy-to-use API similar to SFS and have mods available for most of the popular bulletin boards out there.

    Full Disclosure: I'm one of the folks that runs BotScout and would be glad to have you make use of our service too.

    Mike

    BotScout.com

    Mike — February 5, 2009 10:16 PM
  2. guy ellis avatar

    Thanks Mike - I'll take a look at it.

    guy ellis — February 5, 2009 10:45 PM
  3. mickeys4life avatar

    Will this work on an invisionfree forum?

    mickeys4life — February 6, 2009 12:02 PM
  4. guy ellis avatar

    Yes - it should work on any forum. The code I supplied is for C# on ASP.NET but can be modified for any language.

    guy ellis — May 14, 2009 4:16 PM

» Leave a Comment