/[metastatus]/trunk/metastatus.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/metastatus.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations)
Wed Jul 14 17:24:49 2004 UTC (19 years, 9 months ago) by dpavlin
File size: 740 byte(s)
Now server generates popup test, give Tony Chang proper credits (but,
since this extension has new uuid, I listed him as contributor)

1 #!/usr/bin/suidperl -wT
2
3 # if you are running under suexec Apache you might want to change
4 # interpreter to just /usr/bin/perl !
5
6 use strict;
7 use Email::Folder;
8
9 sub count($) {
10 my $folder = shift;
11
12 my $dir="/home/dpavlin/Mail/$folder/new";
13 return 0 if (! -d $dir);
14
15 opendir(DIR, $dir);
16 my @msgs = grep { -f "$dir/$_" } readdir(DIR);
17 closedir(DIR);
18
19 return scalar @msgs;
20 }
21
22 my ($inbox,$private) = (count('INBOX'), count('dpavlin'));
23
24 my $status = "time: ".scalar localtime;
25 my $popup = qq{dpavlin/inbox: $private/$inbox};
26
27 print qq{Content-type: text/xml
28
29 <meta>
30 <user name="dpavlin">
31 <emailRedCount>$private</emailRedCount>
32 <emailCount>$inbox</emailCount>
33 <status>$status</status>
34 <popup>$popup</popup>
35 </user>
36 </meta>
37 };
38

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26