#!/usr/bin/perl
print "Content-type: text/html\n\n";
open(P, '< /usr/local/share/www/rsl/roster.txt');
while () {
if ($_ eq '') {next;}
$l = $_;
chomp($l);
if ($l =~ /^#/) {
if ($l =~ /Faculty/) {print '
| Faculty |
';}
if ($l =~ /Scientific Staff/) {print '| Scientific Staff |
';}
if ($l =~ /Postdoctoral Fellows/) {print '| Postdoctoral Fellows |
';}
if ($l =~ /Graduate Students/) {print '| » More information about RSL Postdoctoral Fellows |
',
'| Graduate Students |
';}
if ($l =~ /Administrative Staff/) {print '| » More information about RSL Graduate Students |
',
'| Administrative Staff |
';}
} else {
($name, $phone, $office, $email, $url) = trim_wsp(split(/\s*\|/, $l));
#if ($email ne "\@stanford.edu")
#{
$email = encode_email($email);
#{
($url, $url2) = trim_wsp(split(/\+/, $url));
if ($url =~ /\w+/) {
$url =~ s|/|http://rsl.stanford.edu/|;
$url =~ s|/|http://www.stanford.edu/people/|;
$url =~ s|/|https://www.stanford.edu/|;
$url =~ s|/|http://med.stanford.edu/profiles/|;
$url =~ s||http://plevritis.stanford.edu/|;
$website = "» web site";
} else {
$website = ' ';
}
if ($url2 =~ /\w+/) {
$url2 =~ s|/|http://rsl.stanford.edu/|;
$url2 =~ s|/|http://www.stanford.edu/people/|;
$url2 =~ s|/|http://med.stanford.edu/profiles/|;
$website2 = "» CAP web site";
} else {
$website2 = ' ';
}
$website = "$website $website2";
if ($name ne '') {
#if ($email ne "\@stanford.edu")
if ($email ne "@<\/i>stanford.<\/i>edu")
{
print "| $name | $phone | $office | $email | $website |
\n";
}
else
{
print "| $name | $phone | $office | $email | $website |
\n";
}
}
}
}
close(P);
#
# subroutines
#
sub trim_wsp {
my ($w, @x);
for $w (@_) {
$w =~ s/^\s*//;
push(@x, $w);
}
return @x;
}
sub encode_email {
$_[0] =~ s/a/a/g;
$_[0] =~ s/b/b/g;
$_[0] =~ s/c/c/g;
$_[0] =~ s/d/d/g;
$_[0] =~ s/e/e/g;
$_[0] =~ s/f/f/g;
$_[0] =~ s/g/g/g;
$_[0] =~ s/h/h/g;
$_[0] =~ s/i/i/g;
$_[0] =~ s/j/j/g;
$_[0] =~ s/k/k/g;
$_[0] =~ s/l/l/g;
$_[0] =~ s/m/m/g;
$_[0] =~ s/n/n/g;
$_[0] =~ s/o/o/g;
$_[0] =~ s/p/p/g;
$_[0] =~ s/q/q/g;
$_[0] =~ s/r/r/g;
$_[0] =~ s/s/s/g;
$_[0] =~ s/t/t/g;
$_[0] =~ s/u/u/g;
$_[0] =~ s/v/v/g;
$_[0] =~ s/w/w/g;
$_[0] =~ s/x/x/g;
$_[0] =~ s/y/y/g;
$_[0] =~ s/z/z/g;
$_[0] =~ s/\@/@<\/i>/g;
$_[0] =~ s/\./.<\/i>/g;
return($_[0]);
}
