2.1.0 • Published 3 years ago

akismet-js v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

akismet-js

Simple Akismet API client

Setup:

yarn add akismet-js
// or
npm i akismet-js

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.

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

akismet.verifyKey((err, verified) => {
  if (verified) console.log("API key successfully verified.");
  else console.log("Unable to verify API key.");
});

You can now use Akismet to moderate your comments.

akismet.checkComment(
  {
    user_ip: "1.1.1.1",
    permalink: "http://www.my.blog.com/my-post",
    comment_author: "spammer",
    comment_content: "spamming your comments",
  },
  (err, spam) => {
    if (spam) console.log("Spam caught.");
    else console.log("Not spam");
  }
);

You can also send feedback to Akismet with submitSpam and submitHam. Their usage is the same as checkComment.

akismet.submitSpam(
  {
    user_ip: "1.1.1.1",
    permalink: "http://www.my.blog.com/my-post",
    comment_author: "spammer",
    comment_content: "that was spam but you failed to catch me",
  },
  (err) => {
    console.log("Spam reported to Akismet.");
  }
);
2.1.0

3 years ago

0.7.2

9 years ago

0.7.1

10 years ago

0.7.0

10 years ago

0.6.2

10 years ago

0.6.1

10 years ago

0.6.0

10 years ago

0.5.2

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.5

10 years ago

0.3.4

11 years ago

0.3.3

11 years ago

0.3.2

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.0

12 years ago