Hi, Anyone here knows the IP of yahoo, msn, google bots? I checked my access logs and got the following. 65.54.188.103 // msn 72.30.107.152 // yahoo 74.6.74.176 // yahoo 72.30.111.72 //yahoo 72.30.103.225 //yahoo 66.249.65.37 //google Yahoo's IP seem to change every visit. What's that about? Secondly, are there any more "good SE bots" which hit your sites and can you give an IP for them? Thank you
Here's a list of IP ranges for SE bots: As a bonus, here's some code to use that list with. Save the IP list above as "iplist.txt" and use the following function to determine if a visitor on your site is from the list above: function is_bot() { $ip = getenv(REMOTE_ADDR); $ip_ocets = explode('.', $ip); $temp = array_map('rtrim', file('iplist.txt')); $j = count($temp); for ($i = 0; $i < $j; $i ++) { if ((strstr($temp[$i], ';') === FALSE) && ($temp[$i] > '')) { $ip_list[] = $temp[$i]; } } unset($temp); $is_bot = FALSE; $i = 0; while ($i <= count($ip_list)-1) { $ip_range = explode(' - ', $ip_list[$i]); $ip_range_min_ocets = explode('.', $ip_range[0]); $ip_range_max_ocets = explode('.', $ip_range[1]); $x = 0; while ($x <= count($ip_range_max_ocets)-1) { if (($ip_ocets[0] >= $ip_range_min_ocets[0]) && ($ip_ocets[0] <= $ip_range_max_ocets[0]) && ($ip_ocets[1] >= $ip_range_min_ocets[1]) && ($ip_ocets[1] <= $ip_range_max_ocets[1]) && ($ip_ocets[2] >= $ip_range_min_ocets[2]) && ($ip_ocets[2] <= $ip_range_max_ocets[2]) && ($ip_ocets[3] >= $ip_range_min_ocets[3]) && ($ip_ocets[3] <= $ip_range_max_ocets[3])) {$is_bot = TRUE; break;} else {$x++;} } if ($is_bot) {break;} else {$i++;} } return $is_bot; } Code (markup): Implementation is simple. At the beginning of your php page: <? $isbot = is_bot(); if ($isbot) { ...do something here ; } else { ...do something else here ; } ?> Code (markup):