Yii 1.1: Tarpit for bad bots

10 followers

I recently built a tarpit for bad bots.

The primary function is to automatically trap and block bots that don't obey robots.txt rules

download is available at the googlecode repo

Yii Setup

How to set up php-labrea for use with the yii framework Details

Unzip to the root dir.
Edit your protected/views/layout/main.php add
<?php $pitdir = "http://" . $_SERVER['HTTP_HOST'] . "/php-labrea/"; ?>
    <a href="<?php echo $pitdir; ?>"><img src="images/pixel.gif" border="0" 
    alt=" " width="1" height="1" style="display:none;"></a>
Edit your index.php bootstrap adding to the top of the file
include($_SERVER['DOCUMENT_ROOT'] . "/php-labrea/classes/tarpit.php"); 
    // change the following paths if necessary
    $tarpit=new tarpit;
 
    if($tarpit->isBot()){
            $location="http://" . $_SERVER['HTTP_HOST'] ."/php-labrea";
            header('location:'.$location);
            exit;
    }else

Total 4 comments

#6531 report it
mithereal at 2012/01/16 06:19pm
liscense

license has been changed to lgpl

#6529 report it
fsb at 2012/01/16 02:57pm
php-labrea is GPL

Be aware of php-labrea's license, which is GPL 3 (and not LGPL). If you incorporate it into your app then your app becomes GPL open source .

#6467 report it
marcovtwout at 2012/01/12 07:48am
Re: Purpose of this extension

From the link in the first line of this extension: "The primary function is to automatically trap and block bots that don't obey robots.txt rules"

#6455 report it
jpablo at 2012/01/11 04:42pm
What's the pourpose of this extension??

Can you please explain what this extension does? It has no explanation about the pourpose and/or behavior.

Leave a comment

Please to leave your comment.

Write new article
  • Written by: mithereal
  • Category: How-tos
  • Yii Version: 1.1
  • Votes: +1
  • Viewed: 6,470 times
  • Created on: Jan 10, 2012
  • Last updated: Jan 14, 2012
  • Tags: tarpit, bots