The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SpamcupNG - module to export functions for spamcup program

SYNOPSIS

    use SpamcupNG qw(read_config get_browser);

DESCRIPTION

Spamcup NG is a Perl web crawler for finishing Spamcop.net reports automatically. This module implements the functions used by the spamcup program.

See the README.md file on this project for more details.

See the INSTALL for setup instructions.

EXPORTS

read_config

Reads a YAML file, sets the command line options and return the associated accounts.

Expects as parameter a string with the full path to the YAML file and a hash reference of the command line options read (as returned by Getopts::Std getopts function).

The hash reference options will set as defined in the YAML file. Options defined in the YAML have preference of those read on the command line then.

It will also return all data configured in the Accounts section of the YAML file as a hash refence. Check the README.md file for more details about the configuration file.

get_browser

Creates a instance of LWP::UserAgent and returns it.

Expects two string as parameters: one with the name to associated with the user agent and the another as version of it.

main_loop

Processes all the pending spam reports in a loop until finished.

Expects as parameter (in this sequence):

  • a LWP::UserAgent instance

  • A hash reference with the following key/values:

    • ident => The identity to Spamcop

    • pass => The password to Spamcop

    • debug => true (1) or false (0) to enable/disable debug information

    • delay => time in seconds to wait for next iteration with Spamcop website

    • quiet => true (1) or false (0) to enable/disable messages

      As confusing as it seems, current implementation may accept debug messages and disable other messages.

    • check_only => true (1) or false (0) to only check for unreported SPAM, but not reporting them

Returns true if everything went right, or die if a fatal error happened.

AUTHOR

Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 of Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>

This file is part of spamcupNG distribution.

spamcupNG 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, either version 3 of the License, or (at your option) any later version.

spamcupNG 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.

You should have received a copy of the GNU General Public License along with spamcupNG. If not, see <http://www.gnu.org/licenses/>.