Cheetah
|
Akismet anti-comment spam service
The class in this package allows use of the Akismet anti-comment spam service in any PHP5 application.
This service performs a number of checks on submitted data and returns whether or not the data is likely to be spam.
Please note that in order to use this class, you must have a vaild WordPress API key. They are free for non/small-profit types and getting one will only take a couple of minutes.
For commercial use, please visit the Akismet commercial licensing page.
Please be aware that this class is PHP5 only. Attempts to run it under PHP4 will most likely fail.
See the Akismet class documentation page linked to below for usage information.
The Akismet PHP5 Class
This class takes the functionality from the Akismet WordPress plugin written by Matt Mullenweg and allows it to be integrated into any PHP5 application or website.
The original plugin is available on the Akismet website.
$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
Optionally you may wish to check if your WordPress API key is valid as in the example below.
$akismet = new Akismet('http://www.example.com/blog/', 'aoeu1aoue');
if($akismet->isKeyValid()) { // api key is okay } else { // api key is invalid }
Used internally by Akismet
This class is used by Akismet to do the actual sending and receiving of data. It opens a connection to a remote host, sends some data and the reads the response and makes it available to the calling program.
The code that makes up this class originates in the Akismet WordPress plugin, which is available on the Akismet website.
N.B. It is not necessary to call this class directly to use the Akismet class.
Used internally by the Akismet class and to mock the Akismet anti spam service in the unit tests.
N.B. It is not necessary to call this class directly to use the Akismet class.
Used internally by the Akismet class and to mock the Akismet anti spam service in the unit tests.
N.B. It is not necessary to implement this class to use the Akismet class.