Page 1 of 1

Getting content every few minutes

Posted: Mon Sep 13, 2010 11:38 am
by Fergo
Hello everyone,

It's my first post in here. Sorry if it's in the wrong section, but as I don't know how to do what I'm planning (if it's possible with PHP), I also don't know where to post it. :?

I'm involved in a project where I need to check the contents of a website every 10 minutes and, based on the results, update some entries on my database. By default, I would use the sleep function of PHP, but this process should happen constantly, not only when the page is accessed (it's kind of like a "background" program that would be always running in the server, checking data every 10min).
There is a website called http://www.changedetection.com that does that. It checks when a webpage has changed and notify you by e-mail.

Does anyone knows how to do that? Is it possible to do with PHP? Any documentation or article would help.

Thanks in advance,
Fergo

Re: Getting content every few minutes

Posted: Mon Sep 13, 2010 12:59 pm
by buckit
PHP is a scripting language. it only runs when someone/thing executes the script.

if the webserver is linux then you can create a CRON job to execute your PHP script every 10 minutes (or however often). in windows I believe it would be a scheduled task.

Hope this helps!