launching parser script once in 24 hours
If you don't want your script to execute on each page load, you have to set up a cron job, either via hook_cron() or a separate job.

To make a variable available in a template file, you have to use a preprocess function of some sort.

With these two elements, you should be able to make your script work and be integrated with Drupal.