Google Datacenters
For all those wanting to check the rollout of the BigDaddy update, here’s a list of 116 Google Datacenters:
64.233.161.98 64.233.161.99 64.233.161.104 64.233.161.105 64.233.161.106 64.233.161.107 64.233.161.147 64.233.163.99 64.233.163.104 64.233.167.99 64.233.167.104 64.233.167.106 64.233.167.107 64.233.167.147 64.233.171.99 64.233.171.103 64.233.171.104 64.233.171.105 64.233.171.106 64.233.171.107 64.233.171.147 64.233.179.99 64.233.179.104 64.233.179.106 64.233.179.107 64.233.183.99 64.233.183.104 64.233.183.107 64.233.185.99 64.233.185.104 64.233.185.106 64.233.185.107 64.233.185.147 64.233.187.99 64.233.187.104 64.233.187.106 64.233.187.107 64.233.189.104 66.102.7.98 66.102.7.99 66.102.7.104 66.102.7.105 66.102.7.106 66.102.7.107 66.102.7.147 66.102.9.99 66.102.9.104 66.102.9.106 66.102.9.107 66.102.9.147 66.102.11.99 66.102.11.104 66.102.11.106 66.102.11.107 66.249.81.99 66.249.81.104 66.249.81.106 66.249.81.107 66.249.83.99 66.249.83.104 66.249.83.106 66.249.83.107 66.249.85.99 66.249.85.104 66.249.85.106 66.249.85.107 66.249.87.99 66.249.87.104 66.249.89.99 66.249.89.104 66.249.89.106 66.249.89.107 66.249.93.99 66.249.93.104 66.249.93.106 66.249.93.107 72.14.203.99 72.14.203.104 72.14.203.106 72.14.203.107 72.14.205.99 72.14.205.104 72.14.205.106 72.14.205.107 72.14.207.99 72.14.207.104 72.14.207.106 72.14.207.107 216.239.37.98 216.239.37.99 216.239.37.104 216.239.37.105 216.239.37.106 216.239.37.107 216.239.37.147 216.239.39.98 216.239.39.99 216.239.39.104 216.239.39.105 216.239.39.106 216.239.39.107 216.239.53.98 216.239.53.99 216.239.53.104 216.239.53.105 216.239.53.106 216.239.53.107 216.239.57.98 216.239.57.99 216.239.57.103 216.239.57.104 216.239.57.105 216.239.57.106 216.239.57.107 216.239.57.147 216.239.59.98 216.239.59.99 216.239.59.103 216.239.59.104 216.239.59.105 216.239.59.106 216.239.59.107 216.239.59.147 216.239.63.99 216.239.63.104
Here’s a quick dirty script that will check the number of each rank for a site on all datacenters:
{
$agent = “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
curl_setopt($ch, CURLOPT_NOPROGRESS, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$html = curl_exec($ch);
curl_close ($ch);
return $html;
}
function multithread_crawl($urls, $timeout)
{
$agent = “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)”;
$mh = curl_multi_init();
foreach ($urls as $i => $url)
{
$conn[$i] = curl_init($url);
curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1);
curl_setopt($conn[$i], CURLOPT_NOSIGNAL, 1);
curl_setopt($conn[$i], CURLOPT_NOPROGRESS, 1);
curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1);
curl_setopt($conn[$i], CURLOPT_URL, $url);
curl_setopt($conn[$i], CURLOPT_USERAGENT, $agent);
curl_setopt($conn[$i], CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($conn[$i], CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($conn[$i], CURLOPT_MAXREDIRS, 1);
curl_setopt($conn[$i], CURLOPT_TIMEOUT, $timeout);
curl_multi_add_handle ($mh, $conn[$i]);
}
do
{
$mrc = curl_multi_exec($mh, $active);
}
while ($mrc == CURLM_CALL_MULTI_PERFORM);
while ($active and $mrc == CURLM_OK)
{
if (curl_multi_select($mh) != -1)
{
do
{
$mrc = curl_multi_exec($mh, $active);
}
while ($mrc == CURLM_CALL_MULTI_PERFORM);
}
}
if ($mrc != CURLM_OK)
{
print “Curl multi read error $mrc\n“;
}
$res = array();
$e = 0;
foreach ($urls as $i => $url)
{
if (($err = curl_error($conn[$i])) == ”)
{
$res[$i]=curl_multi_getcontent($conn[$i]);
}
else
{
echo “error: “.$url.” (”.$err.“)\n“;
}
curl_multi_remove_handle($mh,$conn[$i]);
curl_close($conn[$i]);
}
curl_multi_close($mh);
return $res;
}
function googleresults($ip, $search, $num){
$url = “http://”.$ip.“/ie?q=”.urlencode($search).“&num=”.$num;
$html = singlethread_crawl($url);
preg_match_all(“/\” href=(.*)>/iU”, $html, $links);
$urlarray = str_replace(“<b>”,“”,$links[1]);
$urlarray = str_replace(“</b>”,“”,$urlarray);
$urlarray = preg_replace(“/>.*$/i”,“”, $urlarray);
return $urlarray;
}
function googleresults_multi($ips, $search, $num){
for ($i=0; $i < count($ips); $i++)
{
$urls[$i] = “http://”.$ips[$i].“/ie?q=”.urlencode($search).“&num=”.$num;
}
$html = multithread_crawl($urls, count($ips)/2);
for ($i=0; $i < count($ips); $i++)
{
preg_match_all(“/\” href=(.*)>/iU”, $html[$i], $links[$i]);
$urlarray[$i] = str_replace(“<b>”,“”,$links[$i][1]);
$urlarray[$i] = str_replace(“</b>”,“”,$urlarray[$i]);
$urlarray[$i] = preg_replace(“/>.*$/i”,“”, $urlarray[$i]);
}
return $urlarray;
}
function removehttp($url){
if ((substr($url,0,7) == ‘http://’) || (substr($url,0,8) == ‘https://’))
{
$url = substr($url,7);
}
$url = trim($url);
return $url;
}
function rank($arr, $item){
for ($i = 0; $i < count($arr); $i++)
{
if (eregi($item,$arr[$i]))
{
$result = $i+1;
break;
}
}
return($result);
}
$ips = array(“64.233.161.99″, “64.233.161.104″, “64.233.161.105″, “64.233.161.106″, “64.233.161.107″, “64.233.161.147″, “64.233.163.99″, “64.233.163.104″, “64.233.167.99″, “64.233.167.104″, “64.233.167.106″, “64.233.167.107″, “64.233.167.147″, “64.233.171.99″, “64.233.171.104″, “64.233.171.105″, “64.233.171.106″, “64.233.171.107″, “64.233.171.147″, “64.233.179.99″, “64.233.179.104″, “64.233.179.106″, “64.233.179.107″, “64.233.183.99″, “64.233.183.104″, “64.233.183.107″, “64.233.185.99″, “64.233.185.104″, “64.233.185.106″, “64.233.185.107″, “64.233.187.99″, “64.233.187.104″, “64.233.187.106″, “64.233.187.107″, “64.233.189.104″, “66.102.7.99″, “66.102.7.104″, “66.102.7.105″, “66.102.7.106″, “66.102.7.107″, “66.102.7.147″, “66.102.9.99″, “66.102.9.104″, “66.102.9.106″, “66.102.9.107″, “66.102.9.147″, “66.102.11.99″, “66.102.11.104″, “66.102.11.106″, “66.102.11.107″, “66.249.81.99″, “66.249.81.104″, “66.249.81.106″, “66.249.81.107″, “66.249.83.99″, “66.249.83.104″, “66.249.83.106″, “66.249.83.107″, “66.249.85.99″, “66.249.85.104″, “66.249.85.106″, “66.249.85.107″, “66.249.87.99″, “66.249.87.104″, “66.249.89.99″, “66.249.89.104″, “66.249.89.106″, “66.249.89.107″, “66.249.93.99″, “66.249.93.104″, “66.249.93.106″, “66.249.93.107″, “72.14.203.99″, “72.14.203.104″, “72.14.203.106″, “72.14.203.107″, “72.14.205.99″, “72.14.205.104″, “72.14.205.106″, “72.14.205.107″, “72.14.207.99″, “72.14.207.104″, “72.14.207.106″, “72.14.207.107″, “216.239.37.99″, “216.239.37.104″, “216.239.37.105″, “216.239.37.106″, “216.239.37.107″, “216.239.37.147″, “216.239.39.99″, “216.239.39.104″, “216.239.39.106″, “216.239.39.107″, “216.239.53.99″, “216.239.53.104″, “216.239.53.106″, “216.239.53.107″, “216.239.57.98″, “216.239.57.99″, “216.239.57.103″, “216.239.57.104″, “216.239.57.105″, “216.239.57.106″, “216.239.57.107″, “216.239.57.147″, “216.239.59.98″, “216.239.59.99″, “216.239.59.103″, “216.239.59.104″, “216.239.59.105″, “216.239.59.106″, “216.239.59.107″, “216.239.59.147″, “216.239.63.99″, “216.239.63.104″);
$query = array(“porn”, “pills”, “casino”);
$num = “100″;
for ($i=0; $i < count($query); $i++)
{
echo $query[$i].“\n“;
$numrank = array();
// $serps = googleresults_multi($ips, $query[$i], $num); //for multithreaded
for ($j=0; $j < count($ips); $j++)
{
$serps[$j] = googleresults($ips[$j], $query[$i], $num); //for single threaded
$pos = rank($serps[$j], “www.mattcutts.com”);
if (empty($pos)){$pos = 0;}
if (empty($numrank[$pos]))
{
$numrank[$pos] = 1;
}else{
$numrank[$pos] = $numrank[$pos]+1;
}
}
ksort($numrank);
foreach ($numrank as $key => $num)
{
echo $key.” - “.$num.“\n“;
}
}
Single threaded (default) is very very slow. If you change the comments as shown above to multithreaded, then it will be much faster. But be prepared to get your ip temporarily banned by Google.
[tags]Google datacenters, bigdaddy[/tags]