Re: who -> html question

From: Erwin S. Andreasen (erwin@ANDREASEN.COM)
Date: 06/20/98


On Fri, 19 Jun 1998, Jesse Scott wrote:

> I'd like to add a who -> html system but the problem is that the mud
> webpage isn't on the mud server, in fact there is no httpd at all on the
> mud server, what I have to do is have circle run a script or something
> that would upload the new who page to my FTP account.  My question is
> how I would write the script that would do the uploading, is there an
> easy was to control and FTP transfer from a script?  I also want to make
> sure that the MUD doesn't wait for the script to finish before going on

You can do it using ftp, e.g.:

ftp hostname <<EOF
cd /somewhere
put file.html
quit
EOF

AFAIR you *cannot* supply a password via this kind of redirection (the
<<EOF will read commands from the following linkes until the EOF mark
(literally EOF)) - but you have to use the .netrc file (see the ftp man
page).

Or you can use rcp if you have .rhosts setup on the other machine to trust
the first machine.


Rather than having MUD send this, just use a cronjob to run this every 5
minutes or so.

However, a far better solution is to integrate a http server into your
server. It is fairly easy to write (and an example can be found at
http://darkoth.mudservices.com somewhere, look for an 'integrated
webserver'

There is very little overhead involved. You simply listen on another
socket - when a connection comes in, you wait until you get a GET /URL
HTTP/X.X request (if you want the precise line, look in the RFC :). If you
want to be more advanced, wait for an empty line, and save previous lines
(there will be headers that might be useful).

Then you simple send back the HTML you want to send.. and you're done!

Thus you can generate a WHO-list in real time (see
http://www.abandoned.org:4448/who).

Now once you HAVE a webserver in your MUD, ah! The possibilities are
endless.

Some things my does that might be interesting:

help file access, /help/X displays everything starting with X, /help/file
displays help 'file' (see http://www.abandoned.org:4448/help).

autohyperlinks: in help files, I always surround references to other files
with yellow (&y). Thus something like: Also see &yHELP QUIT&* will be
automagically converted to a hyperlink pointing to /help/quit.

True http authenthication: if a page has a minimum level on it, the
standard http authentication procedure is initiated, using the player's
account name/password. This allows for remote controlling the MUD in
various ways.

Automatic parsing of variables - if you do something like
http://somewhere?var1=value&var2=value, the function that gets called that
is supposed to handle that /somewhere URL gets the two parsed and passed
in a list of variable name/value pairs.



POST support. And this gives support for a web editor: You start editing
some string in your normal editor on the MUD, then go to
http://www.abandoned.org:4448/webedit. The string shows up in a <TEXTAREA>
there, and you can edit it and submit it when done. I was planning on
allowing people to edit descriptions, rp sheets etc. via it, but then
found out that just doing a generic webedit was easier :)


Viewing notes, mobs, rooms etc. - I never got far with that, it's not that
very useful. Maybe writing notes would be useful, but for that, I have the
integrate NNTP sever... :)

Viewing of other things which are more useful - the online changelog
(http://www.abandoned.org:4448/cl), wizlist, player list (players that
have set a homepage with the HOMEPAGE command)




 =============================================================================
<erwin@andreasen.com>      Herlev, Denmark              UNIX System Programmer
<URL:http://www.abandoned.org/drylock/>     <*>         (not speaking for) DDE
 =============================================================================


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST