Could you give me some hints for a schedule program?
We don't have enough time to experiment much.
For a Windows environment, three options come to mind:
-
You could use the Windows Task Scheduler; through the
dialog Advanced Settings, you can set a schedule to
x times an hour. Within Windows 2000 this
functionality is available through the Control Panel,
with Windows NT you might have a folder named Tasks
under the WinNT folder with the same behavior
(probably depends on the Service Pack level).
-
With VBScript 5 (Windows Scripting Host 2.0) you
build a script that uses an infinite loop and pauses
with
WScript.Sleep milliseconds. Since the
argument is an Integer, you must repeat this command
several times to achieve a pause of 15 minutes.
Note, however, that the
Sleep method
uses no processor time.
When activated through cscript.exe, it's
possible to stop the script with Ctrl+Break.
To get a more interactive program, you could use
a semaphore file to trigger the deactivation of
the script:
tbxdsr.vbs /start-
Checks for the existence of the
semaphore. If present: break off
execution and display an error message
stating: "Already active".
-
Create empty semaphore file.
-
Begin infintie loop, with pause; every
iteration you should check for existence
of the semaphore, and if it is no
longer present: abort
tbxdsr.vbs /stop-
Checks for the presence of the semaphore file,
and deletes it (if present).
If you start these scripts through a shortcut, with
wscript.exe, no command line will be
shown.
With a little tweaking, you could even use the
semaphore file to indicate the status of the
requestor (e.g., /status says "Retrieving" or
"Sleeping"). You could also use a registry key
instead of a file.
-
Visual Basic contains a simple Timer control. If you
create a simple Form with the Timer control (since the
timer control suffers the same limitations as the
WScript.Sleep
method, you'll need to count the number of timer
events), and a simple on/off button. You could then
start the program/script every (legal) timer event.
Given some time, you can incorporate the functionality
of the parser in this program as well.
For other operating systems, there exist similar options.