App::SpamcupNG - module to export functions for spamcup program


    use App::SpamcupNG qw(read_config get_browser main_loop config_logger %OPTIONS_MAP);


App-SpamcupNG is a Perl web crawler for finishing reports automatically. This module implements the functions used by the spamcup program.

See the file on this project for more details.



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 file for more details about the configuration file.


Configures a Log::Log4perl object, as defined by the verbosity parameter (-V in the command line).

Expected parameters:

  • level

  • path to a log file

If the verbosity is set to DEBUG, all messages will be sent to a log file opened as spamcup.log in append mode.

Otherwise, all messages will be sent to STDOUT.

Verbosity modes are:


  • INFO

  • WARN



Depending on the verbosity level, more or less information you be provided. See Log::Log4perl for more details about the levels.


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

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

    • verbosity => defines what level of information should be provided. Uses the same values as defined by Log::Log4perl.

      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.



Alceu Rodrigues de Freitas Junior, <>


This software is copyright (c) 2018 of Alceu Rodrigues de Freitas Junior, <>

This file is part of App-SpamcupNG distribution.

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

App-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 App-SpamcupNG. If not, see <>.