How Does It Work?
As you'll probably have noticed, there's a picture of me doing
whatever I'm doing at the moment in the middle of the page. So how does it get
there?
On my machine, I have a shell script running on a continuous loop. The first thing it does is to delete any existing local file generated from a previous running of the script.
Next, the scipt uses a program called camgrab to capture an image from the webcam, which is plugged into a
USB port in my computer.
Once the image is captured, a program from the Imagemagick suite called convert is used to resize the image, and add the timestamp.
After the timestamp is added, the script uses scp to login to the site's remote server and upload the file.
The image is then embedded in cam.html, using the standard <img> html tag. A <meta> tag is added to the head of the page, with the http-equiv parameter set to "refresh" and the value parameter set to "10". This refreshes the page every 10 seconds.
The page in which the image is embedded is displayed in an iframe in the center of the main page. And that's how it's done!