New Lottery Website in the works...

21:56.08 - Monday 1st August 2005   (Link to This Entry)


After completing my Lottery Results scraper I altered it to email the scrapings directly to me and plugged it into the server using cron. Every six hours I receive an email containing the current Lotto results, which is nice. The next logical step is to get this script to populate a database for me, giving me an up-to-date list of Lottery results. Of course I may need to fire it off every hour during the evening for a faster update (since it currently only updates at midnight) but that's not a problem.

I downloaded the CSV files from the official site and set to work - creating what I hope will be an open-ended system for managing the various games. There are currently no limits on the number of regular or bonus balls a game can have since each game has its own table references by a master list. The biggest part of tonight's festivities was getting the results from my text files into the MySQL database I had created - thanks to the wonders of PHP, it's all done now.

Ideally I want to get the updating script done before midnight so that I don't miss any draws. This isn't a huge deal, but it would be nice to have everything automated.

Update:
I've reached the point now where the site could infact update itself, but I haven't taken the plunge as yet because I want to keep an eye on things myself before I entrust it all to the server. For now, the site does everything up to and including generating the SQL that will insert the new records, but instead of running them they are emailed to me. I've also set the script to run hourly, but to only actually do something if date("H")>=20 - in other words between 8pm and midnight.

The other major thing I need to do before anything goes live is perform a boundary check of the data - making sure that all values are within specified ranges for example. I can't be bothered to do this just now, however.


[ 0 comments pending ]