From Neil Williams@1:2320/100 to All on Thu Aug 30 12:29:02 2001
I have a pet ARexx project I'm working on. To liven the echo up, I'm going to share the progress with you :)
Every time my computer dials the Internet, one of the things it does it grab some webcam images from the accommodation site I stay at in University (http://www.welcomebangor.co.uk/). One is a view of a road leading into part of
the site, and the other is above the bar in the site's pub. This is reasonably
easy to do, even with simple dupe checking:
(Excuse the stupidly long repeated paths - I haven't cleaned the code up yet. In your own scripts, "call pragma 'Directory','Disk:ImageDir'" would help as would variables)
/* First, store Bar image
ft = 'Bar.'|| date(S)
fn = 'Bar.'|| date(S) ||'.0'
do while exists( 'Work:Graphics/Pics/Cams/Ffridd/'||fn||'.jpg' )
if word( statef( 'Work:Graphics/Pics/Cams/Ffridd/'||fn||'.jpg' ), 2 ) = barsize then do
say '* Duplicate picture'
fn = ft || '.' || n
if newpic = 1 then do
address command 'Copy work:graphics/pics/Cams/Ffridd/bar.tmp to Work:Graphics/Pics/Cams/Ffridd/'|| fn ||'.jpg CLONE'
(Etc. for road picture).
HTTPresume is a really useful program - it's got an excellent command line interface :)
The script grabs at least one image every day. In each day, we compare the size
of files we have - if two JPEGs of the same scene are the same size, they are almost certain to be the same image (out of term time, the cams aren't updated very often). I haven't worked out an easy way to compare against the images of the previous days yet.
The result is something like this. I have two unique images from yesterday, but
this webcam hasn't been updated yet today.
So far, so good! Every thing works automatically without problems. During term time, the problem of not having duplicate checking over more than one day shouldn't be a problem.
The next steps in this are:
* Move the webcam code out of my mail poll script, and instead have it launched seperately when I go online. The new script would do this:
delay 1 minute
Why? The bar webcam should be updated live when the pub is open, and I'll have my computer dial up between 10pm and 11pm or some such times.
* Build a website from the images automatically. My BBS computer is at home, I'll be in uni, and there's little point grabbing these images if I'm not going
to do something interesting with them :)
This is the most complex part of the task. The ARexx script must be able to build a website (a "site" not just "webpage") on its own, correctly presenting ordered tables of images, perhaps a week on a page, and an index to these subpages. It's also got to upload these files by FTP.
To Be Continued!
[On a political note, there had better be ARexx in OS4+.]