Fixed kotlin example.
This commit is contained in:
parent
6f47f40bd1
commit
ebaca3340f
1 changed files with 10 additions and 8 deletions
18
README.md
18
README.md
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue