Hello,
i am new to PHP but i have basic understanding of how things work.
I want to build a script that will check for changes on websites that are entered and then email users when something change.
I found this script: Wizecho spider class
That let you fetch source code of remote website, i just need to make it compare results with first checking of site and then email users.
Please help me in any way you can.
I searched forums but i didn't find anything similar like this.
Thanks
check for changes on other website
Started by mladen8, Sep 08 2010 09:25 PM
4 replies to this topic
#1
Posted 08 September 2010 - 09:25 PM
|
|
|
#2
Posted 09 September 2010 - 07:10 AM
What type of changes? When users enter content or when the site admin makes a change?
#3
Posted 09 September 2010 - 07:13 AM
It really doesn't matter now, i will try to distinguish "comments" from "content" later, i just want to loop comparing source code until its different.
#4
Posted 09 September 2010 - 03:52 PM
The easiest thing would probably be to store a hash of the page in the DB and then compare it to the new version's hash, if it's the same, the content is also the same.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#5
Posted 09 September 2010 - 10:23 PM
Orjan is correct, storing hashes to check for recency would be the normal. Two hashing recommendations are CRC32B (see hash_file()), a faster checksum hashing algorithm is ADLER32.
Another somewhat faster approach would be to send an HTTP "HEAD" command to the server and check for something such as an ETAG, although some don't set it.
Another somewhat faster approach would be to send an HTTP "HEAD" command to the server and check for something such as an ETAG, although some don't set it.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.


Sign In
Create Account

Back to top









