Page 1 of 1

Monitoring a URL on another server...

Posted: Fri Aug 01, 2008 9:47 am
by jeffrydell
I'd like to run a script that checks various URL's and alert me if a change has been made.

I would seem easy, I could use filemtime() or filesize() and compare that vs. info stored in my database for that specific URL. I guess either works great if comparing statistics for a static page ... but what can I do to get a value for comparison if it's a dynamic page? (Like http://Domain.com/page.cfm?id=12345)

Any way to compare? OR can I use my script to 'capture' the contents and "look" for a specific string within the page? If so - how?

Thanks in advance for whatever you can suggest!

Jeff

Re: Monitoring a URL on another server...

Posted: Fri Aug 01, 2008 10:40 am
by jaoudestudios
You can use file and treat the remote file as a live feed.

Then save it to a string and do a compare.

Re: Monitoring a URL on another server...

Posted: Fri Aug 01, 2008 11:08 am
by jeffrydell
Got it - I can look for the string which indicates that page has what I want, then display the page IF in_array(). Perfect - thanks!

Jeff

Re: Monitoring a URL on another server...

Posted: Fri Aug 01, 2008 11:50 am
by jaoudestudios
Sorry, I did not mean to make it more confusing for you.

Ignore the bit about the live feed. But lookup file function on php.net

Re: Monitoring a URL on another server...

Posted: Fri Aug 01, 2008 12:04 pm
by jeffrydell
I tinkered a bit, learned and have a successful fix ... thanks so much!

Jeff