This commit is contained in:
Erik C. Thauvin 2020-03-05 22:49:44 -08:00
parent 527530e89d
commit a995ae2af5
2 changed files with 12 additions and 2 deletions

View file

@ -33,8 +33,8 @@ public class AkismetSample {
if (isSpam) {
System.out.println("The comment is SPAM according to Akismet.");
final boolean hasBenSubmitted = akismet.submitSpam(comment);
if (hasBenSubmitted) {
final boolean hasBeenSubmitted = akismet.submitSpam(comment);
if (hasBeenSubmitted) {
System.out.println("The comment has been submitted as SPAM to Akismet");
} else {
System.err.println(akismet.getErrorMessage());

View file

@ -61,24 +61,34 @@ open class AkismetComment(val userIp: String, val userAgent: String) {
companion object {
/** A blog comment. */
const val TYPE_COMMENT = "comment"
/** A top-level forum post. */
const val TYPE_FORUM_POST = "forum-post"
/** A reply to a top-level forum post. */
const val TYPE_REPLY = "reply"
/** A blog post. */
const val TYPE_BLOG_POST = "blog-post"
/** A contact form or feedback form submission. */
const val TYPE_CONTACT_FORM = "contact-form"
/** A new user account. */
const val TYPE_SIGNUP = "signup"
/** A message sent between just a few users. */
const val TYPE_MESSAGE = "message"
/** A pingback. */
const val TYPE_PINGBACK = "pingback"
/** A trackback. */
const val TYPE_TRACKBACK = "trackback"
/** A Twitter message. */
const val TYPE_TWEET = "tweet"
/** Administrator role. If used, Akismet will always return false. */
const val ADMIN_ROLE = "administrator"
}