ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/misc/scripts/cgi/finger.cgi
Revision: 1.1
Committed: Fri Mar 9 00:22:30 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
CVS Tags: PROJECT_COMPLETION
Log Message:
CGI scripts used in various places around the project.

File Contents

# User Rev Content
1 tdb 1.1 #!/usr/local/bin/perl
2    
3     use CGI;
4    
5     $query = new CGI;
6     $user = $query->param('user');
7    
8     print "Content-type: text/html\n\n";
9    
10     print << "END";
11     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
12     <html><head><title>i-scream: .plans</title>
13     <style type=\"text/css\"><!--
14     BODY { margin: 0; font-family: Verdana; }
15     H1,H2,H3,H4 { font-family: Helvetica;
16     text-transform: lowercase; }
17     H2 { font-size: medium; }
18     A:link, A:active, A:visited { font-style: bold; }
19     A:active { background-color: #eeeeee; text-decoration: none; }
20     UL { list-style-image: url(\"/images/dot.gif\");}
21     TD { font-family: Verdana; }
22     A:hover { background-color : #eeeeff; }
23     --></style></head>
24    
25     <body bgcolor="#ffffff" link="#0000ff" alink="#3333cc" vlink="#3333cc" text="#000066" marginwidth=0 marginheight=0>
26    
27     <table width="100%" border="0" cellspacing="0" cellpadding="15"><tr>
28     <td width="140" valign="top">
29     END
30    
31     print `wget -O - -q http://www.i-scream.org.uk/left.inc`;
32    
33     print <<"END";
34     </td><td valign="top">
35    
36     <a href="http://www.i-scream.org.uk">
37     <img src="/i-scream.gif" alt="i-scream" border="0">
38     </a>
39    
40     <basefont face=\"Verdana,Helvetica,Arial\" size=\"3\">
41     END
42    
43     if($user eq "tdb1" || $user eq "pjm2" || $user eq "ajm4" || $user eq "ab11") {
44    
45     print "<h2>$user\@i-scream.org.uk</h2>\n";
46    
47     print "<PRE>\n";
48    
49     $urls = '(' . join ('|', qw{
50     http
51     telnet
52     gopher
53     file
54     wais
55     ftp
56     } )
57     . ')';
58    
59     $ltrs = '\w';
60     $gunk = '/#~:.?+=&%@!\-';
61     $punc = '.:?\-';
62     $any = "${ltrs}${gunk}${punc}";
63    
64     @lines = `finger -l $user\@plans.i-scream.org.uk`;
65     foreach $line (@lines) {
66     $line =~ s/(::.*::)/<h4>$1<\/h4>/ig;
67     $line =~ s/\b($urls:[$any]+?)(?=[$punc]*[^$any]|$)/<a href="$1">$1<\/a>/igox;
68     print $line;
69     }
70    
71     print "</PRE>\n";
72    
73     }
74     else {
75    
76     print << "END";
77     <p>
78     <table border="0" width="70%">
79     <tr>
80     <td width="100%">
81    
82     <table width="100%" border="0" cellspacing="0" cellpadding="15"><tr>
83     <td valign="top">
84    
85     <h2>.plans</h2>
86     <font size="2">
87     <p>The i-scream team might keep their .plans updated with something
88     interesting...<br> but I doubt it :-)</p></font>
89    
90     <table border="0" cellspacing="5" cellpadding="5">
91     <tr>
92     <td bgcolor="#EEEEFF"><b><font size="2">user</font></b></td>
93     <td bgcolor="#EEEEFF"><b><font size="2">finger</font></b></td>
94     <td bgcolor="#EEEEFF"><b><font size="2">e-mail</font></b></td>
95     </tr>
96     <tr>
97     <td><font size="2">ash beeson</font></td>
98     <td><a href="http://raptor.ukc.ac.uk/~tdb1/cgi-bin/finger.cgi?user=ab11"><font size="2">ab11\@plans.i-scream.org.uk</font></a></td>
99     <td><a href="mailto:ash\@i-scream.org.uk"><font size="2">ash\@i-scream.org.uk</font></a></td>
100     </tr>
101     <tr>
102     <td><font size="2">tim bishop</font></td>
103     <td><a href="http://raptor.ukc.ac.uk/~tdb1/cgi-bin/finger.cgi?user=tdb1"><font size="2">tdb1\@plans.i-scream.org.uk</font></a></td>
104     <td><a href="mailto:tim\@i-scream.org.uk"><font size="2">tim\@i-scream.org.uk</font></a></td>
105     </tr>
106     <tr>
107     <td><font size="2">aj moore</font></td>
108     <td><a href="http://raptor.ukc.ac.uk/~tdb1/cgi-bin/finger.cgi?user=ajm4"><font size="2">ajm4\@plans.i-scream.org.uk</font></a></td>
109     <td><a href="mailto:aj\@i-scream.org.uk"><font size="2">aj\@i-scream.org.uk</font></a></td>
110     </tr>
111     <tr>
112     <td><font size="2">paul mutton</font></td>
113     <td><a href="http://raptor.ukc.ac.uk/~tdb1/cgi-bin/finger.cgi?user=pjm2"><font size="2">pjm2\@plans.i-scream.org.uk</font></a></td>
114     <td><a href="mailto:paul\@i-scream.org.uk"><font size="2">paul\@i-scream.org.uk</font></a></td>
115     </tr>
116     </table>
117    
118     </td></tr></table></td>
119     </tr>
120     </table>
121    
122     END
123    
124     }
125    
126     print "</font></td></tr></table></body></html>\n";
127    
128     exit 0;