NAME

Chess::ELO::FEDA - Download FEDA ELO (http://www.feda.org) into differents backends (SQLite)

VERSION

version 0.01

SYNOPSIS

my $elo = Chess::ELO::FEDA->new(
   -url      => 'http://feda.org/feda2k16/wp-content/uploads/2017_11.zip'
   -folder   => './elo/feda',
   -target   => '2017_11.sqlite',
   -callback => sub { my $player = shift; },
   -verbose  => 1
);

METHODS

new (%OPTS)

Constructor. It accepts a hash with these options:

-callback

This callback sub will be called on each record found. It receives a hash reference with the player data: feda_id, surname, name, fed, rating, games, birth, title, flag

-folder

Working folder of the overall process. It is not created if it doesn't exists.

-target

Target file where the parser stores the ELO information. According the file extension, it selects the proper backend: .sqlite for SQLite dabase or .csv for a CSV file format.

-url

The URL direction (http://) used by the downloader to search the ZIP file. The main file expected into the package is the XLS

-verbose

0 by default. If set, shows useful debug messages

cleanup

Unlink the files dowloaded for this downloader

download

Download the ZIP file from the -url parameter. Extract the XLS file to the target_folder (which must exists)

parse

Parse and transform the XLS input file to the proper backend, according the -target parameter.

run

Integrates download, parse and cleanup in a single call.

AUTHOR

Miguel Prz <niceperl@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Miguel Prz.

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