SpamFilter 1.1

Since I first released SpamFilter, I have added several new spam definitions to it without needing to touch the actual code. The most recent addition, however, did require me to update the code. Since I did that, I decided to go ahead and make another change to take advantage of new functionality in DataMgr 2.2 (on which SpamFilter 1.1 is dependent).

To use SpamFilter, download SpamFilter and DataMgr and use the following code to load DataMgr (assuming a datasource stored in the variable "mydsn"):

<cfset DataMgr = CreateObject("component","DataMgr").init(mydsn)>
<cfset SpamFilter = CreateObject("component"" SpamFilter").init(DataMgr,true)>

The second argument indicates that SpamFilter should check back with the spam definitions on my site for updates when it is initialized.

This has also been improved to take advantage of functionality in DataMgr 2.2 so that existing spam definitions can be updated, instead of just being able to add new spam definitions as before (do make sure that if you are using SpamFilter 1.1 that you use it with DataMgr 2.2).

To check if a structure (usually a form is spam), use the following code:

<cfif SpamFilter.isSpam(Form)>
<!--- Handle spam --->
<!--- Handle form submission --->

For more information, see the original entry on SpamFilter.

SpamFilter.cfc (now in beta) is open source and free for any use. Feel free to give it a try.

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Hi, is this doing about the same as CFFormProtect is doing? 'Cause that is really simple to implement and isn't coupled to any other system, like your system seems to be (DataMgr). Just wondering ;-)
# Posted By Sebastiaan | 2/24/09 8:13 AM

They definitely both attempt to solve the problem of form spam (though SpamFilter could be used for any kind of spam data - whether by form or not) and I have heard only really good things about CFFormProtect.

I realize that I am biased, but I think that SpamFilter.cfc is at least as easy to implement as CFFormProtect. Both, of course, are sufficiently easy as to make that a non-worry in either case.

As to SpamFilter.cfc having an external dependency, that is a good point. CFFormProtect comes with about 7 files whereas using SpamFilter.cfc with DataMgr could be done with as few as three files. Even so, it is an extra download which I agree is an extra step.

Maybe I should include DataMgr in the download as well as example implementation code to make it easier. What do you think?

For anyone that is curious, here is the URL for CFFormProtect:
# Posted By Steve Bryant | 2/25/09 8:34 PM
Hi Steve,

thanx 4 your answer ;-) I think you have a valid point in the number of files - haven't really looked at it that way. But the ease of which I with "one-click" so to say can install CFFormProtect is one of the many strong points of this free tool.

As to your suggestion to include DataMgr with the SpamProtect: GOOD idea!!! The ease with which I installed Joe Danzigers Projecttracker using your included DataMgr tools was enormous! So yes, do include it with your own SpamProtect.cfc ;-)
# Posted By Sebastiaan | 2/26/09 1:36 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.