[Gllug] More MySQL and scripts

Jason Clifford jason at ukpost.com
Wed Sep 25 07:35:14 UTC 2002


On Wed, 25 Sep 2002, Xander D Harkness wrote:

> Runs along the lines of "Yahoo calendar emails me when I am supposed to 
> be somewhere, can this one?"
> 
> The mysqldump presents the data like this:
> 
> INSERT INTO kronolith_events VALUES (1,'xander','this is a test 
> meeting','London','','','Xander 
> test','Hello','0',NULL,NULL,NULL,'2002-09-23 08:00:00','2002-09-26 
> 09:00:00',0,1032798842);
> 
> The data is structured such that it would be possible to extract events 
> occuring tomorrow, get the user and email them.
> 
> Would those in the know dump the data and parse it or write a script 
> that queries the database and takes the data from there?

Absolutely not. The data contains convenient date and username fields so 
you can write the script to either select all events for a given date and 
then produce a report for each user and email it to them or you can have 
it run on an individual user basis.

The script should be fairly easy to write and then you just run it from 
cron.

> My concern is that with a couple of hundred users it might generate a 
> lot of data. 

Would all of them want it? If not then do it on a per user basis. Perhaps 
you could add some kind on indicator on a web page to allow them to select 
the option.

> I would also be looking to release the script back to the 
> horde project should anyone else find it useful and it would be good to 
> do it 'correctly'.

While horde is PHP based your script does not have to be as it will be run 
separately from cron.

I'd say choose the language you are happiest with (I'd go for perl but any 
language will do) and write it in that. Simply make sure that you are 
verifying your data inputs, etc and it should be correct enough.

Jason Clifford
-- 
UKPOST.COM	 	           get your @ukpost.com address now...
http://www.ukpost.com/	 	   professional hosting and colocation


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list