I'd get it working on a .php page and you can debug and get it working when you access the page directly. Once you have that working just google how to set up a CRON job to run a PHP page and it should be a simple one liner. Some servers have slightly different syntax, but your hosting support can always help if push comes to shove. It is a common enough task that you should be able to find the answer online.