root/extensions/whois_online/include/wo_functions.inc.php @ 3695

Revision 3695, 0.9 KB (checked in by vdigital, 4 years ago)

Minor release: 2009-07-28 2.0.j

Minor changes in Config management
Additionnal flags (Ireland, Armenia, Estonia, Kazakhstan, Belarus,
Andorra, Turkey, Albania, Bosnia and Herzegovina, Azerbaijan, Iceland, European Union,
Israel, Morocco, New Caledonia and some other revised)
Search Engine trapping

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2/* Functions */
3
4
5
6
7
8
9
10
11/*
12  returns (mixed): (string) 'bot agent name'  || (bool) false
13  @param (string) HTTP_USER_AGENT
14*/
15function is_a_bot($agent = '') 
16{
17  global $conf;
18        if ($agent == '') $agent = $_SERVER['HTTP_USER_AGENT'];
19        $botlist = array('Teoma', 'alexa', 'froogle', 'Gigabot', 'inktomi',
20        'looksmart', 'URL_Spider_SQL', 'Firefly', 'NationalDirectory', 
21        'Ask Jeeves', 'TECNOSEEK', 'InfoSeek', 'WebFindBot', 'girafabot',
22        'crawler', 'www.galaxy.com', 'Googlebot', 'Scooter', 'Slurp',
23        'msnbot', 'appie', 'FAST', 'WebBug', 'Spade', 'ZyBorg', 'rabaz',
24        'Baiduspider', 'Feedfetcher-Google', 'TechnoratiSnoop', 'Rankivabot',
25        'Mediapartners-Google', 'Sogou web spider', 'WebAlta Crawler');
26  if (isset($conf['search_agents']))
27          $botlist = array_merge( $botlist, array_diff( $conf['search_agents'], $botlist ) );
28  foreach($botlist as $bot) {
29    if (stripos($agent, $bot)!==false) return $bot; 
30  }
31  return false;
32} 
33?>
Note: See TracBrowser for help on using the browser.