Zend - The PHP Company




HTTP

Add Code


Google Domain Collection  

Type: application
Added by: castamaster
Entered: 06/09/2001
Last modified: 09/12/2000
Rating: - (fewer than 3 votes)
Views: 5338
This simple code work for collection domain(co.*) from google.com


<?
// Thx to idban 4 your grabbing tools, did you remember me? :)
//  My little hero : wulan
//
// Jakarta : September, 6 2001

?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form method="post" action="<?$php_self?>">
  domain : 
  <input type="text" name="domain" value="co.id">
  <br>
  <br>
  preview : 
  <select name="prev" size="1">
    <option value="10" selected>10 result</option>
    <option value="20">20 result</option>
    <option value="30">30 result</option>
    <option value="50">50 result</option>
    <option value="100">100 result</option>
  </select>
  <input type="submit" name="Submit" value="Submit">
</form>
<br><br>
<?
$fp 
fsockopen("yahoo.com"80, &$errno, &$errstr30); 
if(!
$fp) { 
    echo 
"site down!!<br>n"
    exit; 
} else { 
$file=fopen("http://www.google.com/search?num=$prev&btnG=Google+Search&as_epq=$domain","r"); 
if (!
$file) { 
    echo 
"error when connectn"
    exit; 
    } 
while (!
feof($file)) { 
    
$line fgets($file,1024); 
    if (
eregi("related:(.*)/>Similar pages"$line$out)){ 
    
$i++;
    if (
ereg($domain$out[1])){
        echo 
$out[1]."<br>";
    }
    }
}
fclose($file); 
}
?>
</body>
</html>


Usage Example


See the example


Rate This Script





Search



This Category All Categories