|
NGStatistics2 - Generates statistics from a mySQL database
calcstats.pl [options]
NGStatistics2 is an advanced newsgroup statistics program. Three scripts
are involved in the setting up, collecting and calculation of statistics
These three scripts are as follows:
The createtables.pl script is used initially to create the database and
tables in mySQL
If you already have a large number of messages on your newsserver, then
you may need to adjust the value in the script pertaining to the last
messageid to be read from the newsserver, so that the mySQL database
doesn't get updated with thousands of posts, which could cause timeouts
on slower machines. (See the script itself for more information)
With the help of the *News::Scan* module, mysqlinsert.pl scans the
articles on the newsserver for the chosen group and inserts data from
the newsserver into the database and tables created with the previous
script.
This script should be run as a cron job, so that it can gather
information from the relevant newsgroup on a regular basis.
If the newsgroup that you're going to create statistics for is a high
volume newsgroup you may want to run the script more frequently than a
newsgroup that is low volume.
It's for you to decide. :-)
calcstats.pl is the script that does all the business, in calculating
statistics. This script can either be run as a cronjob, so that scripts
are posted at the beginning of each month or it can be run by hand,
whilst passing other values (see the 'options' below)
-
--usage, --help, -?, -h
-
Prints a short usage message, then exits
-
--verbose, -v
-
Enables a few helpful debugging messages. Might also be useful
for submitting bug reports
-
This facility is turned off by default
-
For the script to be verbose, '-v' or '--verbose' need to be
typed
-
--post, -p
-
This option specifies whether the file should be posted to the
newgroup for which the statistics are being collected.
-
This facility is turned off be default
-
To post a message, '-p' or '--post' need to be typed
-
--emailstat, -es
-
Email to statistics file to someone
-
This option is turned off by default
-
To email someone, '-es' or '--emailstat' need to be typed
-
--emailaddress, -efa
-
This is the 'from' Email address that will be used if the
statistics are to be emailed or posted.
-
The default from address is 'root@localhost'
-
To change this, '--emailaddress=me@privacy.net' or '-efa=me@privacy.net' need to be typed ('me@privacy.net is an
example')
-
--emailname, -efn
-
This is the 'from' Email name that will be used in conjuction
with the 'from' Email address
-
The default from name is 'Root'
-
To change this, '--emailname=toto' or '-efn=toto' need to be
typed ('toto' is an example)
-
--emailtoadd, -eta
-
This is the 'to' Email address that will be used if the
statistics are to be emailed. This option is only used if the
'--emailstat' option is chosen
-
The default to address is 'root@localhost'
-
To change this, '--emailtoadd=me@privacy.net' or '-eta=me@privacy.net' need to be typed ('me@privacy.net is an
example')
-
--emailtoname, -etn
-
This is the 'to' Email name that will be used if the statistics
are to be emailed. This option is only used if the '--emailstat'
option is chosen
-
The default to name is 'Root'
-
To change this, '--emailtoname=toto' or '-etn=toto' need to be
typed ('toto' is an example)
-
--save, -sf
-
This option when set will save the output file to a location as
specified in the header of the file.
-
The default is to not save the output file to a different
location apart from that where the script is run
-
--confirm, -c
-
This option when set will ask for confirmation before posting
the message to the newsgroup.
-
The default is that the message is not posted to the group.
-
To change this, '--post' need to be typed
-
--days, -d
-
Sets the number of days in the past, that calcstats.pl should
scan.
-
The default is one week (i.e. 30 days).
-
To change this, '--days=30' or '-d=30' needs to be typed
-
--rank, -r
-
Sets the number of items printed in the 'major' categories.
-
Both of the 'Posters' and 'Threads' categories are considered
major.
-
The default is 20.
-
To change this, '--rank=20' or '-r=20' needs to be typed
-
--srank, -sr
-
Sets the number of items printed in the 'minor' categories.
-
Both of the 'Original Content Ratings' categories and the
crossposting category are considered minor.
-
The default is 10.
-
To change this, '--srank=10' or '-sr=10' needs to be typed
-
--width, -w
-
Sets the width of the printed lines in columns.
-
The default is 72 and should be acceptable for most purposes
-
To change this, '--width=72' or '-w=72' needs to be typed
Default variables can be set by editing the script calcstats.pl
In order to use the --days option, you must have that many days of
articles on your newsserver. If you don't, calcstats.pl will not correct
your error and the stats will be skewed
If you post statistics about a newsgroup to that newsgroup on a regular
basis, you may end up starting a series of everlasting flamewars. I'm
not responsible, so be warned!
Possibly quite a few. Email me with any bugs that you find at:
<statistics@rosbif.org>.
NGStatistics was written by Neil Lombardo <statistics@rosbif.org>.
The original NGStatistics is based on GroupSTAT, which was written by H.
Alex LaHurreau <alexdw@locl.net> which was originally based upon
StatNews by Davide G. M. Salvetti <salve@debian.org>.
It can still be downloaded at
http://www.rosbif.org/perlscripts/index.html and only needs access to a
local news spool. The statistics calculated are not as in-depth as this
version
Copyright 2005 Neil Lombardo. This is free software; see the source
for copying conditions. There is NO warranty; not even for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You may find the News::Scan manpage of interest.
http://search.cpan.org/doc/GBACON/News-Scan-0.51/News/Scan.pm
|