Class Gregphoto_Service_Akismet

Description

A class for dealing with the Akismet web service. Akismet provides a service to help people identify messages - specially blog comments - as spam or not spam.

Located in /Akismet.php (line 29)


	
			
Variable Summary
mixed $blog
mixed $key
mixed $userAgent
mixed $validVars
mixed $vars
Method Summary
Gregphoto_Service_Akismet __construct (string $key, string $blog)
Boolean checkIsSpam (array $msgInfo)
array getDefaultVars ()
void reset ()
string sendReq (string $url)
void submitHam (array $msgInfo)
void submitSpam (array $msgInfo)
Boolean validateKey ()
Variables
mixed $blog (line 31)
  • access: protected
mixed $key (line 30)
  • access: protected
mixed $userAgent = 'Gregphoto_Service_Akismet/1.0 | Gregphoto_Service_Akismet/1.0' (line 32)
  • access: protected
mixed $validVars = array('key','blog','user_ip','user_agent','referrer','permalink','comment_type','comment_author','comment_author_email','comment_author_url','comment_content') (line 34)
  • access: protected
mixed $vars = array() (line 33)
  • access: protected
Methods
Constructor __construct (line 42)

Constructor for the class, must be called

  • access: public
Gregphoto_Service_Akismet __construct (string $key, string $blog)
  • string $key: An API key for the Akismet web service. Instructions for getting one are available at http://akismet.com/development/api/
  • string $blog: The main page of the website / blog this is stopping spam for
checkIsSpam (line 71)

Checks whether a comment / message is spam

  • return: Returns true is the comment is identified as spam, false if it is not
  • access: public
Boolean checkIsSpam (array $msgInfo)
  • array $msgInfo: An array of items to be passed as Post vars to the Akismet web service. By default, user_ip, user_agent, and referrer are set using the $_SERVER variable. You may override these as well.
getDefaultVars (line 132)

Sets some default values for the user_ip, user_agent, and referrer options from the $_SERVER superglobal

  • return: Array of default options
  • access: protected
array getDefaultVars ()
reset (line 104)

Resets the class variable vars to only contain entries for key and blog. Sets up the class for further requests.

  • access: protected
void reset ()
sendReq (line 114)

Performs the HTTP request to the Akismet web service, adds the POST requests, and returns the response body from Akismet as a string

  • return: The body of the HTTP response from Akismet
  • access: protected
string sendReq (string $url)
  • string $url: The url to send the request to
submitHam (line 94)

This call is for submitting comments as ham (not spam) that were identified as spam by checkIsSpam. It takes identical arguments as checkIsSpam.

  • access: public
void submitHam (array $msgInfo)
  • array $msgInfo: An array of items to be passed as Post vars to the Akismet web service. By default, user_ip, user_agent, and referrer are set using the $_SERVER variable. You may override these as well.
submitSpam (line 83)

This call is for submitting comments as spam that weren't identified as spam by checkIsSpam. It takes identical arguments as checkIsSpam.

  • access: public
void submitSpam (array $msgInfo)
  • array $msgInfo: An array of items to be passed as Post vars to the Akismet web service. By default, user_ip, user_agent, and referrer are set using the $_SERVER variable. You may override these as well.
validateKey (line 59)

Validates whether or not your API key is valid

  • return: Returns true if key is valid, false if invalid
  • access: public
Boolean validateKey ()

Documentation generated on Sun, 11 Jun 2006 17:27:46 -0700 by phpDocumentor 1.3.0RC3