Compare commits

...

5 commits

Author SHA1 Message Date
Thomas Hochstein 0b87e81b08 Add parsing exemptions.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2025-06-01 11:03:05 +02:00
Thomas Hochstein 1a5b9dbcb1 Remove debugging code.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2025-06-01 11:03:05 +02:00
Thomas Hochstein cff76a3c65 Set executable bit for new scripts.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2025-06-01 11:03:05 +02:00
Thomas Hochstein 18db200aea Let dopostingstats default to last month.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2025-06-01 11:03:05 +02:00
Thomas Hochstein 8afeb09cc2 Add clientstats to dopostingstats.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2025-06-01 11:03:05 +02:00
9 changed files with 14 additions and 8 deletions

0
bin/clientstats.pl Normal file → Executable file
View file

View file

@ -23,7 +23,6 @@ use warnings;
use NewsStats qw(:DEFAULT :TimePeriods ListNewsgroups ParseHierarchies ReadGroupList ParseHeaders);
use DBI;
use Data::Dumper;
use Encode qw(decode encode);
use Getopt::Long qw(GetOptions);
Getopt::Long::config ('bundling');
@ -654,7 +653,8 @@ sub RemoveComments {
$Header =~ s/[ _]DE//;
# remove trailing 'eol' or '-shl'
$Header =~ s/(eol)|(-shl)$//;
# or ml-inews[-sig]
$Header =~ s/(eol)|(-shl)|(ml-inews(-sig)?)$//;
# remove from ';' or ',' (CrossPoint)
# or '&' to end of header

0
bin/hoststats.pl Normal file → Executable file
View file

0
bin/postingstats.pl Normal file → Executable file
View file

14
contrib/dopostingstats.sh Normal file → Executable file
View file

@ -1,9 +1,13 @@
#!/bin/bash
# installation path is /srv/newsstats/, please adjust accordingly
if [[ $1 =~ [0-9]{4}-[0-9]{2} ]]; then
/srv/newsstats/bin/groupstats.pl --nocomments --sums --format dump --month $1 | /srv/newsstats/bin/postingstats.pl --month $1 | /srv/newsstats/contrib/tinews.pl -X -Y
/srv/newsstats/bin/hoststats.pl --nocomments --sums --format dump --month $1 | /srv/newsstats/bin/postingstats.pl -t server --month $1 | /srv/newsstats/contrib/tinews.pl -X -Y
else
echo 'Input error, please use dopostingstats.sh YYYY-MM'
# get month
MONTH=$1
if ! [[ $1 =~ [0-9]{4}-[0-9]{2} ]]; then
MONTH=$(date -d "$(date +%Y-%m-15) -1 month" '+%Y-%m')
fi
# post stats
/srv/newsstats/bin/groupstats.pl --nocomments --sums --format dump --month $MONTH | /srv/newsstats/bin/postingstats.pl --month $MONTH | /srv/newsstats/contrib/tinews.pl -X -Y
/srv/newsstats/bin/hoststats.pl --nocomments --sums --format dump --month $MONTH | /srv/newsstats/bin/postingstats.pl -t server --month $MONTH | /srv/newsstats/contrib/tinews.pl -X -Y
/srv/newsstats/bin/clientstats.pl --nocomments --sums --versions --format dump --month $MONTH | /srv/newsstats/bin/postingstats.pl -t client --month $MONTH | /srv/newsstats/contrib/tinews.pl -X -Y

0
contrib/tinews.pl Normal file → Executable file
View file

0
contrib/yearstats.sh Normal file → Executable file
View file

View file

@ -13,6 +13,9 @@ NewsStats 0.4.0 (unreleased)
* gatherstats: Truncate overlong clients or versions.
* gatherstats: Remove whitespace from client and version.
* Fix version queries.
* Add ClientStats to dopostingstats.
* Let dopostingstats default to last month.
* Set executable bit for new scripts.
NewsStats 0.3.0 (2025-05-18)
* Extract GroupStats (in gatherstats) to subroutine.

View file

@ -51,7 +51,6 @@ require Exporter;
SQLSetBounds SQLBuildClause GetMaxLength)]);
$VERSION = '0.4.0';
use Data::Dumper;
use File::Basename;
use Cwd qw(realpath);