Questo codice non funziona, non intercetta ip e spider.
Codice PHP:
//Riconosce che è uno spider e non lo conteggia nei +Letti
function is_spider($agent) {
$spider = array("googlebot", "spider", "crawler", "scooter", "yahoo! slurp", "la_archiver", "lycos", "teoma_agent", "ask jeeves", "mercator", "fast", "msnbot", "bingbot", "facebookexternalhit");
//Qui metti gli ip che non vuoi vengano conteggiati nei +Letti
$bannedip = array('192.187.100.154','107.170.(.*)','213.42.176.216','38.99.82.(.*)','162.243.(.*)','104.131.217.168');
foreach( $bannedip as $check ) {
if ( !strcmp( $_SERVER['REMOTE_ADDR'], $check))
return true;
}
foreach ($spider as $value) {
if (stripos(strtolower($agent), $value) !== false) {
return true;
}
}
return false;
}
$agent = $_SERVER["HTTP_USER_AGENT"];
if (is_spider($agent)) {
}
...