[kronolith] adict and scheduling

Tim Terlegård timte878@student.liu.se
Fri, 30 Aug 2002 20:19:29 +0200


Howdy!

I now know how the adict format works. If you want you can
take a look at:
http://www.sslug.dk/adict/import.php?show_source=1
http://www.sslug.dk/adict/import.php

What I need is to incapsulate this into a Data_adict class,
which should be easy.

Then we come to the scheduler issue. Chuck, did you
think about it further? Until there is a scheduler I guess
I could use cron for this. Can you run file.php as a script
without having php compiled as CGI? I remember Chuck
mentioning about php's command line handling now is
better, what did he/you mean? Cron could run the file.php by
* * * * * lynx -dump http://mysite.org/kronolith-scheduler.php
but that would require the site being accessible by anyone,
right? Then it'd be easy to DoS the site.

What's the best way to do this? What I want is to have
the database updated every 15th minute with the adict-calender
found on some website. Pseudocode could be like:

$file = HTTP::Get("http://somesite.org/events.adict");
$Data_adict::importFile($file);

Should the HTTP Get be performed by Data_adict or by
the script calling Data_adict::importFile() ? Something that'd
be cool would be a URI class with which you can do
URI.getFile(); Then you'd do

$URI uri = new URI("http://somesite.org/events.adict");
$Data_adict::importFile(uri);

But that's just a thought. Might be more work than it's worth.
But what's the best way to do the scheduling at this moment?

-- Tim