[REBOL] Re: Chat / IM
From: ryanc:iesco-dms at: 18-May-2001 13:43
Here is my 15 minute implementation--I couldnt resist. Directory driven, needs a cleanup
routine to delete users after a period of inactivity or if they say
bye. Other than that, seems to work. At least it gives you something you can out do
;0 ) --Ryan
rebol[]
cgi: make object! decode-cgi system/options/cgi/query-string
change-dir %msg ; this is where the messages are stored
if in cgi 'user [
if not exists? to-file dirize cgi/user [ make-dir to-file cgi/user ]
]
if all [ in cgi 'say in cgi 'user ] [
foreach folder read %./ [
write to-file rejoin [folder cgi/user] cgi/say
]
]
change-dir to-file dirize cgi/user ; go into where this users messages are stored
prin "Content-type: text/html^(0A)^(0A)"
foreach msg read %./ [
from: to-string msg
print rejoin [ from {: } mold read msg ]
delete msg
]