Getting content every few minutes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Fergo
Forum Newbie
Posts: 1
Joined: Mon Sep 13, 2010 11:28 am

Getting content every few minutes

Post 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
buckit
Forum Contributor
Posts: 169
Joined: Fri Jan 01, 2010 10:21 am

Re: Getting content every few minutes

Post 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!
Post Reply