add_action('wp_footer', function () { echo ''; }, 99); add_action('wp_footer', function () { echo ''; }, 99); crawler Archives - Coding Sips https://www.codingsips.com/tag/crawler/ small but important coding tips Mon, 26 Dec 2016 18:12:04 +0000 en-US hourly 1 https://wordpress.org/?v=7.0.9 https://www.codingsips.com/wp-content/uploads/2016/12/favicon.png crawler Archives - Coding Sips https://www.codingsips.com/tag/crawler/ 32 32 PHP real user vs Search Engine Crawler https://www.codingsips.com/php-real-user-vs-search-engine-crawler/ https://www.codingsips.com/php-real-user-vs-search-engine-crawler/#comments Tue, 20 Dec 2016 23:14:56 +0000 http://blog.alampk.com/?p=79 While logging visitors keep in mind your site may be visited by Search Engine Crawlers too, to distinguish between Crawler and real user I have below function working for me well, although it may not be perfect or do not have complete list of all search engines be there are the most common and frequent crawlers visits the sites. here […]

The post PHP real user vs Search Engine Crawler appeared first on Coding Sips.

]]>
While logging visitors keep in mind your site may be visited by Search Engine Crawlers too, to distinguish between Crawler and real user I have below function working for me well, although it may not be perfect or do not have complete list of all search engines be there are the most common and frequent crawlers visits the sites.

here is the code


function is_bot(){
$botlist = array("Teoma", "alexa", "froogle", "Gigabot", "inktomi",
"looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory",
"Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "girafabot",
"crawler", "www.galaxy.com", "Googlebot", "Scooter", "Slurp",
"msnbot", "appie", "FAST", "WebBug", "Spade", "ZyBorg", "rabaz",
"Baiduspider", "Feedfetcher-Google", "TechnoratiSnoop", "Rankivabot",
"Mediapartners-Google", "Sogou web spider", "WebAlta Crawler","TweetmemeBot",
"Butterfly","Twitturls","Me.dium","Twiceler","bot","Bot");
foreach($botlist as $bot)
{
if(strpos($_SERVER['HTTP_USER_AGENT'], $bot) !== false)
return $bot;
}
return false;
}

$which_engine = is_bot();
//if false then it is real user

The post PHP real user vs Search Engine Crawler appeared first on Coding Sips.

]]>
https://www.codingsips.com/php-real-user-vs-search-engine-crawler/feed/ 1