AkismetComment

open class AkismetComment(val userIp: String, val userAgent: String)(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.

Parameters

userIp

IP address of the comment submitter.

userAgent

User agent string of the web browser submitting the comment.

Constructors

Link copied to clipboard
constructor(request: <Error class: unknown class>)

Creates a new instance extracting the userIp, userAgent, referrer and serverEnv environment variables from a Servlet request.

constructor(config: CommentConfig)
constructor(userIp: String, userAgent: String)

Creates a new instance.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Name submitted with the comment.

Link copied to clipboard

Email address submitted with the comment.

Link copied to clipboard

URL submitted with comment.

Link copied to clipboard

The character encoding for the form values included in comment parameters, such as UTF-8 or ISO-8859-1

Link copied to clipboard

Indicates the language(s) in use on the blog or site, in ISO 639-1 format, comma-separated.

Link copied to clipboard

The content that was submitted.

Link copied to clipboard

The UTC timestamp of the creation of the comment, in ISO 8601 format.

Link copied to clipboard

This is an optional parameter. You can use it when submitting test queries to Akismet.

Link copied to clipboard

The full permanent URL of the entry the comment was submitted to.

Link copied to clipboard

The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.

Link copied to clipboard

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.

Link copied to clipboard

The content of the referer header should be set here.

Link copied to clipboard

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.

Link copied to clipboard

A string that describes the type of content being sent, such as:

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The user role of the user who submitted the comment. This is an optional parameter.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Indicates whether some other object is equal to this one.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code value for the object.

Link copied to clipboard
fun toJson(): String

Returns a JSON representation of the comment.

Link copied to clipboard
open override fun toString(): String

Returns a JSON representation of the comment.