TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   Directory site maintenance (http://www.talkphp.com/absolute-beginners/4167-directory-site-maintenance.html)

oMIKEo 04-21-2009 12:01 PM

Directory site maintenance
 
Hi guys,

I am working on a directory site and am trying to find out the best ways to maintain it.

What i would ideally like it to be able to run a script that checks to see if a url still works. The only way i would know to do that is to fopen code of the url and run through it to make sure 404 or similar error codes are not found but i don't think that's very accurate! Any other ideas?

My second question is that it would be nice to automatically take a screenshot of the site being added to the directory to use as a thumbnail. Is this possible with php?

Thanks!

Jim 04-21-2009 12:29 PM

There are quite many screenshot services around my friend:
http://www.google.nl/search?hl=nl&cl...G=Zoeken&meta=

About the online check... You can easily check this kind of stuff with cURL or something. Don't know if thats the most ideal solution tho. I'm sure Kalle knows how to do it the fastest way. :)

Salathe 04-21-2009 01:02 PM

What makes you think pinging the site for a response wouldn't be accurate?

As for screenshots, there are a bunch of easy to use web services out there for your application to hook into. Or you could create your own screenshots if you want to face the technical hurdles.

Jim 04-21-2009 01:28 PM

Quote:

Originally Posted by Salathe (Post 23273)
What makes you think pinging the site for a response wouldn't be accurate?

You can't check if a file exists using ping, you can only see if the host is online.

Enfernikus 04-21-2009 07:39 PM

Why not just used cURL and check the returned headers?

Kalle 04-22-2009 06:42 PM

As said, I think the cURL multi interface might be worth a short here (curl_multi_* function family). Too bad theres no thread support in PHP, else it would all have been alot faster here :(

oMIKEo 04-22-2009 09:20 PM

Ok thanks guys will look for some examples of cURL and try and get something working.


All times are GMT. The time now is 11:48 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0