Uses stopforumspam.com API to compare usernames, emails, and ip addresses to their spam database.
Helps weed out spam accounts during signups. Allows you to check usernames, emails and/or ip addresses against stopforumspam.com API.
npm install spamcheck
var sfs = require'../lib/util/stopforumspam'; // get our object// call checkspammer with any mixture of the following properties in the object to check: ['username', 'email', 'password']sfscheckSpammerip: reqconnectionremoteAddress email: reqbodyemailif err console.logerr;if isSpammer// user is spam, send back a custom status code with nice message or our spammer.ressend452 'You are listed as a spammer and registration will not continue.';else// user is not spam, register the user.// insert into the db, etc.;
Please visit the stopforumspam.com API documenation to fully understand the way this works.
StopForumSpam.com will allow up to 20,000 API requests daily. If you need more, please see their database page. They provide hourly updates to their database that you can download and work with directly and locally.