diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:47 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:47 +0200 |
| commit | 630af0ed6c0af69c7df2e45aef7a87722a3c00c0 (patch) | |
| tree | ad76f850278b090f7e5c26561035d19c320400cc /0.7.6/modules/webchat.pm | |
| parent | 2860b03f00e48264ed15c132ad90b240ebe6070b (diff) | |
tagging ychat-perl-legacyychat-perl-legacy
Diffstat (limited to '0.7.6/modules/webchat.pm')
| -rw-r--r-- | 0.7.6/modules/webchat.pm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/0.7.6/modules/webchat.pm b/0.7.6/modules/webchat.pm new file mode 100644 index 0000000..90f8731 --- /dev/null +++ b/0.7.6/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; |
