Jeffrey Carlyle
2009-08-18T01:07:29-05:00

reCAPTCHA is Exceedingly Cool

Posted: 18-Aug-2009 1:07AM CDT
Topics: [JeffCenter]

As you may have noticed, I recently re-enabled comments on my websites. Almost as soon as I had finished this effort, I started getting spam comments. How there are bots out there that found my website and decoded what it took to post a comment, I don't think I'll ever know.

The common way to fight automated posting is through the use of CAPTCHAs. These operate on the premise that there are things that humans can read that are still things that are exceedingly hard for computers to decipher. After encountering the spam problem, I decided to investigate adding CAPTCHAs for the comments.

I was worried that it would be hard to add CAPTCHAs to my site because, due to a design decision I made over six years ago, all of the pages on my site are static HTML pages that are generated by a back end perl script. My concern is that CAPTCHAs would require dynamic HTML to be generated for all of the comment posting pages; however, I quickly found this not to be the case with reCAPTCHA. The dynamic side of reCAPTCHA all exists on a remote server: I just had to add a few lines of HTML to pull in some remote JavaScript. All in all, between the few lines of HTML for the comment posting form and the back end script that process the comments, I only had to change about 10 lines of code.

Of course this will only help until someone rights a better computer vision algorithm that can figure out the words in the images. Oh well.

The other nice thing about reCAPTCHA is that it is actually used to help with the electronic scanning of books.