SYNOPSIS

        my $akismet = Net::Akismet->new(
                        KEY => 'secret-baba-API-key',
                        URL => 'http://example.blog.net/',
                ) or die('Key verification failure!');

        my $verdict = $akismet->check(
                        USER_IP                         => '10.10.10.11',
                        COMMENT_USER_AGENT      => 'Mozilla/5.0',
                        COMMENT_CONTENT         => 'Run, Lola, Run, the spam will catch you!',
                        COMMENT_AUTHOR          => 'dosser',
                        COMMENT_AUTHOR_EMAIL    => '[email protected]',
                        REFERRER                => 'http://lola.home/',
                ) or die('Is the server here?');

        if ('true' eq $verdict) {

                print "I found spam. I am a spam-founder!\n";
        }

METHODS

new()

Net::Akismet->new(PARAM => ...); Acceptable parameters:

\s-1KEY\s0

The \s-1API\s0 key being verified for use with the \s-1API\s0.

\s-1URL\s0

The front page or home \s-1URL\s0 of the instance making the request. For a blog or wiki this would be the front page.

\s-1USER_AGENT\s0

If supplied the value is prepended to this module's identification string to become something like: your-killer-app/0.042 Perl-Net-Akismet/0.01 libwww-perl/5.8 Otherwise just Akismet Perl's user agent string will be sent.

\s-1SERVICE_HOST\s0

If supplied, the host of the service \s-1API\s0. The default is rest.akismet.com

\s-1SERVICE_VERSION\s0

If supplied, the \s-1API\s0 version. The default is 1.1

If verification of the key was unsuccessful \*(C`new()\*(C' returns \*(C`undef\*(C'.

check()

$akismet->check(USER_IP => ..., COMMENT_CONTENT => ..., ...) To be or not to be... \*(C`check\*(C' is meant to tell you. Give it enough details about the comment and expect 'true', 'false' or \*(C`undef\*(C' as a result. 'true' means spam, 'false' means not spam, \*(C`undef\*(C' is returned on errror in submission of the comment. Acceptable comment characteristics:

\s-1USER_IP\s0

Required. Represents the \s-1IP\s0 address of the comment submitter.

\s-1COMMENT_USER_AGENT\s0

Required. User agent string from the comment submitter's request.

\s-1COMMENT_CONTENT\s0

Comment text.

\s-1REFERRER\s0

\s-1HTTP\s0 \*(C`Referer\*(C' header.

\s-1PERMALINK\s0

Permanent link to the subject of the comment.

\s-1COMMENT_TYPE\s0

May be blank, 'comment', 'trackback', 'pingback', or a made up value like 'registration'.

\s-1COMMENT_AUTHOR\s0

Name of submitter.

\s-1COMMENT_AUTHOR_EMAIL\s0

Submitter e-mail.

\s-1COMMENT_AUTHOR_URL\s0

Submitter web page.

spam()

Reports a certain comment as spam. Accepts the same arguments as \*(C`check()\*(C'. In case of failed submission returns \*(C`undef\*(C', otherwise - a perl-known truth.

ham()

This call is intended for the marking of false positives, things that were incorrectly marked as spam. It takes identical arguments as \*(C`check()\*(C' and \*(C`spam()\*(C'. In case of failed submission returns \*(C`undef\*(C', otherwise - a perl-known truth.

NOTES

Although almost all comment characteristics are optional, performance can drop dramatically if you exclude certain elements. So please, supply as much comment detail as possible.

RELATED TO Net::Akismet…

  • http://akismet.com/

  • http://akismet.com/development/api/

AUTHOR

Nikolay Bachiyski <[email protected]>

\$1

  • Peter Pentchev

  • John Belmonte

COPYRIGHT AND LICENSE

Copyright (C) 2006, 2007, 2008 by Nikolay Bachiyski

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

$Id: Akismet.pm 38 2008-06-05 17:15:12Z humperdink $