1
Wayne
Anyone got a script to go through and mass-verify links?
  • 2004/4/30 14:56

  • Wayne

  • Just popping in

  • Posts: 35

  • Since: 2002/2/13


Hi,

At Amiga.org, I've got several hundred links to Amiga sites on the Web. I'm not sure however how many of them are still physically in operation. What I'd like, if anyone has it or is interested in a challenge, is a script to go through and verify that all the links are still answering. Something like;

1) Open $link
2) if $link doesn't open, create broken link report.

That way, at least, I could go through and manually verify a few broken link reports as opposed to manually hitting hundreds of links.

I'd appreciate any help anyone might be able to offer.

Wayne

2
Society
Re: Anyone got a script to go through and mass-verify links?
  • 2004/4/30 15:28

  • Society

  • Not too shy to talk

  • Posts: 178

  • Since: 2002/1/10


Wayne:
all links are dead :) -> amiga, too :) *joke* <- i like my amiga 12oo :)

i search for such script, too!
maybe someone did something like that allready?

3
Wayne
Re: Anyone got a script to go through and mass-verify links?
  • 2004/4/30 17:23

  • Wayne

  • Just popping in

  • Posts: 35

  • Since: 2002/2/13


What I need is something like this. It needs to be paginated, and it needs help with the SQL Insert clause (it isn't inserting into the DB like it should) but you get the idea.

<?php
/* Connecting, selecting database */
$link mysql_connect("localhost""user""password") or die("Could not connect : " mysql_error());
echo 
"Connected successfully<br /><br />";
mysql_select_db("xoops") or die("Could not select database");

/* Performing SQL query */
$query "SELECT lid, title, url FROM x_mylinks_links";
$result mysql_query($query) or die("Query failed : " mysql_error());

/* Printing results */
while ($line mysql_fetch_array($result))
{
    
$sitename $line[url];
    echo 
"Checking $sitename<br />n";
    
$file fopen ($sitename"r");
    if (
$file)
        {
         
// echo "$sitename : Exists<br />n";
            
fclose($file);
        }
    if (!
$file)
     {
    echo 
"$sitename : <font color='red'>Does not exist</font><br />n";
    
$sql mysql_query("INSERT INTO x_mylinks_broken (lid, sender, ip) VALUES ($line[lid], 1, 192.168.0.1)");
    }
}


/* Free resultset */
mysql_free_result($result);

/* Closing connection */
mysql_close($link);
?>

Login

Who's Online

104 user(s) are online (67 user(s) are browsing Support Forums)


Members: 0


Guests: 104


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits