README.md in rakismet-1.1.0 vs README.md in rakismet-1.1.1

- old
+ new

@@ -13,55 +13,51 @@ Getting Started =============== Once you've installed the Rakismet gem and added it to your application's Gemfile, -you'll need an API key from the folks at WordPress. Head on over to -http://wordpress.com/api-keys/ and sign up for a new username. +you'll need an API key. Head on over to http://akismet.com/wordpress/ and sign up +for a new username. Configure the Rakismet key and the URL of your application by setting the following in an initializer or application.rb: - config.rakismet.key = 'your wordpress key' - config.rakismet.url = 'http://yourdomain.com/' +```ruby +config.rakismet.key = 'your wordpress key' +config.rakismet.url = 'http://yourdomain.com/' +``` If you wish to use another Akismet-compatible API provider such as TypePad's antispam service, you'll also need to set `config.rakismet.host` to your service provider's endpoint. If you want to use a proxy to access akismet (i.e your application is behind a firewall), set the proxy_host and proxy_port option. - config.rakismet.proxy_host = 'http://yourdomain.com/' - config.rakismet.proxy_port = '8080' +```ruby +config.rakismet.proxy_host = 'http://yourdomain.com/' +config.rakismet.proxy_port = '8080' +``` Checking For Spam ----------------- First, introduce Rakismet to your model: - class Comment - include Rakismet::Model - end +```ruby +class Comment + include Rakismet::Model +end +``` With Rakismet mixed in to your model, you'll get three methods for interacting with Akismet: - * `spam?` + * `spam?` returns true if it's spam, false if it's not. + * `ham!` submits comment that Akismet erroneously marked as spam, marked as a false positive. + * `spam!` submits a comment that Akismet didn't think was spam. -Simply call `@comment.spam?` to get a true/false response. True means it's spam, -false means it's not. - - * `ham!` and - * `spam!` - -Akismet works best with your feedback. If you spot a comment that was -erroneously marked as spam, `@comment.ham!` will resubmit to Akismet, marked -as a false positive. Likewise if they missed a spammy comment, -`@comment.spam!` will resubmit marked as spam. - - Configuring Your Model ---------------------- Rakismet sends the following information to the spam-hungry robots at Akismet: @@ -77,32 +73,37 @@ By default, Rakismet just looks for attributes or methods on your class that match these names. You don't have to have accessors that match these exactly, however. If yours differ, just tell Rakismet what to call them: - class Comment - include Rakismet::Model - attr_accessor :commenter_name, :commenter_email - rakismet_attrs :author => :commenter_name, - :author_email => :commenter_email - end +```ruby +class Comment + include Rakismet::Model + attr_accessor :commenter_name, :commenter_email + rakismet_attrs :author => :commenter_name, :author_email => :commenter_email +end +``` Or you can pass in a proc, to access associations: - class Comment < ActiveRecord::Base - include Rakismet::Model - belongs_to :author - rakismet_attrs :author => proc { author.name }, - :author_email => proc { author.email } - end +```ruby +class Comment < ActiveRecord::Base + include Rakismet::Model + belongs_to :author + rakismet_attrs :author => proc { author.name }, + :author_email => proc { author.email } +end +``` You can even hard-code specific fields: - class Trackback - include Rakismet::Model - rakismet_attrs :comment_type => "trackback" - end +```ruby +class Trackback + include Rakismet::Model + rakismet_attrs :comment_type => "trackback" +end +``` Optional Request Variables -------------------------- Akismet wants certain information about the request environment: remote IP, the @@ -124,10 +125,12 @@ If you've decided to handle the request variables yourself, you can add this to your app initialization to disable the middleware responsible for tracking the request information: - config.rakismet.use_middleware = false +```ruby +config.rakismet.use_middleware = false +``` Verifying Responses ------------------- If you want to see what's happening behind the scenes, after you call one of