Class Viking::Akismet
In: lib/viking/akismet.rb
Parent: Base

Methods

Attributes

host  [RW] 
normal_responses  [RW] 
port  [RW] 
standard_headers  [RW] 
valid_responses  [RW] 
verified_key  [RW] 

Public Class methods

Create a new instance of the Akismet class

Arguments

Arguments are provided in the form of a Hash with the following keys (as Symbols) available:

api_key:your Akismet API key
blog:the blog associated with your api key

The following keys are available and are entirely optional. They are available incase communication with Akismet‘s servers requires a proxy port and/or host:

  • proxy_port
  • proxy_host

Returns the URL for an Akismet request

Arguments

action <~to_s>:a valid Akismet function name

Returns

String

Public Instance methods

This is basically the core of everything. This call takes a number of arguments and characteristics about the submitted content and then returns a thumbs up or thumbs down. Almost everything is optional, but performance can drop dramatically if you exclude certain elements.

Arguments

options <Hash>:describes the comment being verified

The following keys are available for the options hash:

user_ip (required):IP address of the comment submitter.
user_agent (required):user agent information.
referrer (note spelling):the content of the HTTP_REFERER header should be sent here.
permalink:permanent location of the entry the comment was submitted to
comment_type:may be blank, comment, trackback, pingback, or a made up value like "registration".
comment_author:submitted name with the comment
comment_author_email:submitted email address
comment_author_url:commenter URL
comment_content:the content that was submitted
Other server enviroment variables:In PHP there is an array of enviroment variables called _SERVER which contains information about the web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet as how the submited content interacts with the server can be very telling, so please include as much information as possible.

This call is intended for the marking of false positives, things that were incorrectly marked as spam. It takes identical arguments as check_comment and mark_as_spam.

This call is for submitting comments that weren‘t marked as spam but should have been (i.e. false negatives). It takes identical arguments as check_comment.

Returns true if the API key has been verified, false otherwise

Protected Instance methods

Internal call to Akismet. Prepares the data for posting to the Akismet service.

Arguments

akismet_function <String>:the Akismet function that should be called

The following keys are available to configure a given call to Akismet:

user_ip (required):IP address of the comment submitter.
user_agent (required):user agent information.
referrer (note spelling):the content of the HTTP_REFERER header should be sent here.
permalink:the permanent location of the entry the comment was submitted to.
comment_type:may be blank, comment, trackback, pingback, or a made up value like "registration".
comment_author:submitted name with the comment
comment_author_email:submitted email address
comment_author_url:commenter URL
comment_content:the content that was submitted
Other server enviroment variables:In PHP there is an array of enviroment variables called _SERVER which contains information about the web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet as how the submited content interacts with the server can be very telling, so please include as much information as possible.

Call to check and verify your API key. You may then call the verified? method to see if your key has been validated

[Validate]