Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Akismet API client for node.js
CoffeeScript
tag: v0.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
Makefile
README.md
package.json

README.md

Akismet for node.js. Licensed under the MIT License.

Installation:

npm install akismet

Usage:

You need to sign up for an Akismet API key to use the API. Once you sign up, it would be a good idea to verify your key. See http://www.akismet.com/development/api/#verify-key

var util = require('util'),
    akismet = require('akismet').client({ blog: 'http://my.blog.com', apiKey: 'myakismetapikey123' });

akismet.verifyKey(function(verified, status, headers) {
  if (verified) 
    util.log('API key successfully verified.');
  else 
    util.log('Unable to verify API key.');
});

You can now use Akismet to moderate the comments. See http://www.akismet.com/development/api/#comment-check

akismet.checkSpam({ 
    user_ip: userip, 
    permalink: 'http://www.my.blog.com/my-post',
    comment_author: 'spammer',
    comment_content: 'spamming your comments'
  }, function(spam, status, headers) {
    if(spam)
      util.log('Spam caught.');
    else
      util.log('Not spam');
});

You can also send feedback to Akismet with submitSpam and submitHam. Their usage is the same as checkSpam. See http://www.akismet.com/development/api/#submit-spam and http://www.akismet.com/development/api/#submit-ham

Something went wrong with that request. Please try again.