UNPKG

honeypot

Version:

Node.js implementation of the Project Honeypot (Http:BL) API. Because we all hate spam.

45 lines (44 loc) 2.47 kB
{ "name": "honeypot", "version": "0.0.2", "description": "Node.js implementation of the Project Honeypot (Http:BL) API. Because we all hate spam.", "keywords": [ "honeypot", "spam", "honey", "Http:BL", "ip", "spammer" ], "author": { "name": "Piotr Rochala", "email": "piotr.rochala@gmail.com", "url": "http://rocha.la/" }, "dependencies": {}, "devDependencies": { "mocha": "*", "should": "*" }, "engines": { "node": "*" }, "repository": { "type": "git", "url": "https://github.com/rochal/honeypot.git" }, "bugs": { "url": "https://github.com/rochal/honeypot/issues" }, "licenses": [ { "type": "MIT" } ], "main": "honeypot", "readme": "honeypot\n=========\n\nNode.js implementation of the Project Honeypot (Http:BL) API. Because we all hate spam.\n\n - Utilizes Http:BL from known and loved https://www.projecthoneypot.org/\n - Uses built-in node dns.resolve4 to get response from the DNS API\n - No Unicorns were harmed during development\n\nInstallation\n--------------\n\n```sh\nnpm install honeypot\n```\n\nUsage\n----\n```javascript\nvar honeypot = require('honeypot');\n\nvar pot = new honeypot('your_api_key');\n\npot.query('127.0.0.1', function(err, response){\n if (!response) {\n console.log(\"IP not found in honeypot, we're all good!\");\n } else {\n console.log(\"Oh no, it's a spammer mate! Kil it with fire!\");\n console.log(response.getFormattedResponse());\n // Suspiious, Comment Spammer\n // Threat Rating: 58 / 255\n // Recency: 1 / 255\n }\n});\n```\n\nExample within Express\n----\n\n```javascript\nvar honeypot = require('honeypot');\n\nvar pot = new honeypot('your_api_key');\n\n// example route for POST /comment/\ncreate: function(req, res) {\n \n pot.query(req.ip, function(err, response){\n if (!response) {\n console.log(\"IP not found in honeypot, we're all good!\");\n // do some commentary magic\n res.send({ msg: 'we hate spam!' });\n } else {\n console.log(\"Die!\");\n res.send(null);\n }\n });\n}\n```\n\nKudos\n----\n\nBased on this sweet PHP gist https://gist.github.com/smithweb/7773373.\n\n\nLicense\n----\n\nMIT\n\n**Free Software, Hell Yeah!**\n\n", "readmeFilename": "Readme.md", "_id": "honeypot@0.0.2", "_from": "honeypot@0.0.2", "scripts": {} }