Compare commits

..

No commits in common. "d02ae5e2ff3f013febc4d84d22651610eb7a88b2" and "462f28505dcfd604fb1b0021b1376e6f940f5184" have entirely different histories.

4 changed files with 8 additions and 20 deletions

View file

@ -215,14 +215,10 @@ while (my ($Month, $Key, $Value) = $DBQuery->fetchrow_array) {
# output client versions
if ($OptVersions) {
### get client versions
# $SQLWhereClause without 'ALL' version, with client and month set
# $SQLWhereClause without 'ALL' version
$SQLWhereClause = SQLBuildClause('where',$SQLWherePeriod,$SQLWhereNames,
$ExcludeSums,"version != 'ALL'",
'client = ?','month = ?',
$ExcludeSums,"version != 'ALL'","client = '$Client'",
&SQLSetBounds('default',$LowBound,$UppBound));
# push client and month to @SQLVersBindNames
my @SQLVersBindNames = @SQLBindNames;
push (@SQLVersBindNames, ($Client, $Month));
# save length of longest client
my $ClientMaxLenght = $MaxLength;
@ -231,7 +227,7 @@ while (my ($Month, $Key, $Value) = $DBQuery->fetchrow_array) {
# for formatting purposes
my ($MaxLength,$MaxValLength) = &GetMaxLength($DBHandle,$Conf{'DBTable'},
'version','postings',$SQLWhereClause,
'',@SQLVersBindNames);
'',@SQLBindNames);
if ($MaxLength) {
# add lenght of '- '
$MaxLength += 2;
@ -246,7 +242,7 @@ while (my ($Month, $Key, $Value) = $DBQuery->fetchrow_array) {
$SQLWhereClause,$SQLGroupClause,
$SQLOrderClause));
# execute query
$DBVersQuery->execute(@SQLVersBindNames)
$DBVersQuery->execute(@SQLBindNames)
or &Bleat(2,sprintf("Can't get version data for %s from %s.%s: %s\n",
$CaptionPeriod,$Conf{'DBDatabase'},$Conf{'DBTable'},
$DBI::errstr));

View file

@ -497,15 +497,9 @@ sub ClientStats {
foreach (@Clients) {
# filter agents for User-Agent with multiple agents
next if $#Clients && exists($DropAgent{lc($_->{'agent'})});
# remove whitespace
$_->{'agent'} =~ s/^\s+|\s+$//g;
$_->{'version'} =~ s/^\s+|\s+$//g if $_->{'version'};
# encode to utf-8, if necessary
$_->{'agent'} = encode('UTF-8', $_->{'agent'}) if $_->{'agent'} =~ /[\x80-\x{ffff}]/;
$_->{'version'} = encode('UTF-8', $_->{'version'}) if $_->{'version'} and $_->{'version'} =~ /[\x80-\x{ffff}]/;
# truncate overlong clients or versions
$_->{'agent'} = substr($_->{'agent'}, 0, 150) if length($_->{'agent'}) > 150;
$_->{'version'} = substr($_->{'version'}, 0, 50) if $_->{'version'} and length($_->{'version'}) > 50;
# special cases
# Mozilla
$_->{'agent'} = 'Mozilla' if $_->{'agent'} eq '•Mozilla';
@ -667,7 +661,8 @@ sub RemoveComments {
# remove superfluous whitespace in header
# and whitespace around header
$Header =~ s/\s+/ /g;
$Header =~ s/^\s+|\s+$//g;
$Header =~ s/^\s+//;
$Header =~ s/\s+$//;
return $Header;
}

View file

@ -134,7 +134,7 @@ wenn Sie ermittelbar sind; daher kann die Summe der Newsreader-Versionen
kleiner sein als die Postingzahl fuer den Newsreader. Ausserdem koennen
an einem Beitrag mehrere Clients beteiligt sein, bspw. der Newsreader
und ein lokaler Server wie der Hamster. Daher kann die Summe aller
Newsreader groesser sein als die Summe der Postings; auch ergeben die
Newsreader groesser sein als die Summer der Postings; auch ergeben die
Prozentzahlen dementsprechend in der Summe mehr als 100%.
CLIENTSOUT

View file

@ -9,10 +9,7 @@ NewsStats 0.4.0 (unreleased)
* Add clientstats (for clients).
* Add ClientStats to postingstats.
* gatherstats: Don't die on parsing errors.
* DBClnts: set version length to 50.
* gatherstats: Truncate overlong clients or versions.
* gatherstats: Remove whitespace from client and version.
* Fix version queries.
* DBClnts: set version length to to 50.
NewsStats 0.3.0 (2025-05-18)
* Extract GroupStats (in gatherstats) to subroutine.