Re: Check for page change efficiently [was Re: Creating a blogrolling/link management system]
| From: | Kevin Stone | Date: | Wed, 08 Oct 2003 20:08:32 +0000 |
| Subject: | Re: Check for page change efficiently [was Re: Creating a blogrolling/link management system] | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165514@lists.php.net to get a copy of this message | ||
"Chris" <chrisl_ak@hotmail.com> wrote in message news:Xns940E6CFE87B41chrislak@216.92.131.4...
> newsgroups@meosource.com (Paul Van Schayck) wrote in
> news:Xns940ED22CFACB0newsgroupsmeosource@216.92.131.4:
>
> > First of all you need to check with the website you are going to check
> > if they really enjoy all bandwith required. And people will not see
> > their banners anymore.
>
> I'm not sure I understand-- I want to check to see if their page has
> changed once each day and, if so, I will highlight that link in my list...
> I doubt most web sites would have a problem with one hit per day :)
>
> I am not scraping and redisplaying content...
>
> My question boils down to the most efficient method to detect whether a
> page has been modified recently...
Chris,
This is just a thought.. I have never employed this method personally.. but I suppose you could read
the page into a string and use the md5() function to generate a hexidecimal value based on that
string. Store the hex value in a database and compare it against the new value generated the next
day. If anything on the page has been modified the values should not match. Even the most minute
change should trigger a new value. Obviously you won't know *what* has been modified only that
the page *has* been modified
There are some pitfalls to keep in mind such as if the page contains dynamic content, if there is a
server error, or if the page has been removed. Thanks to Network Solutions evil Sitefinder you may
find it difficult if not impossible to predict what will be read by your script if the page goes
missing. But this will all show up in the hex value and you won't know if the page is still
relevant until you personally visit the links.
http://www.php.net/manual/en/function.md5.php
Good luck,
Kevin