NAME

App::Kramerius::To::Images - Base class for kramerius2images script.

SYNOPSIS

use App::Kramerius::To::Images;

my $app = App::Kramerius::To::Images->new;
my $exit_code = $app->run;

METHODS

new

my $app = App::Kramerius::To::Images->new;

Constructor.

Returns instance of object.

  • dir_to_store_files

    Directory to store files.

    Default value is undef, which means actual directory.

  • lwp_user_agent

    LWP::UserAgent object.

    Default value is instance of LWP::UserAgent with set user agent to 'kramerius2images/__PACKAGE_VERSION__'.

run

my $exit_code = $app->run;

Run.

Returns 1 for error, 0 for success.

ERRORS

new():
        From Class::Utils::set_params():
                Unknown parameter '%s'.
        Parameter 'lwp_user_agent' must be a LWP::UserAgent instance.

run():
        Bad version of Kramerius.
                Kramerius version: %s
        Cannot get title for page '%s'.
        Cannot get '%s' URI.
                HTTP code: %s
                message: %s
        Cannot parse JSON on '%s' URI.
                JSON decode error: %s
        Cannot read library id and work id.
        Content type isn't 'application/json' for '%s' URI.
                Content-Type: %s
        Library with ID '%s' is unknown.
        No images to download.

EXAMPLE

use strict;
use warnings;

use App::Kramerius::To::Images;

# Arguments.
@ARGV = (
        '-h',
);

# Run.
exit App::Kramerius::To::Images->new->run;

# Output like:
# Usage: ./ex1.pl [-h] [-q] [-v] [--version] [kramerius_id object_id]
#         -h              Help.
#         -q              Quiet mode.
#         -v              Verbose mode.
#         --version       Print version.
#         kramerius_id    Kramerius system id. e.g. mzk
#         object_id       Kramerius object id (could be page, series or book edition).

DEPENDENCIES

App::Kramerius::V4, Class::Utils, Data::Kramerius, English, Error::Pure, Getopt::Std, HTTP::Request, IO::Barf, JSON::XS, LWP::UserAgent, METS::Files, Perl6::Slurp.

SEE ALSO

Task::Kramerius

Install modules for Kramerius system.

App::Images::To::DjVu

Base class for images2djvu script.

REPOSITORY

https://github.com/michal-josef-spacek/App-Kramerius-To-Images

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2021 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.04