5.3 KiB
5.3 KiB
docs / net.thauvin.erik.akismet / Akismet
Akismet
open class Akismet
(source)
Provides access to the Akismet API.
Constructors
Name | Summary |
---|---|
<init> | Create a new instance using an Akismet API key and URL registered with Akismet.Akismet(apiKey: String , blog: String ) Creates new instance using the provided Akismet API key. Akismet(apiKey: String ) |
Properties
Name | Summary |
---|---|
appUserAgent | The application user agent to be sent to Akismet.var appUserAgent: String |
blog | The URL registered with Akismet.var blog: String |
debugHelp | The x-akismet-debug-help header from the last operation, if any.var debugHelp: String |
errorMessage | The error message.var errorMessage: String |
httpStatusCode | The HTTP status code of the last operation.var httpStatusCode: Int |
isDiscard | Set to true if Akismet has determined that the last checked comment is blatant spam, and you can safely discard it without saving it in any spam queue.var isDiscard: Boolean |
isVerifiedKey | Check if the API Key has been verifiedvar isVerifiedKey: Boolean |
logger | The logger instance.val logger: Logger |
proTip | The x-akismet-pro-tip header from the last operation, if any.var proTip: String |
response | The actual response sent by Akismet from the last operation.var response: String |
Functions
Name | Summary |
---|---|
checkComment | Comment Check.fun checkComment(comment: AkismetComment , trueOnError: Boolean = false): Boolean |
executeMethod | Execute a call to an Akismet REST API method.fun executeMethod(apiUrl: HttpUrl?, formBody: FormBody, trueOnError: Boolean = false): Boolean |
reset | Reset the debugHelp, errorMessage, httpStatusCode, isDiscard, isVerifiedKey, proTip, and response properties.fun reset(): Unit |
submitHam | Submit Ham. (False Positives)fun submitHam(comment: AkismetComment ): Boolean |
submitSpam | Submit Spam. (Missed Spam)fun submitSpam(comment: AkismetComment ): Boolean |
verifyKey | Key Verification.fun verifyKey(): Boolean |
Companion Object Functions
Name | Summary |
---|---|
dateToGmt | Convert a date to a UTC timestamp. (ISO 8601)fun dateToGmt(date: Date ): String Convert a locale date/time to a UTC timestamp. (ISO 8601) fun dateToGmt(date: LocalDateTime ): String |
jsonComment | (Re)Create a comment from a JSON string.fun jsonComment(json: String ): AkismetComment |