This would have to be initiated from the client-side, so it's
more in the realm of Javascript (or perhaps Flash or a Java
applet), I would think.
Once the page/images are downloaded, the server has nothing
else to do until the client asks it for something else.
Of course, if you were using Javascript to request new images from the server, you could surely use a Perl script on the
server-side to send it a random image. At the
NMS project
you could find one such script, ready to go.
- Matt Riffle | [reply] |
| [reply] |
I'm not entirely sure what you are doing.
I would go to various "live webcam" sites and look at their source code.
Most of them do it with the html "refresh" command.
<html><head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<meta HTTP-EQUIV="Refresh" CONTENT="100">
That refreshes the page every 100 seconds. The problem is I'm not
sure every browser supports it. Works good on Mozilla.
Then just have the perl script change your images as needed, and
the browsers will get them every 100 seconds.
Maybe you could combine the "refresh" with a java slideshow script.
Like the one here Java Slideshow
| [reply] |
I like Randal's example but I think that's a different problem. He's building a LWP-based browser-like Perl script to go pull just images. That's different than enabling a page in a given browser to refresh its images automagically.
The way I've done this is with JavaScript and timers. There's an example of that here. Probably lots of others ... I'm at best a mediocre JavaScript hacker so I usually just snarf up someone else's examples as starting points. They're all over the web. Just make sure you try it out on different browsers since JavaScript and other dynamic HTML is notoriously browser specific.
The page refresh technique mentioned also works but it's not as slick since the whole page gets refreshed. As much as I dislike JavaScript it does make this sort of thing (just updating the image) look pretty nice. A site I worked on does that on mouse scroll-overs with a pretty nice resulting effect.
| [reply] |