akismet-kotlin/docs/net.thauvin.erik.akismet/-akismet-comment/index.md
2020-03-05 22:46:41 -08:00

8 KiB

docs / net.thauvin.erik.akismet / AkismetComment

AkismetComment

open class AkismetComment (source)

A comment to send to Akismet.

Most everything is optional. Performance can drop dramatically if you choose to exclude data points. The more data you send Akismet about each comment, the greater the accuracy. They recommend erring on the side of including too much data.

See the Akismet API for more details.

Constructors

Name Summary
<init> Create an Akismet comment extracting the userIp, userAgent, referrer and serverEnv environment variables from a Servlet request.AkismetComment(request: HttpServletRequest)
Create an Akismet comment instance.AkismetComment(userIp: String, userAgent: String)

Properties

Name Summary
author Name submitted with the comment.var author: String?
authorEmail Email address submitted with the comment.var authorEmail: String?
authorUrl URL submitted with comment.var authorUrl: String?
blogCharset The character encoding for the form values included in comment parameters, such as UTF-8 or ISO-8859-1var blogCharset: String?
blogLang Indicates the language(s) in use on the blog or site, in ISO 639-1 format, comma-separated.var blogLang: String?
content The content that was submitted.var content: String?
dateGmt The UTC timestamp of the creation of the comment, in ISO 8601 format.var dateGmt: String?
isTest This is an optional parameter. You can use it when submitting test queries to Akismet.var isTest: Boolean
permalink The full permanent URL of the entry the comment was submitted to.var permalink: String?
postModifiedGmt The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.var postModifiedGmt: String?
recheckReason If you are sending content to Akismet to be rechecked, such as a post that has been edited or old pending comments that you'd like to recheck, include this parameter with a string describing why the content is being rechecked.var recheckReason: String?
referrer The content of the referer header should be set here.var referrer: String?
serverEnv In PHP, there is an array of environmental variables called $_SERVER that contains information about the Web server itself as well as a key/value for every HTTP header sent with the request. This data is highly useful to Akismet.var serverEnv: Map<String, String>
type A string that describes the type of content being sent, such as:var type: String?
userAgent User agent string of the web browser submitting the comment.val userAgent: String
userIp IP address of the comment submitter.val userIp: String
userRole The user role of the user who submitted the comment. This is an optional parameter.var userRole: String?

Functions

Name Summary
equals Indicates whether some other object is equal to this one.open fun equals(other: Any?): Boolean
hashCode Returns a hash code value for the object.open fun hashCode(): Int
toJson Returns a JSON representation of the comment.fun toJson(): String
toString Returns a JSON representation of the comment.open fun toString(): String

Companion Object Properties

Name Summary
ADMIN_ROLE Administrator role. If used, Akismet will always return false.const val ADMIN_ROLE: String
TYPE_BLOG_POST A blog post.const val TYPE_BLOG_POST: String
TYPE_COMMENT A blog comment.const val TYPE_COMMENT: String
TYPE_CONTACT_FORM A contact form or feedback form submission.const val TYPE_CONTACT_FORM: String
TYPE_FORUM_POST A top-level forum post.const val TYPE_FORUM_POST: String
TYPE_MESSAGE A message sent between just a few users.const val TYPE_MESSAGE: String
TYPE_PINGBACK A pingback.const val TYPE_PINGBACK: String
TYPE_REPLY A reply to a top-level forum post.const val TYPE_REPLY: String
TYPE_SIGNUP A new user account.const val TYPE_SIGNUP: String
TYPE_TRACKBACK A trackback.const val TYPE_TRACKBACK: String
TYPE_TWEET A Twitter message.const val TYPE_TWEET: String