diff options
Diffstat (limited to '0.8.1/modules/webchat.pm')
| -rwxr-xr-x | 0.8.1/modules/webchat.pm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/0.8.1/modules/webchat.pm b/0.8.1/modules/webchat.pm new file mode 100755 index 0000000..90f8731 --- /dev/null +++ b/0.8.1/modules/webchat.pm @@ -0,0 +1,22 @@ +sub webchat { + my @rooms = &diropen('data/online/rooms'); + my $output; + + foreach my $room (@rooms) { + next if ($room =~ /\./); + my @users = &diropen("data/online/rooms/$room") or print "$!\n"; + + foreach my $user (@users) { + next if ($user =~ /\./); + open FILE, "data/online/rooms/$room/$user"; + my $timestamp = <FILE>; + close FILE; + chomp $timestamp; + + $output = $output . "($user)($timestamp)($room)\n"; + } + } + + print $output; +} +1; |
