[comp.sys.ti.explorer] neat hack!

jwz@teak.berkeley.edu (Jamie Zawinski) (11/30/89)

I've been hacking on the Finger daemon some; the results are in
/usr/jwz/public/finger.lisp on spice.cs.cmu.edu.  (*)

Fingering "<userid>@some-explorer" will print a bunch of information about
the given user; this info is gleaned from the :USER class of the namespace.
If <userid> is not the ID of someone, then a guess is made, based on a
phonetic interpretation of the given ID and the user IDs and real names of
the people in the namespace.  If only one user ID matches this, then info is
printed for that user as usual; if more than one match is found, then a list
of the possible matches is printed, so the fingerer can try again.  The
<userid> is matched against the user IDs, and the first and last names; if
it contains a period, it is interpreted as a firstname/lastname pair, and
compared against both.  For example:

 (finger "jaime.zuhwinsky") ==>  jwz (Jamie Zawinski)
  because "jaime" matches "Jamie", and "zuhwinsky" matches "Zawinski"
 (finger "peter")	    ==>  "norvig (Peter Norvig)" and "gator (John Doe)"
  because "peter" matches both "Peter" (a first name) and "gator" (a user ID).

(The phonetic matching stuff is based on some code I got from David Forster
a long time ago... thanks, David!)

Fingering "/W@some-explorer" will print a bunch of information about the
currently logged in user; same as fingering "@machine" followed by something
more specific.

If there exists a file called "fingered-explorer: <userid>; plan.text#>",
this file will be printed after the automatically-generated user info.  It
is possible to override the location of this file by adding a :PLAN-FILE
attribute to the :USER class of the namespace; that way, you can have your
plan file on one machine, but have all the Explorers know where to look for
it.

If the variable NET:*NOTIFY-WHEN-FINGERED* is set to T, then a notification
will be sent whenever someone fingers the logged in user; this will enable
you to gauge your popularity.

If the variable NET:*FINGER-HOOK* is non-nil, it is a user-supplied function
which will be called before anything is printed, so you can have, in effect,
a ``dynamic plan file''; you could, for example, print a different Zippy
quote each time you are fingered.  The possibilities are unlimited...

Happy hacking,

			-- Jamie


	* as usual: spice.cs.cmu.edu = 128.2.254.139, anonymous FTP.
	  Grab the file /usr/jwz/public/_readme.text for a catalog.
	  And send me your code.