NAME

WebService::AbuseIPDB::ReportedAddress - Data on one address from a range as a result of check_block

SYNOPSIS

The reports method of WebService::AbuseIPDB::CheckBlockResponse will return an array of objects of this class. It consists only of a constructor and 5 getters.

use WebService::AbuseIPDB;

my $ipdb = WebService::AbuseIPDB->new (key => 'abc123...');
my $res = $ipdb->check_block (ip => '127.0.0.0/24');
unless ($res->successful) {
    for my $err (@{$res->errors}) {
        warn "Error $err->{status}: $err->{detail}\n";
    }
    die "Cannot continue.\n";
}

for my $rep ($res->reports) {
    printf "%s has a score of %i, last reported at %s\n",
        $res->ip, $res->score, $res->last_report_time;
}

METHODS

new

Takes a hashref of data and returns the immutable object.

cc

Returns the 2-letter country code of this IP address.

score

Returns the abuse score as an integer between 0 and 100 inclusive.

report_count

Returns the total number of reports of this address in the requested date range as a whole number.

last_report_time

Returns the time of the last report of this address as "YYYY-MM-DDTHH:MM:SS+HH:MM".

ip

Returns the IP address itself as a string.

STABILITY

This is currently alpha software. Be aware that both the internals and the interface are liable to change.

AUTHOR

Pete Houston, <cpan at openstrike.co.uk>

SEE ALSO

WebService::AbuseIPDB for general use of the client and Version 2 of the AbuseIPDB API for API details/restrictions.

LICENCE AND COPYRIGHT

Copyright © 2020 Pete Houston

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991 or at your option any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License is available in the source tree; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA