I-Spy Mode of Operation

I-Spy does not boast an elaborate interface; as a tool designed to run periodically and behind the scenes, I do not feel one is necessary. This opinion is further strengthened by the fact that are no free or cheaply accessible interface builders for AppleScript. I-Spy notices two avenues of communication: It learns its working directory from a folder dragged and dropped on its Finder icon, and the rest from the text files inside that working directory. Some of these text files are organised by folders (whereby each folder consitutes an FTP site under observation) while the rest of the files reside at the main level of the working directory and contain general information applicable to all sites. Such an arrangement is akin to the Unix world whereby programs communicate by in-line arguments (MacOS: dragging and dropping in the Finder) and by text files containing settings, aliases, and other such information. Lacking an interface, I-Spy communicates back to the user via its results and a log of activity.

Oh, I did break down and incorporated an optional progress bar display into I-Spy. However, the communication here is strictly one way -- to the user. About the only way to communicate with the script while it is running is to interrupt its operation via the familiar Command-. from the keyboard.


Working directory

The working directory is a collection of required and optional text files and folders:

Transport [required]

Contains the transport protocol indentifier as its only line. Currently, HTML and FTP are the two recognised key words.

HTML header [optional]

HTML footer [optional]
HTML errors [optional]
HTML log [optional]
Contain formatting chunks of the HTML file constructed by the script. These are certainly not necessary should you choose the FTP transport. They are also not mandatory for the HTML transport, but will definitely assure a better looking HTML page. These files also provide an avenue to customise the look of the created page.

New_files.html [created]

Will contain the list of new items discovered on sites under observation. In case of the FTP transport, this file will contain just a list of URLs. Whereas in the case of the HTML transport, it will contain human readable information with new item URLs segregated by site, and a section listing execution errors, and a link to the most recent activity log, as in this example.

Site folder(s) [optional]

Of course these are optional, but you should have at least one to get any use out of I-Spy. The script will iterate through the working directory, looking for folders that may contain site-specific information. Currently, I-Spy will bypass a folder if its name starts with a tilde (~). Each Site folder contains all the site specific data and temporary files:

Data [required]

Contains the URL pointing to the FTP site (and specific directory) that you wish to monitor. I-Spy will also look for an optional second URL that may point to a pre-fabricated directory dump (e.g., Info-Mac's all-files.txt or Apple's NEWFILES). If you do use a pre-fab directory dump, make sure that your first listed URL is an appropriate root for the files listed.

List filter.pl [optional]

Contains the Perl filter script that I-Spy applies to a list of new items.

Filters [optional]

Contains the filters I-Spy applies as it compiles a list of new files. If this file is missing, I-Spy will create a blank place-holder.

Lines added [created]

Lines removed [created]
Lines retained [created]
Snapshot [created]
Old snapshot [created]
Scratch [created]
Will contain intermediate file lists as I-Spy first obtains and then compares and filters the file lists.

Note: An example working directory folder is provided with the I-Spy distribution as Sample sites in the Documentation folder.

Activity Log

I-Spy is rather verbose about what it does, and it dumps all these messages into a log file that it creates for each execution. By default, I-Spy will look for a Logs folder inside your System Folder. If it cannot find this folder, it will create one. As I-Spy stores its reference to the Logs folder as an alias, you may subsequently move or rename this folder, and I-Spy should track these changes. The activity log is your best tool in figuring out what is going on, especially if there are problems. You may also look at the log while the script is executing, provided that your text editor or viewer does not lock the file or flag it as busy. Here's an example activity log...

Filters

I-Spy supports two optional tiers of filters:

Perl script

After obtaining a new list of files and comparing it against the previous snapshot, I-Spy generates three lists: New lines, old lines, and same lines. If I-Spy finds a filter script, it will now invoke it and pass the list of new lines as the target. I intend the filter script to cull non-file lines from the list of new files. For example, a filter script may check each line and only retain those that contain information about a link, a file, or a directory.

Filters file

As I-Spy gathers items from the Lines added files, it will apply another set of filters if such are in the Filters file. An optional first line in this file may indicate whether items matching the filters should be kept or removed. Currently, I-Spy supports only one type of filters per file: Drop (#-) or keep (#+). If the filter type tag line is missing, filters are assumed to be drop filters (i.e., matching items are removed while non-matching items are kept. For instance, one may wish to only keep files with a .txt suffix or ignore .zip and .bin files.


Return to the table of contents.
ISL [12/29/95]