My favorites | Sign in
Project Logo
                
Search
for
Updated Feb 26, 2008 by thewebfellas
Labels: Featured, defensio, mephisto, spamfilter, rails, ruby
CommentDefensio  
Comment Defensio plugin for Mephisto

Introduction

This plugin adds Defensio spam filtering to the comments posted against your Mephisto blog.

Details

This plugin provides Defensio support to comments in Mephisto.

It uses the Defensio module from Rick Olsen's Viking

This is the first version of this plugin - as such it gets the job done, but not necessarily in the best way for eternity.

The plugin hooks into the comments model and functions in the same way as the Akismet code - basically it adds a switch between the two depending on which is configured.

If you have Akismet configured on your blog then this plugin will use Defensio only if configured, otherwise it will fall back to Akismet.

If you have no Akismet installed and don't configure this plugin then it will have no spam protection.

The behaviour is unchanged from Akismet - i.e. approving a comment will mark it as ham and unapproving a comment will mark it as spam.

I have ideas about how to replace the whole spam filter bit with the Viking style abstraction, along with displaying the statistics within Mephisto, but this does the job for now!

Requirements

Mephisto Edge (the latest stable 0.7.3 release does not have support for Mephisto plugins)

Users of the latest 0.8.0 trunk may need to add:

require 'mephisto'

To the top of the mephisto_init.rb initializer.

Install and Usage

The source code is available on our Google Code repository:

http://thewebfellas-on-mephisto.googlecode.com/svn/mephisto_comment_defensio/trunk/

Install the plugin and use the install procedure if necessary to add the additional table field:

script/runner 'Mephisto::Plugins::CommentDefensio.install'

Don't forget to specify your environment if necessary (-e switch)

Configure your API key through the Mephisto plugin administration page in Mephisto.

If you are one of the few (if any!) that downloaded it when first released (v0.1) then I have updated it to also store the spaminess level in preperation for future features. Before updating your code to v0.2 then make sure you add the spam_spaminess column to the "contents" and "content_versions" tables in your database.


Comment by btorch, Jan 04, 2008

I tried to install in on my edge mephisto version but I kept getting:

I guess I'm doing something wrong ?

/var/www/rails/zeroaccess/lib/mephisto/plugin.rb:14: undefined method `expiring_attr_reader' for #<Class:0xb77aef4c> (NoMethodError?)

from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from /var/www/rails/zeroaccess/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in `require' from /var/www/rails/zeroaccess/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in' from /var/www/rails/zeroaccess/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in `require' from /var/www/rails/zeroaccess/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:104:in `require_or_load' from /var/www/rails/zeroaccess/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:248:in `load_missing_constant' from /var/www/rails/zeroaccess/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:in `const_missing'
... 19 levels...
from /var/www/rails/zeroaccess/vendor/rails/railties/lib/commands/runner.rb:39:in `require' from /var/www/rails/zeroaccess/vendor/rails/railties/lib/commands/runner.rb:39 from script/runner:3:in `require' from script/runner:3

Comment by thewebfellas, Jan 11, 2008

Hello

Looks like 'expiring_attr_reader' is a different plugin.

What method did you use to install? Was it a fresh install of Mephisto or a pre-existing version? Did you add just the Defensio plugin or more than that at the same time?

I'll move your comment over as an 'issue' so we can work it through - so please respond over in the Issues tab..

Thanks


Sign in to add a comment
Hosted by Google Code