
July 21st, 2008, 06:55 PM
|
|
Me
|
|
Join Date: Apr 2007
Location: Seattle, WA
Posts: 1,937

Time spent in forums: 1 Week 5 Days 1 h 54 m 18 sec
Reputation Power: 4
|
|
|
if you wanted to make it automated then it would depend on your server. in linux you would have to use cron and in windows you can get wincron or use windows task scheduler. You would need to write a command line script (just make a php page that doesn't output anything to the screen and you'll be ok) and run that with the scheduler every hour.
If you don't have access to a scheduler, then you would have to be a little more creative. I made a script once that would update stats every 10 minutes. Every time a user would load the script it would take the current time and round that to the nearest 10 minute increment and check if a cache file existed for that time. If so, read the cache file, if not it would connect and download the most recent stats. I was lucky in that if no one visited for like an hour, I didn't need to get that information between visits so no cache existed or was needed, it would just load the new file for the next visitor and the cache existed for everyone after that for the next 10 minutes. Its more of a expiring cache than a scheduled run.
|