#! /usr/local/bin/perl
# Time-stamp: "2005-08-19 01:57:08 ADT" sburke@cpan.org
#
# desc{ build an index of all accounts with web pages on this host }
#
# sburke@cpan.org (c) 1995 Sean Michael Burke
# Released under the GNU Public License, blah blah blah
# Tue Jun 13 22:21:10 PDT 1995
# first written
# Wed Nov 1 05:22:06 CST 1995
# altered to send to stdout
# Recommended usage:
# walker.pl > foo.html
# or walker.pl | mail sburke@cpan.org
#
$host= "www.ling.nwu.edu";
# Set this to be the WWW alias name of your web server
print ("
\n");
print ("Index of pages on $host\n");
print ("Index of pages at $host
\n");
setpwent; # we're gonna start scanning the user log!
while (@list = getpwent) { # get the next entry
($acct,$personalname,$home) = @list[0,6,7];
# the account name, personal name, and the home dir
if (-e ($home . "/public_html" ) ) {
#better get ready to use their personal name-- isolate and HTMLify it
$personalname =~ s/,.*// ;
$personalname =~ s/\&/&/ ;
$personalname =~ s/\</ ;
$personalname =~ s/\>/ ;
$personalname =~ s/(^$)|(^ticket \d+$)/(none)/ ;
# if their name is blank, or is
#"ticket [number], say 'none'
print ("
$personalname: ");
print ("");
print ("http://$host/~$acct/");
print ("
\n");
}
}
endpwent; # all done
print ("
Autogenerated on " . `date '+%D' `);
print ("\n");
1; #we done. byebye.