Services_ProjectHoneyPot
[ class tree: Services_ProjectHoneyPot ] [ index: Services_ProjectHoneyPot ] [ all elements ]

Source for file example-obj.php

Documentation is available at example-obj.php

  1. <?php
  2. //error_reporting(E_ALL|E_STRICT);
  3.  
  4. set_include_path(dirname(__FILE__'/../' . PATH_SEPARATOR . get_include_path());
  5.  
  6. require_once 'Services/ProjectHoneyPot.php';
  7.  
  8. /**
  9.  * config.php, includes:
  10.  * <?php $access_key = '...'; ?>
  11.  * 
  12.  * ... is the access key
  13.  */
  14. include dirname(__FILE__'/config.php';
  15.  
  16. try {
  17.     $sphp = new Services_ProjectHoneyPot($access_key);
  18.     $sphp->setResponseFormat('object');
  19.  
  20.     $status $sphp->query($harvester);
  21.  
  22. }
  23.     echo "\nMSG: " .$e->getMessage();
  24.     echo "\nCODE: " $e->getCode();
  25.     exit;
  26. }
  27. if (count($status== 0{
  28.     die("No results.");
  29. }
  30. foreach ($status as $res{
  31.  
  32.     $ip  key($res);
  33.     $res $res[$ip];
  34.  
  35.     if ($res === false{
  36.         echo 'Don\'t bother. Probably a regular user. ;-)' "\n";
  37.     else {
  38.         if ($res->isHarvester()) {
  39.             echo '<h1>OMG, a harvester!!!</h1>';
  40.             echo '<pre>'var_dump($res); echo '</pre>';
  41.         }
  42.     }
  43. }
  44.  
  45. ?>

Documentation generated on Mon, 11 Mar 2019 15:45:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.