From: Erik Niese-Petersen Subject: Re: [Circle] who2html On Mon, 5 Aug 1996, Cyber Reaper wrote: > before I make it has anyone made an snippet to port who to a HTML file so > that people at your web page can see who is on at the moment. if not could I > get a few pointers. first where would I put it so that it is updated say... > once every 30 seconds, second, what command is used to write to an ansii > file? I know the command to read, but not write. thank you. Here is a fast example.. Not sorted. Show mortals and all immortal who are not invis.. [NOT tested! So typos and other bugs.. Blame me.. :) But it give you an idea] void make_who2html(void) { extern struct descriptor_data *descriptor_list; FILE *opf; struct descriptor_data *d; struct char_data *ch; if ((opf = fopen("~/public_html/who_on_mud.tmp", "w")) == 0) return; /* or log it ? *shrug* */ fprintf(opf, "Who is on the MUD?\n"); fprintf(opf, "

Who play right now?


\n"); for(d = descriptor_list; d; d = d->next) if(!d->connected) { if(d->original) ch = d->original; else if (!(ch = d->character) continue; if(GET_LEVEL(ch) < LVL_IMMORT || (GET_LEVEL(ch)>=LVL_IMMORT && !GET_INVIS_LEV(ch))) { sprintf(buf, "[%2d %s] %s %s\n", GET_LEVEL(ch), GET_ABBR(ch), GET_NAME(ch), GET_TITLE(ch)); fprintf(opf, buf); } } fprintf(opf, "
\n"); fclose(opf); system("mv ~/public_html/who_on_mud.tmp ~/public_html/who_on_mud.html &"); } Hope it helps.