{"id":21591970,"url":"https://github.com/thasmo/php.honeypot-blacklist","last_synced_at":"2025-04-10T22:52:32.191Z","repository":{"id":34216284,"uuid":"38074446","full_name":"thasmo/php.honeypot-blacklist","owner":"thasmo","description":"A simple PHP library for querying the Project Honeypot Http:BL API.","archived":false,"fork":false,"pushed_at":"2016-03-21T20:18:04.000Z","size":19,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-10T22:52:15.013Z","etag":null,"topics":["api","honeypot-http","php-library","spam","threat-score"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thasmo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-25T21:11:28.000Z","updated_at":"2025-03-22T11:50:20.000Z","dependencies_parsed_at":"2022-09-04T11:11:59.453Z","dependency_job_id":null,"html_url":"https://github.com/thasmo/php.honeypot-blacklist","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thasmo%2Fphp.honeypot-blacklist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thasmo%2Fphp.honeypot-blacklist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thasmo%2Fphp.honeypot-blacklist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thasmo%2Fphp.honeypot-blacklist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thasmo","download_url":"https://codeload.github.com/thasmo/php.honeypot-blacklist/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312170,"owners_count":21082638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","honeypot-http","php-library","spam","threat-score"],"created_at":"2024-11-24T16:35:11.215Z","updated_at":"2025-04-10T22:52:32.169Z","avatar_url":"https://github.com/thasmo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Honeypot Http:BL Library\n\nA simple PHP library for querying the [Project Honeypot Http:BL API](http://www.projecthoneypot.org/httpbl_api.php).\n\n[![Build Status](https://travis-ci.org/thasmo/php.honeypot-blacklist.svg?branch=develop)](https://travis-ci.org/thasmo/php.honeypot-blacklist)\n[![Coverage Status](https://coveralls.io/repos/thasmo/php.honeypot-blacklist/badge.svg?branch=develop)](https://coveralls.io/r/thasmo/php.honeypot-blacklist?branch=develop)\n[![Latest Stable Version](https://poser.pugx.org/thasmo/honeypot-blacklist/v/stable)](https://packagist.org/packages/thasmo/honeypot-blacklist)\n\n## Usage\n\n### Create a new instance\n```php\nuse Thasmo\\ProjectHoneypot\\Blacklist;\n$client = new Blacklist('127.0.0.1', 'api-key');\n```\n\n### Create multiple instances\n```php\nuse Thasmo\\ProjectHoneypot\\Blacklist;\n\n# Set default API key.\nBlacklist::setDefaultKey('api-key');\n\n# Use the default API key.\n$clientOne = new Blacklist('127.0.0.1');\n\n# Use a specific API key.\n$clientTwo = new Blacklist('127.0.0.2', 'other-api-key');\n\n# Use the default API key, again.\n$clientThree = new Blacklist('127.0.0.3');\n```\n\n### Check for various types of clients\n```php\n# Client is a search engine.\n$client-\u003eisSearchEngine();\n\n# Client is suspicious.\n$client-\u003eisSuspicious();\n\n# Client is a harvester.\n$client-\u003eisHarvester()\n\n# Client is a spammer.\n$client-\u003eisSpammer();\n\n# Client is blacklisted.\n# Which means it is suspicious, a harvester or a spammer but not a search engine.\n$client-\u003eisListed();\n```\n\n### Get last activity\n```php\n# Get the last activity for the client in days.\n$lastActivity = $client-\u003egetActivity(); \n```\n\n### Get threat score\n```php\n# Get the threat score of the client.\n$threatScore = $client-\u003egetThreat();\n```\n\n### Check last activity\n```php\n# Check if the client was active in the last 10 days.\n$isActive = $client-\u003eisActive(10);\n```\n\n### Check threat score\n```php\n# Check if the threat score is within the limit of 100.\n$isThreat = $client-\u003eisThreat(100);\n```\n\n### Get the name for a search engine\n```php\n# Get the name of the search engine.\nif($client-\u003eisSearchEngine()) {\n  $name = $client-\u003egetName();\n}\n```\n\n### Get the API result\n```php\n# Return an array holding the result from the API call\n$result = $client-\u003egetResult();\n```\n\n### Change the address\n```php\nuse Thasmo\\ProjectHoneypot\\Blacklist;\n\n# Create an instance\n$client = new Blacklist('127.0.0.1', 'api-key');\n\n# Get the result\n$result1 = $client-\u003egetResult();\n\n# Set a new address which resets the object\n$client-\u003esetAddress('127.0.0.2');\n\n# Get the new result\n$result2 = $client-\u003egetResult();\n```\n\n### Query the API\n```php\nuse Thasmo\\ProjectHoneypot\\Blacklist;\n\n# Create an instance\n$client = new Blacklist('127.0.0.1', 'api-key');\n\n# Query the API immediately\n$client-\u003equery();\n\n# Use other methods\nif($client-\u003eisSearchEngine()) {\n  $name = $client-\u003egetName();\n}\n```\n\n## Implementation Details\n\n* Requests to the API are delayed until you first call a method like `isSearchEngine` etc. or `query` explicitly.\n* API responses for the same IP address on the same instance will be cached, the API will be queried only once.\n* When changing the IP address via `setAddress` the cache is cleared and the API will be queried again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthasmo%2Fphp.honeypot-blacklist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthasmo%2Fphp.honeypot-blacklist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthasmo%2Fphp.honeypot-blacklist/lists"}