NAME

Gruntmaster::Opener - Populate opens table from NCSA access logs

SYNOPSIS

use Gruntmaster::Opener;

open my $fh, '<', '/var/log/apache2/access.log';
handle_line $_ while <$fh>;

DESCRIPTION

Gruntmaster::Opener is the backend of the gruntmaster-opener script that reads NCSA-style access logs, finds lines that represent successful requests to problems during contests, extracts data from them and inserts it into the database.

handle_line($line)

The only function in this module. Exported by default. Takes a single parameter, a line from a logfile in NCSA common/combined format.

If the request described in the given line:

  • Is successful (response code is 2xx)

  • Targets a problem (/pb/something)

  • Has a query parameter named contest

  • Happened during the contest named in the contest query parameter (this restriction is enforced by the open_problem function).

an entry is added to the opens table, using the open_problem function from Gruntmaster::Data.

SEE ALSO

gruntmaster-opener

AUTHOR

Marius Gavrilescu <marius@ieval.ro>

COPYRIGHT AND LICENSE

Copyright (C) 2014-2015 by Marius Gavrilescu

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.1 or, at your option, any later version of Perl 5 you may have available.