aboutsummaryrefslogtreecommitdiffstats
path: root/stats.pl
diff options
context:
space:
mode:
Diffstat (limited to 'stats.pl')
-rwxr-xr-xstats.pl24
1 files changed, 13 insertions, 11 deletions
diff --git a/stats.pl b/stats.pl
index 7bd118e..ce7ebbd 100755
--- a/stats.pl
+++ b/stats.pl
@@ -78,17 +78,19 @@ for my $group (@group_names) {
my $content = get("http://".$group_info->{'server'}->{$group});
- for my $line (split /\n/, $content) {
- last if (defined($users) && defined($posts) && defined($comments));
- last if ($line =~ /Last activity/i);
- next if (length $line < 1);
-
- if ($line =~ /Users:[^0-9]*(\d+)/i) {
- $users = $1;
- } elsif ($line =~ /Posts:[^0-9]*(\d+)/i) {
- $posts = $1;
- } elsif ($line =~ /Comments:[^0-9]*(\d+)/i) {
- $comments = $1;
+ if (length $content > 1) {
+ for my $line (split /\n/, $content) {
+ last if (defined($users) && defined($posts) && defined($comments));
+ last if ($line =~ /Last activity/i);
+ next if (length $line < 1);
+
+ if ($line =~ /Users:[^0-9]*(\d+)/i) {
+ $users = $1;
+ } elsif ($line =~ /Posts:[^0-9]*(\d+)/i) {
+ $posts = $1;
+ } elsif ($line =~ /Comments:[^0-9]*(\d+)/i) {
+ $comments = $1;
+ }
}
}