Library code snippets
Domain scanner
By Akas Triono Hadi, published on 20 Feb 2002
This simple code collects a list of domains with a certain extension from google.com
<?
// Thx to idban 4 your grabbing tools, did you remember me? :)
// My little hero : wulan
//
// Jakarta : September, 6 2001
?>
<html>
<head>
<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>
<?
$file=fopen("http://www.google.com/search?num=$prev&btnG=Google+Search&as_epq=$domain","r");
if (!$file) {
echo "error when connect\n";
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>
Related articles
Related discussion
-
Create this kind of website
by maidentv (1 replies)
-
PHP London July Meetup
by webdeveloperit (1 replies)
-
Binary Studio | software development outsourcing Ukraine
by shane124 (4 replies)
-
SOFTWARE PHP WORK
by synctel (0 replies)
-
London PHP / MySQL Superstar needed!
by gatewaytechnolabs (1 replies)
Related podcasts
-
EarthClassMail.com - Moving from LAMP to .NET 3.5
Scott chats with Matt Davis, architect at EarthClassMail.com, about their move from a LAMP stack (Linux/Apache/mysql/PHP) to .NET 3.5. What's working, what's not, and what kinds of issues are they running into as their architect their solution.
Events coming up
-
Dec
3
The Auckland PHP December meetup
Auckland, New Zealand
Topic: Magento E-Commerce platform Speaker: Robert Popovic, LERO9, Robert is the Technical Director and co-founder of LERO9. Robert attended the Electrotechnical Faculty at The University of Belgrade where he graduated with a Masters in Computer Science and Information Technology. Robert has worked exclusively in the field of web and software development throughout his career.
<?
// Thx to idban 4 your grabbing tools, did you remember me? :)
// My little hero : wulan
//
// Jakarta : September, 6 2001
?>
<html>
<head>
<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>
<?
$file=fopen("http://www.google.com/search?num=$prev&btnG=Google+Search&as_epq=abc","r");
if (!$file) {
echo "error when connect\n";
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>
I tried exectuting the above code posted by Akas Triono Hadi ( castamaster )
it gives me an error "error when connect " -- when fopen command is executed pliz help me rectify it
thanx in advance
I tried the code
"error when connect " while trying to open the file pliz help
thanks in advance
This thread is for discussions of Domain scanner.