Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Real-Time Web-Chat with Perl

by true (Pilgrim)
on Oct 27, 2002 at 20:33 UTC ( #208378=note: print w/replies, xml ) Need Help??


in reply to Real-Time Web-Chat with Perl

Here's another suggestion for you. This only works with javascript ON. Have your html page load a image. Set the img's src to a perl script you write. Add a onLoad javascript tag.
<html><title>page.html</title> <img src="http://www.myperlscripturl.cgi"> <body onLoad="window.location(page.html');"> </html>
Have the perl script open an image on your server and spit it out. Before the image-serving perl script dies, put it in a sleeped loop. Every loop the perl script checks your chat log file. When the chat log file has a new modification date, exit the perl script.
Upon exiting the loop, the javascript will now complete it's body onLoad function. This will give you a chat like webpage which will only refresh the html page when new live content is put on the server.
- Hope this helps.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://208378]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2022-11-30 04:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?