Login   Register  
PHP Classes
elePHPant
Icontem

Bot recognizer and dispatcher: Recognize and handle Web robot by IP or user agent

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2009-11-04 (4 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,110 This week: 1All time: 3,109 This week: 1,476Up
Version License PHP version Categories  
bot_recognizer 1.0BSD License5.0HTTP, PHP 5, Security
Description Author  

This class can be used to recognize and handle Web robots by IP address or user agent.

It can check the IP address of the computer or the user agent of the browser program currently accessing the Web server to determine if it is within a range of IP addresses known to be of Web robots like search engine site crawlers or even malicious crawlers.

The class can call different callback functions depending on the type of crawler that was identified.

It can also be set on debug mode by taking a given IP address or string as user agent instead of the user agent string sent by the accessing browser.

The Web robots information is stored in a database. The class can load that database from a text data file. The database can be accessed using supplied database class or a database adapter class from the Zend Framework.

Innovation Award  
PHP Programming Innovation award nominee
October 2009
Number 2


Prize: One downloadable copy of PhpED Professional
If you want to detect whether the computer accessing a site is from a person, a search engine robot crawling your site or some kind a malicious program, you can check the user agent header.

However, that header can be forged with a misleading value to pretend that it is a search engine robot.

This class provides a more reliable solution that checks the IP address of the computer accessing the site against a list of IP address ranges known to be used by to search engine robots.

Manuel Lemos
Picture of Alexander Selifonov
Name: Alexander Selifonov is available for providing paid consulting. Contact Alexander Selifonov .
Classes: 15 packages by
Country: Russian Federation Russian Federation
Age: 52
All time rank: 612 in Russian Federation Russian Federation
Week rank: 63 Down4 in Russian Federation Russian Federation Down
Innovation award
Innovation award
Nominee: 11x

Winner: 2x

  Files folder image Files  
File Role Description
Plain text file bot_recognizer.php Class Main class module
Accessible without login Plain text file as_dbutils.php Aux. Database access wrapper, used in main module
Accessible without login Plain text file bot-defs.txt Data Initial bot definitions file
Accessible without login Plain text file import-botdefs.php Aux. Script for creating initial definition table in SQL database and import data from text source
Accessible without login Plain text file using-sample.php Example Using example script
Accessible without login HTML file bot_recognizer.en.htm Doc. Documentation (english)
Accessible without login HTML file bot_recognizer.ru.htm Doc. Documentation (russian)

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,110All time:3,109
 This week:1This week:1,476Up