Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rochal/honeypot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

6 Commits

Repository files navigation

honeypot

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

  • Utilizes Http:BL from known and loved https://www.projecthoneypot.org/
  • Uses built-in node dns.resolve4 to get response from the DNS API
  • No Unicorns were harmed during development

Installation

npm install honeypot

Usage

var honeypot = require('honeypot');
var pot = new honeypot('your_api_key');
pot.query('127.0.0.1', function(err, response){
 if (!response) {
 console.log("IP not found in honeypot, we're all good!");
 } else {
 console.log("Oh no, it's a spammer mate! Kil it with fire!");
 console.log(response.getFormattedResponse());
 // Suspicious, Comment Spammer
 // Threat Rating: 58 / 255
 // Recency: 1 / 255
 }
});

Example within Express

var honeypot = require('honeypot');
var pot = new honeypot('your_api_key');
// example route for POST /comment/
create: function(req, res) {
 pot.query(req.ip, function(err, response){
 if (!response) {
 console.log("IP not found in honeypot, we're all good!");
 // do some commentary magic
 res.send({ msg: 'we hate spam!' });
 } else {
 console.log("Die!");
 res.send(null);
 }
 });
}

Kudos

Based on this sweet PHP gist https://gist.github.com/smithweb/7773373.

License

MIT

Free Software, Hell Yeah!

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /