This commit is contained in:
Erik C. Thauvin 2022-04-28 22:03:37 -07:00
parent 89c0acdf42
commit 453bb95617
3 changed files with 24 additions and 26 deletions

View file

@ -7,12 +7,12 @@ import java.util.Date;
public class AkismetSample {
public static void main(String[] args) {
final Akismet akismet = new Akismet("YOUR_API_KEY", "http://yourblogdomainname.com/blog/");
final Akismet akismet = new Akismet("YOUR_API_KEY", "https://yourblogdomainname.com/blog/");
final AkismetComment comment = new AkismetComment("127.0.0.1", "curl/7.29.0");
comment.setTest(true);
comment.setReferrer("http://www.google.com");
comment.setReferrer("https://www.google.com");
comment.setPermalink(akismet.getBlog() + "post=1");
comment.setType(AkismetComment.TYPE_COMMENT);
comment.setAuthor("admin");

View file

@ -6,18 +6,18 @@ import java.util.Date
import kotlin.system.exitProcess
fun main() {
val akismet = Akismet(apiKey = "YOUR_API_KEY", blog = "http://yourblogdomainname.com/blog/")
val akismet = Akismet(apiKey = "YOUR_API_KEY", blog = "https://yourblogdomainname.com/blog/")
val comment = AkismetComment(userIp = "127.0.0.1", userAgent = "curl/7.29.0")
with(comment) {
isTest = true
referrer = "http://www.google.com"
referrer = "https://www.google.com"
permalink = "${akismet.blog}post=1"
type = AkismetComment.TYPE_COMMENT
author = "admin"
authorEmail = "test@test.com"
authorUrl = "http://www.CheckOutMyCoolSite.com"
authorUrl = "https://www.CheckOutMyCoolSite.com"
dateGmt = Akismet.dateToGmt(Date())
// userRole = AkismetComment.ADMIN_ROLE
content = "It means a lot that you would take the time to review our software. Thanks again."