Modding BlogCFC: Moderated if url is present

I've been getting some human posted spam to my blog and I want it to stop. The problem is, to stop a human you have to either moderate all posts, force a sign in to post or search the comment for one of a million odd keywords. None of those solutions appeal to me. Time to come up with something new.

Looking at the problem I see that almost all human posted spam involves a link to some outside resource. Ah, a pattern I can work with. If I can set moderation on for any comment that has a link, it would help block most human posted spam, at least in theory.

I can do this right or I can do it as a fast hack. As I don't have the time to do it right at the moment, I'm going to write a single regular expression and add it to the blog.cfc. I'll write myself a note to remember to go back and fix it correctly later.

The solution I came up with is to go to line 236 in the blog.cfc component and add in this line to the cfif statement:

or refindnocase('https?://', arguments.comments)

This will force moderation on for any comment with a link in it. Great for stopping most form spam, great for letting most comments through, terrible for letting real comments with links through.

To do this properly I'd have to set a new variable in the blog.ini file to specify if I want to moderate based on urls. Then modify the initialization code for blogcfc to grab that variable along with all of the others. Once that's done, line 236 would be modified to look at the new variable to see if moderation should be on for the post. Rather straight forward.

One thing I noticed when writing this post is that I never posted my article on my technique to block all bot spam. I know I posted it somewhere, but I guess I never posted it here. I'll add a reminder to myself to do that as well. Oh, for a 48 hour day. :)

Comments
Michael Dinowitz's Gravatar A non-url post which is not moderated.
# Posted By Michael Dinowitz | 10/26/07 12:47 AM
Michael Dinowitz's Gravatar A post with an url which is moderated

http://www.houseoffusion.com
# Posted By Michael Dinowitz | 10/26/07 12:52 AM
Jake Munson's Gravatar Another way to stop human posted spam is to use a service like Akismet.
# Posted By Jake Munson | 10/26/07 1:22 AM
Nathan Mische's Gravatar I'd second Jake's suggestion for Akismet. I have a tutorial on how to mod BlogCFC to use CFAkismet here:
http://www.mischefamily.com/nathan/index.cfm/2007/...

It has worked well for me, and for the most part it allows people to post on topic comments (like this one) without moderation.
# Posted By Nathan Mische | 10/31/07 8:17 AM
cheap north face's Gravatar Thanks for sharing all this great information. I am going to social bookmark this for sure.
# Posted By cheap north face | 10/6/11 8:44 PM
Office 2010's Gravatar You are great! But I still did good! Hey!
# Posted By Office 2010 | 12/11/11 11:19 PM
replica watches's Gravatar currently one of the types operating in the U.S. is giving the necessary information, the process of dealing with customers shopping
# Posted By replica watches | 1/14/12 10:20 PM
cheap watches's Gravatar The Best Designer Replica Watch are on Sale. We provide the hottest new Designer Replica Watch.
# Posted By cheap watches | 3/16/12 5:02 AM
Coach Factory Outlet's Gravatar I'm learning jQuery from the ground up and when I learn something, I want to know what is assumed, what has to be explicitly stated, and why one thing is done vs. another
# Posted By Coach Factory Outlet | 3/24/12 1:57 AM
fake chanel's Gravatar Omega Replica Watches are beautifully embroidered with amazing designs, but yet they usually possess the same or better quality as any watches.
# Posted By fake chanel | 4/6/12 4:05 AM
replica watches uk's Gravatar If you're just yearning to have an elaborate - but unusual - Omega Replica Watches, here are some great tips.
# Posted By replica watches uk | 4/6/12 4:05 AM
fake watches's Gravatar Let's explore what types of Replica Omega Watches are available and how to choose the right one for you.
# Posted By fake watches | 4/6/12 4:06 AM
fake watch uk's Gravatar Omega Replica Watches -Look for Practicality
# Posted By fake watch uk | 4/6/12 4:06 AM
chanel shopping bags's Gravatar Before falling in love with a certain design, be sure the Omega Replica Watches will meet your needs.
# Posted By chanel shopping bags | 4/6/12 4:07 AM
hermes replica's Gravatar Do you need the Omega Replica Watches for telling what time it is now or examining the time when you do sports?
# Posted By hermes replica | 4/6/12 4:07 AM
fake breitling's Gravatar Do you plan on using it every day or only for special occasion? Omega Replica Watches come in a variety of colors and shapes.
# Posted By fake breitling | 4/6/12 4:08 AM
chanel bags's Gravatar There are even very small make-up carriers for trips. It depends on how and where you plan to use it.
# Posted By chanel bags | 4/6/12 4:11 AM
watches shop uk's Gravatar When shopping for Omega Replica Watches, make sure to buy from a company that prides itself on generations of tradition in watch making.
# Posted By watches shop uk | 4/6/12 4:14 AM
replica watches uk's Gravatar It gets its Montres Breitling name in the prestigious British car the Bentley.
# Posted By replica watches uk | 4/11/12 1:29 PM
beats dre uk's Gravatar the repertory of the traditional theory programs strikes you as arcane, foreign (literally), and unrelated to the music that commands your day-to-day attention.
# Posted By beats dre uk | 4/11/12 2:25 PM
Nike Free Run 3 Women's Gravatar Or else my wedding would be ruined, but seniors and dream Ying said Tuesday coming with me, until now, waiting for us.
# Posted By Nike Free Run 3 Women | 4/28/12 3:02 AM
replica chanel's Gravatar the black jeans have previously canned not really satisfy the young lady to vogues wanting to know.
# Posted By replica chanel | 4/29/12 6:40 AM
celine fake bags's Gravatar The unit gets heating from the nearby Trigen steam plant for a flat $36 a month, and utility bills for the all-electric unit are only about $90 a month.
# Posted By celine fake bags | 5/5/12 3:54 AM
beats by dre's Gravatar ok
This extra-special event will unfold via a historic bus ride through the Mississippi Delta, the birthplace of — rock and roll — during which one courageous band will board a tricked-out bus and zigzag across the region in attempt to break Jay-Z's Guinness World Record title for Most Live Concerts In 24 Hours (Multiple Cities) by hitting a total of eight cities.
# Posted By beats by dre | 5/8/12 3:47 AM
red beats's Gravatar O So the chronology of the various pieces has been nearly impossible to sort out. Therefore, what the producers have done is to present the various pieces (39 in all), in a narrative more focused on an emotional flow than anything else.
# Posted By red beats | 5/8/12 4:44 AM
ralph polo lauren's Gravatar Indeed, there are times when one begins to wonder where Monk has gone.
# Posted By ralph polo lauren | 5/8/12 5:00 AM
replica breitling watches's Gravatar You know that there isn't a magic shampoo, conditioner or hair spray that will get you there.
# Posted By replica breitling watches | 5/8/12 11:41 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.9. Contact Blog Owner
House of Fusion | ColdFusion Jobs @ House of Fusion | Fusion Authority