diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-02 17:04:24 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-02 17:04:24 +0200 |
| commit | 5a32d7e8f75fc9626daef699618528de1eadfa91 (patch) | |
| tree | b0fc077bd2dc52b7b8b5f9cce8c47116558d48b0 | |
| parent | 92aa5e1eda96182d720f75c8a2276a8be1533fb1 (diff) | |
collect filtered
| -rw-r--r-- | foostats.pl | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/foostats.pl b/foostats.pl index 9a49876..e3600f1 100644 --- a/foostats.pl +++ b/foostats.pl @@ -433,8 +433,9 @@ package Foostats::Reporter { my @stats = stats_for_date($stats_dir, $date); my %report = ( - feed_subscribers => feed_subscribers(@stats), - # TODO: Page views stats + feed_ips => feed_ips(@stats), + count => count(@stats), + page_ips => page_ips(@stats), ); return \%report; @@ -467,7 +468,7 @@ package Foostats::Reporter { } } - sub feed_subscribers (@stats) { + sub feed_ips (@stats) { my (%gemini, %web); for my $stats (@stats) { @@ -491,6 +492,30 @@ package Foostats::Reporter { return \%report; } + sub count (@stats) { + my %report; + + for my $stats (@stats) { + next unless exists $stats->{count}; + + while (my ($key, $val) = each $stats->{count}->%*) { + $report{$key} //= 0; + $report{$key} += $val; + } + } + + return \%report; + } + + sub page_ips (@stats) { + my %report = (); + + for my $stats (@stats) { + } + + return \%report; + } + sub stats_for_date ($stats_dir, $date) { my @stats; |
