Edit: This worked on my old site, and doesn’t now, and I’ve not updated it, so you won’t see anything.
I decided to write a simple perl script that would tell people whether the webcam was on or not. It’s called webcam_status.cgi and for the benefit of anyone who’s interested and doesn’t know much about this stuff, here’s a bit about it.
Firstly, you have to know what the webcam software does here. It captures an image from the camera every X seconds, and then uploads it to a specified location on my server. (In my case this is here.)
All this program does is check the time that the webcam image file was last updated. I usually have mine set to update every minute. The program actually checks to see whether it was updated in the last 90 seconds, to be on the safe side, since it takes a little bit of time to upload each picture. If the last picture was uploaded than 90 seconds ago it assumes the camera’s now off.
Once it’s made the decision it outputs one of two images as appropriate. It could produce text that told you whether the thing was on or off, but I designed it to produce an image so that it could be used off-server – for instance, on my livejournal. To invoke it you merely put the URL of wherever you put the program as the src tag of an image, e.g.
<img src=”http://www.fridgemagnet.org.uk/ images/fridgecam/webcam_status.cgi”>
You could use this sort of program to monitor any type of file for updates, really.