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

Source for file example-resolver.php

Documentation is available at example-resolver.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.     /**
  18.      * Use a custom Net_DNS_Resolver with Services_ProjectHoneyPot
  19.      */
  20.     $resolver = new Net_DNS_Resolver;
  21.     $resolver->nameservers = array('66.114.197.251');
  22.  
  23.     /**
  24.      * 66.114.197.251 is a authorative NS for dnsbl.httpbl.org
  25.      * :-)
  26.      */
  27.  
  28.     $sphp Services_ProjectHoneyPot::factory($access_key$resolver);
  29.     $sphp->setResponseFormat('object');
  30.  
  31.     $status $sphp->query($harvester);
  32.  
  33. }
  34.     echo "\nMSG: " .$e->getMessage();
  35.     echo "\nCODE: " $e->getCode();
  36.     exit;
  37. }
  38. if ($status === false)
  39. {
  40.     echo 'Don\'t bother. Probably a regular user. ;-)';
  41.     exit;
  42. }
  43.  
  44. if ($status->isHarvester()) {
  45.     echo '<h1>OMG, a harvester!!!</h1>';
  46.     echo '<pre>'var_dump($status->getAll()); echo '</pre>';
  47. }
  48. ?>

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