Fixed kotlin example.

This commit is contained in:
Erik C. Thauvin 2019-09-25 09:40:29 -07:00
parent 6f47f40bd1
commit ebaca3340f

View file

@ -12,14 +12,16 @@ Akismet for Kotlin/Java is a pretty complete and straightforward implementation
```kotlin ```kotlin
val akismet = Akismet("YOUR_API_KEY", "YOUR_BLOG_URL") val akismet = Akismet("YOUR_API_KEY", "YOUR_BLOG_URL")
val comment = AkismetComment(userIp = "127.0.0.1", userAgent = "curl/7.29.0") val comment = AkismetComment(userIp = "127.0.0.1", userAgent = "curl/7.29.0")
comment.setReferrer("http://www.google.com"); with(comment) {
comment.setType(AkismetComment.TYPE_COMMENT); referrer = "http://www.google.com"
comment.setAuthor("admin"); type = AkismetComment.TYPE_COMMENT
comment.setAuthorEmail("test@test.com"); author = "admin"
comment.setAuthorUrl("http://www.CheckOutMyCoolSite.com"); authorEmail = "test@test.com"
comment.setDateGmt(Akismet.dateToGmt(new Date())); authorUrl = "http://www.CheckOutMyCoolSite.com"
comment.setContent("It means a lot that you would take the time to review our software."); dateGmt = Akismet.dateToGmt(Date())
content = "It means a lot that you would take the time to review our software."
}
// ... // ...
val isSpam = akismet.checkComment(comment) val isSpam = akismet.checkComment(comment)