Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Can a kind PHP coder make this script and release it under the GPL license?
Old 05-15-2009, 10:04 PM Can a kind PHP coder make this script and release it under the GPL license?
Super Talker

Posts: 101
Trades: 0
A script that checks every single external link going out of a website to see if that link goes to a page with the same url or to a 404 redirect page. If the latter then the script will delete the now dead link, or if that's too difficult then at least deactivate the link or if that's too much then at the very least mark the broken link in some way (perhaps make the lettering bold red) so it will be easy to detect when deleteing dead links manually.

Such a script will work on the server side continuously running in the background searching for dead links. And since every website has a different url for their 404 page there has to be a way to add the 404 page urls for the websites to which you link most.


I searched long and hard for such a script and to my knowlege there isn't any avalible that achives all the above. If anyone with the PHP knowledge can make it and release it under the GPL this invaluable script would help a lot of people out , including me

Last edited by Towhid; 05-15-2009 at 10:04 PM.. Reason: spelling
Towhid is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-16-2009, 11:12 AM Re: Can a kind PHP coder make this script and release it under the GPL license?
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
I've seen link directory scripts with this functionality. Download one and pick apart the code.

Just so you know 'continuously running in the background' isn't the way you want to go. Use cron.

If you do end up writing the script (or finding someone to do it for you) this might help you get started:

PHP Code:
<?php
//determine if the page returns a 404
$host 'example.com';
$is404 false;
$path '/index.php';

if(
$sock fsockopen($host80))
{
     
fputs($sock"HEAD $path HTTP/1.0\r\n\r\n");

     
$httpResponse '';

     while(!
feof($sock))
          
$httpResponse .= fgets($sock);
 
     if(
strpos($httpResponse'404') !== false)
          
$is404 true;
}
?>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by NullPointer; 05-16-2009 at 04:16 PM.. Reason: Bugs!
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 05-16-2009, 03:59 PM Re: Can a kind PHP coder make this script and release it under the GPL license?
Super Talker

Posts: 101
Trades: 0
Thank you for your reply NullPointer. I don't think I will end up writing the script as I know no PHP whatsoever, but hopefully I can get someone to do it for me. In the meantime can you explain a little as to what the code you wrote is supposed to do?
Towhid is offline
Reply With Quote
View Public Profile
 
Old 05-16-2009, 04:16 PM Re: Can a kind PHP coder make this script and release it under the GPL license?
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
The code makes a HEAD request to the specified host. Normally the hosts response would be something like 'HTTP/1.0 200 OK'. If the page does not exist, however, the response will be 'HTTP/1.0 404 Requested URL not found'. Once the script recieves the response from the host, it checks for the string '404'. If found the page does not exist.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 05-16-2009, 08:02 PM Re: Can a kind PHP coder make this script and release it under the GPL license?
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
You can use this thread to ask questions about your topic, but please do not use the php forum to post requests to have your project to be created. We have a marketplace for that type of requests. Thank you.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can a kind PHP coder make this script and release it under the GPL license?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29566 seconds with 12 queries