engines/adva_spam/vendor/plugins/viking/lib/viking/defensio.rb
# This central action determines not only whether Defensio thinks a 
# comment is spam or not, but also a measure of its "spaminess", i.e. its 
# relative likelihood of being spam.
# 
# It should be noted that one of Defensio's key features is its ability to 
# rank spam according to how "spammy" it appears to be. In order to make 
# the most of the Defensio system in their applications, developers should 
# take advantage of the spaminess value returned by this function, to 
# build interfaces that make it easy for the user to quickly sort through 
# and manage their spamboxes.
# 
# ==== Arguments
# Provide arguments in a Hash. The following keys are available:
# 
# +owner_url+ (*required*):: 
#   the URL of the owner using Defensio. Note that this value should be 
#   provided in your default options for Viking and will be automatically 
#   inserted into your call.
# +user_ip+ (*required*)::
#   the IP address of whomever is posting the comment
# +article_date+  <~strftime> (*required*)::
#   the date the original blog article was posted
# +comment_author+ (*required*):: 
#   the name of the author of the comment
# +comment_type+ (*required*)::
#   the type of comment being posted to the article. This is expected to 
#   be any of the following: 'comment', 'trackback', 'pingback', 'other'
# +comment_content+::
#   the content of the comment in question
# +comment_author_email+::
#   the email address of the comment's author
# +permalink+::
#   the permalink of the blog post to which the comment is being posted
# +referrer+::
#   the URL of the site that brought the commenter to this page
# +user_logged_in+::
#   whether or not the user leaving the comment is logged into the client 
#   platform. Expected to be either +true+ or +false+.
# +trusted_user+::
#   whether or not the user is an administrator or modertor or editor of 
#   the blog. This should only ever be true if the blogging platform can 
#   guarentee that the user has been authenticated and authorized for this 
#   role. This is expected to be either +true+ or +false+.
# +openid+::
#   the OpenID URL of the currently logged in user. Must be used in 
#   conjunction with +user_logged_in+ as +true+. OpenID authentication 
#   must be taken care of by your application.
# +test_force+::
#   <b>FOR TESTING PURPOSES ONLY</b>: use this parameter to force the 
#   outcome of +audit_comment+. Optionally affix (with a comma) a desired 
#   +spaminess+ return value (in the range 0 to 1) (e.g. "spam,x.xxxx" 
#   "ham,x.xxxx" )
# 
# ==== Returns
# Hash:: 
#   contains server response. Should things go awry, the full response 
#   will be provided.
# 
# ===== Response structure
# The following are the fields returned from the server and their possible 
# values:
# 
# +status+::
#   indicates whether or not the key is valid for this blog. Either 
#   'success' or 'fail'.
# +message+::
#   the message provided by the action, if applicable
# +api_version+::
#   the API version used to process the request
# +signature+::
#   this uniquely identifies a message in the Defensio system. This should 
#   be retained by the client for retraining purposes.
# +spam+::
#   whether or not Defensio believes the comment to be spam. This will be 
#   either +true+ or +false+
# +spaminess+::
#   a value indicating the relative likelihood that a comment is spam. 
#   This should be retained to aid in building spam sorting interfaces.
This central action determines not only whether Defensio thinks a
comment is spam or not, but also a measure of its "spaminess", i.e. its
relative likelihood of being spam.

It should be noted that one of Defensio's key features is its ability to
rank spam according to how "spammy" it appears to be. In order to make
the most of the Defensio system in their applications, developers should
take advantage of the spaminess value returned by this function, to
build interfaces that make it easy for the user to quickly sort through
and manage their spamboxes.

Arguments
Provide arguments in a Hash. The following keys are available.

+owner_url+ (*required*)::
the URL of the owner using Defensio. Note that this value should be
provided in your default options for Viking and will be automatically
inserted into your call.

Returns
Hash::
contains server response. Should things go awry, the full response
will be provided.

Response structure
The following are the fields returned from the server and their possible
values.

+status+::
indicates whether or not the key is valid for this blog. Either
'success' or 'fail'.
This central action determines not only whether Defensio thinks a comment is spam or not but also a measure of its " spaminess " i . e . its relative likelihood of being spam . It should be noted that one of Defensio ' s key features is its ability to rank spam according to how " spammy " it appears to be . In order to make the most of the Defensio system in their applications developers should take advantage of the spaminess value returned by this function to build interfaces that make it easy for the user to quickly sort through and manage their spamboxes . Arguments Provide arguments in a Hash . The following keys are available . + owner_url + ( * required * ) :: the URL of the owner using Defensio . Note that this value should be provided in your default options for Viking and will be automatically inserted into your call . Returns Hash :: contains server response . Should things go awry the full response will be provided . Response structure The following are the fields returned from the server and their possible values . + status + :: indicates whether or not the key is valid for this blog . Either ' success ' or ' fail ' .
def check_comment(options={})
      return false if invalid_options?
      options[:article_date] = options[:article_date].strftime("%Y/%m/%d") 
      call_defensio 'audit-comment', options
    end
def check_comment ( options = { } ) return false if invalid_options? options [ :article_date ] = options [ :article_date ] . strftime ( "%Y/%m/%d" ) call_defensio 'audit-comment' , options end
This central action determines not only whether Defensio thinks a
comment is spam or not, but also a measure of its "spaminess", i.e.
This central action determines not only whether Defensio thinks a comment is spam or not but also a measure of its " spaminess " i . e .
# e.g. 2007/05/16
options