6 use Data::Dump qw(dump);
10 my $cvar = AnyEvent->condvar;
12 my $httpd = AnyEvent::HTTPD->new (port => 19090);
16 my ($httpd, $req) = @_;
19 <html><body><h1>Presence</h1>
22 my $redis = Redis->new;
24 my @accounts = $redis->keys( 'presence/*' );
26 warn "# accounts ",dump @accounts;
27 foreach my $who ( @accounts ) {
28 $body .= qq{<h2>$who</h2>\n<ul>\n};
29 my $members = $redis->smembers( $who );
30 warn "# members ",dump $members;
31 $body .= join("\n", map { "<li>$_" } @$members);
39 $req->respond ({ content => ['text/html', $body]});
43 my ($httpd, $req) = @_;
46 $req->respond ({ content => ['text/html', <<'CONT']});
47 <html><body><h1>Test page</h1>
48 <a href="/">Back to the main page</a>