How it is doneThe following describes how I obtain the images, and display them both as a current image, and as a collection of images in a slide show.
First the Source
The source of the webcam images is from Phoenix Visibility Website. They provide a page which displays the 5 webcam images that you see. Their primary purpose is to show visibility around the Phoenix Metro Region.
Obtaining the Images
To obtain the images, I use two tools.
I use a simple Perl script to identify which image locations that I want and to use wget to obtain them.
The script has a subroutine which when called with each filename, goes and fetches the image, compares the new image against the current one, and if the date of the file is newer, replaces the current image and stores a history image in a directory in the format of: 201002092351.camera_name.jpg
If the image is updated and a history image save, a clean directory function is run to remove any images that exceed 72 (we keep the last 72).
This is a simple but very powerful utility that allows you to get remote web objects and store them on your server.
All, wget usages we do are identified as:
This lets the source site know who is making these connections and provides a link to what we are and why we are doing what we are doing.
Displaying the Image via Lytebox
Next is the web page itself which is setup using Lytebox's Lyteframe function. This points to the current image for the image to display on the page, and a URL which points at a PHP source file that outputs the PHP/SWF Slideshow of the collected historical images.
You see the slide show pop up when you click on the image.
We are using hacked up version some code based on a website A better simple slideshow, by Mark Lee which is a wonderful set of scripts.