2017 © Pedro Peláez
 

library honeypot-blacklist

A simple PHP library for querying the Project Honeypot Http:BL API.

image

thasmo/honeypot-blacklist

A simple PHP library for querying the Project Honeypot Http:BL API.

  • Monday, March 21, 2016
  • by thasmo
  • Repository
  • 2 Watchers
  • 7 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 5 % Grown

The README.md

Project Honeypot Http:BL Library

A simple PHP library for querying the Project Honeypot Http:BL API., (*1)

Build Status Coverage Status Latest Stable Version, (*2)

Usage

Create a new instance

use Thasmo\ProjectHoneypot\Blacklist;
$client = new Blacklist('127.0.0.1', 'api-key');

Create multiple instances

use Thasmo\ProjectHoneypot\Blacklist;

# Set default API key.
Blacklist::setDefaultKey('api-key');

# Use the default API key.
$clientOne = new Blacklist('127.0.0.1');

# Use a specific API key.
$clientTwo = new Blacklist('127.0.0.2', 'other-api-key');

# Use the default API key, again.
$clientThree = new Blacklist('127.0.0.3');

Check for various types of clients

# Client is a search engine.
$client->isSearchEngine();

# Client is suspicious.
$client->isSuspicious();

# Client is a harvester.
$client->isHarvester()

# Client is a spammer.
$client->isSpammer();

# Client is blacklisted.
# Which means it is suspicious, a harvester or a spammer but not a search engine.
$client->isListed();

Get last activity

# Get the last activity for the client in days.
$lastActivity = $client->getActivity(); 

Get threat score

# Get the threat score of the client.
$threatScore = $client->getThreat();

Check last activity

# Check if the client was active in the last 10 days.
$isActive = $client->isActive(10);

Check threat score

# Check if the threat score is within the limit of 100.
$isThreat = $client->isThreat(100);

Get the name for a search engine

# Get the name of the search engine.
if($client->isSearchEngine()) {
  $name = $client->getName();
}

Get the API result

# Return an array holding the result from the API call
$result = $client->getResult();

Change the address

use Thasmo\ProjectHoneypot\Blacklist;

# Create an instance
$client = new Blacklist('127.0.0.1', 'api-key');

# Get the result
$result1 = $client->getResult();

# Set a new address which resets the object
$client->setAddress('127.0.0.2');

# Get the new result
$result2 = $client->getResult();

Query the API

use Thasmo\ProjectHoneypot\Blacklist;

# Create an instance
$client = new Blacklist('127.0.0.1', 'api-key');

# Query the API immediately
$client->query();

# Use other methods
if($client->isSearchEngine()) {
  $name = $client->getName();
}

Implementation Details

  • Requests to the API are delayed until you first call a method like isSearchEngine etc. or query explicitly.
  • API responses for the same IP address on the same instance will be cached, the API will be queried only once.
  • When changing the IP address via setAddress the cache is cleared and the API will be queried again.

The Versions

21/03 2016

dev-develop

dev-develop

A simple PHP library for querying the Project Honeypot Http:BL API.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Thomas Deinhamer

api http spam blacklist honeypot

21/03 2016

dev-master

9999999-dev

A simple PHP library for querying the Project Honeypot Http:BL API.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Thomas Deinhamer

api http spam blacklist honeypot

21/03 2016

v0.1.2

0.1.2.0

A simple PHP library for querying the Project Honeypot Http:BL API.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Thomas Deinhamer

api http spam blacklist honeypot

26/06 2015

v0.1.1

0.1.1.0

A simple PHP library for querying the Project Honeypot Http:BL API.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Thomas Deinhamer

api http spam blacklist honeypot

25/06 2015

v0.1.0

0.1.0.0

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Thomas Deinhamer

api http spam blacklist honeypot