\Akismet
The Akismet PHP5 Class
This class takes the functionality from the Akismet WordPress plugin written by and allows it to be integrated into any PHP5 application or website.
The original plugin is .
<b>Usage:</b>
<code>
$akismet = new Akismet('http://www.example.com/blog/', 'aoeu1aoue');
$akismet->setCommentAuthor($name);
$akismet->setCommentAuthorEmail($email);
$akismet->setCommentAuthorURL($url);
$akismet->setCommentContent($comment);
$akismet->setPermalink('http://www.example.com/blog/alex/someurl/');
if($akismet->isCommentSpam())
// store the comment but mark it as spam (in case of a mis-diagnosis)
else
// store the comment normally
</code>
- Author: Alex Potsides
Synopsis
class Akismet
{
- // members
- private string $version = '0.2';
- private $wordPressAPIKey;
- private $blogURL;
- private $comment;
- private $apiPort;
- private $akismetServer;
- private $akismetVersion;
- private array $ignore = ;
- // methods
- public void __construct()
- private void http_post()
- private void getQueryString()
- public bool isCommentSpam()
- public void submitSpam()
- public void submitHam()
- public void setUserIP()
- public void setReferrer()
- public void setPermalink()
- public void setCommentType()
- public void setCommentAuthor()
- public void setCommentAuthorEmail()
- public void setCommentAuthorURL()
- public void setCommentContent()
- public void setAPIPort()
- public void setAkismetServer()
- public void setAkismetVersion()
Members
private
- $apiPort
- $blogURL
- $comment
- $ignore
- $version
- $wordPressAPIKey
Methods
private
public
- __construct()
- isCommentSpam() — Tests for spam.
- setAPIPort() — Defaults to 80
- setAkismetServer() — Defaults to rest.akismet.com
- setAkismetVersion() — Defaults to '1.1'
- setCommentAuthor() — The name that the author submitted with the comment.
- setCommentAuthorEmail() — The email address that the author submitted with the comment.
- setCommentAuthorURL() — The URL that the author submitted with the comment.
- setCommentContent() — The comment's body text.
- setCommentType() — The type of comment being submitted.
- setPermalink() — A permanent URL referencing the blog post the comment was submitted to.
- setReferrer() — To override the referring page when submitting spam/ham later on
- setUserIP() — To override the user IP address when submitting spam/ham later on
- submitHam() — Submit ham that is incorrectly tagged as spam.
- submitSpam() — Submit spam that is incorrectly tagged as ham.