FishSword Posted June 18, 2011 Share Posted June 18, 2011 Hiya, Is it possible to check and log website content changes, using PHP? If any changes are found, then an alert should be shown. Many Thanks, FishSword Quote Link to comment https://forums.phpfreaks.com/topic/239730-check-website-for-change/ Share on other sites More sharing options...
redixx Posted June 18, 2011 Share Posted June 18, 2011 You can scrape the page with file_get_contents or cURL. It will most likely take some complicated regex to get only the content you want, though. Quote Link to comment https://forums.phpfreaks.com/topic/239730-check-website-for-change/#findComment-1231484 Share on other sites More sharing options...
gizmola Posted June 18, 2011 Share Posted June 18, 2011 If you don't need that, then a very efficient solution would be to suck the data into a string and md5 it. You could have a simple table of entries: pageurl | hash. When you run it, you just need to compute the hash. Of course this isn't going to work for pages where the content is dynamic. Quote Link to comment https://forums.phpfreaks.com/topic/239730-check-website-for-change/#findComment-1231496 Share on other sites More sharing options...
xyph Posted June 18, 2011 Share Posted June 18, 2011 Very possible. Very possible that the page will change source on every visit, in the case of a server-side ad carousel, etc. You may want to isolate the chunk of data you want before hashing. Quote Link to comment https://forums.phpfreaks.com/topic/239730-check-website-for-change/#findComment-1231569 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.