views:

37

answers:

3

We have a requirement to have comments on an application auto-moderated for obscenities etc. There will still be a real world moderating looking at comments, but they want to filter out the really bad stuff automatically.

What would be the best way to do this?

+1  A: 

You'll want to use something like Akismet. Last I checked, it's the thing WordPress uses to prevent comment spam. It's pretty straightforward, too.

Here are a couple links:

Here's a gem/plugin: Rakismet

As for profanity instead of general spam, you might want something like WebPurify (first one I found). You can hack your own together by blacklisting profane words and using Ruby's elegant string handling to replace/filter them, but that would probably be a never ending battle against 1337 speak and stuff like that. Plus it's probably better practice to outsource something like that, if possible.

Jon Smock
re profanity: beware the clbuttic mistakes - there's a lot of false positives, as citizens of Scunthorpe, England found out, amongst others.
Piskvor
Good point - I hadn't thought of that
Jon Smock
A: 

Auto-moderation for obcenities is always going to give problems, as shown by Jeff Atwoods Post about it: Obscenity Filters: Bad Idea, or Incredibly Intercoursing Bad Idea?.

Now, on the other hand, actively filtering Spam using an automatic (third party) text analysis tools is certainly an viable option ( Mollom for example, which also have a ruby plugin )

alexanderpas
A: 

You can try fu-fu, not perfect but will filter out a lot.

http://github.com/adambair/fu-fu

fullware