Marcus Ramberg

NAME

Net::Akismet::Protocol - Perl interface to Akismet Protocol - comment and trackback spam fighter

SYNOPSIS

        my $akismet = Net::Akismet::Protocol->new(
                        key => 'secret-baba-API-key',
                        url => 'http://example.blog.net/',
                );

        my $verdict = $akismet->check(
                        user_ip                 => '10.10.10.11',
                        user_agent              => 'Mozilla/5.0',
                        comment_content         => 'Run, Lola, Run, the spam will catch you!',
                        comment_author          => 'dosser',
                        coment_author_email     => 'dosser@subway.de',
                        referrer                => 'http://lola.home/',
                ) or die('Is the server here?');

        if ( $verdict == 1) {

                print "I found spam. I am a spam-finder!\n";
        }
=head1 DESCRIPTION

This module implements the Akismet anti-spam API. It's based on Net::Akismet, but has been rewritten using Moose, and it you allows to use different servers as long as they implement the same REST spec as Akismet. By default, the module will use Typepad Antispam.

METHODS

new()

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

Acceptable parameters:

key

The API key being verified for use with the API.

url

The front page or home URL of the instance making the request. For a blog or wiki this would be the front page.

ua

The LWP::UserAgent to use ´ =item ua_string

This will be set as your user agent string at build time if supplied.

api_version

Akismet API version in use. Defaults to '1.1'

host

API host to connect to. defaults to 'api.antispam.typepad.com'

If verification of the key was unsuccessful new() returns undef.

check()

        $akismet->check(user_ip => ..., comment_content => ..., ...)

To be or not to be... check is meant to tell you. Give it enough details about the comment and expect 'true', 'false' or undef as a result. 'true' means spam, 'false' means not spam, undef is returned on errror in submission of the comment.

Acceptable comment characteristics:

user_ip

Required. Represents the IP address of the comment submitter.

user_agent

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

comment_content

Comment text.

referer

HTTP Referer header.

Permanent link to the subject of the comment.

comment_type

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

comment_author

Name of submitter.

comment_author_mail

Submitter e-mail.

comment_author_url

Submitter web page.

spam()

Reports a certain comment as spam. Accepts the same arguments as check().

In case of failed submission returns undef, 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 check() and spam().

In case of failed submission returns undef, otherwise - a perl-known truth.

Internal Moose methods

meta

BUILD

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.

SEE ALSO

  • Net::Akismet

  • http://akismet.com/

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

AUTHOR

Marcus Ramberg <mramberg@cpan.org>

Based on Net::Akismet by Nikolay Bachiyski <nbachiyski@developer.bg>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 160:

Non-ASCII character seen before =encoding in '´'. Assuming UTF-8




Hosting generously
sponsored by Bytemark