#!/usr/bin/perl -w
use strict;

my $VERSION = '0.02';

#----------------------------------------------------------------------------
# Library Modules

use lib qw(../lib lib);

use Cwd;
use Getopt::Long;

use CPAN::WWW::Testers::Generator   '0.23';

#----------------------------------------------------------------------------
# Variables

my %options;

#----------------------------------------------------------------------------
# Code

GetOptions( \%options,
            'directory|d=s',
            'ignore|i',
	    'nostore|n',
            'help|h'
);

if ( $options{help} ) {
    print <<HERE;
Usage: $0 [-d directory] [-i] [-n] [-h]
  -d directory   use named directory
  -i             ignore no article errors
  -n             do not store old articles
  -h             this help screen
HERE
    exit 1;
}

my $directory = $options{directory} || cwd();
my $t = CPAN::WWW::Testers::Generator->new(
    ignore      => $options{ignore},
    nostore     => $options{nostore},
    directory   => $directory,
    logfile     => $directory . '/logs/cpanstats.log'
);

$t->generate;

__END__

=head1 NAME

cpanstats - script to access the NNTP server and update the database.

=head1 SYNOPSIS

  cpanstats

=head1 DESCRIPTION

Acts as a wrapper script to the underlying CPAN::WWW::Testers::Generator code
that downloads articles from the NNTP server, extracts all components of each,
then stores the data into a local SQLite database.

=head1 BUGS, PATCHES & FIXES

There are no known bugs at the time of this release. However, if you spot a
bug or are experiencing difficulties, that is not explained within the POD
documentation, please send an email to barbie@cpan.org. However, it would help
greatly if you are able to pinpoint problems or even supply a patch.

Fixes are dependant upon their severity and my availablity. Should a fix not
be forthcoming, please feel free to (politely) remind me.

=head1 SEE ALSO

L<CPAN::WWW::Testers>.

F<http://www.cpantesters.org/>,
F<http://stats.cpantesters.org/>.

=head1 AUTHOR

  Barbie, <barbie@cpan.org>
  for Miss Barbell Productions <http://www.missbarbell.co.uk>.

=head1 COPYRIGHT AND LICENSE

  Copyright (C) 2005-2008 Barbie for Miss Barbell Productions.

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

=cut

