{"id":27876919,"url":"https://github.com/ethauvin/akismet-kotlin","last_synced_at":"2025-05-05T02:53:57.349Z","repository":{"id":37262344,"uuid":"209691601","full_name":"ethauvin/akismet-kotlin","owner":"ethauvin","description":"Client library for accessing the Automattic Kismet (Akismet) spam comments filtering service","archived":false,"fork":false,"pushed_at":"2025-03-16T18:31:30.000Z","size":2528,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T19:41:01.005Z","etag":null,"topics":["akismet","akismet-api","akismet-client","android","blog","comments","ham","java","kotlin","library","spam"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethauvin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-20T02:49:22.000Z","updated_at":"2025-03-16T18:31:34.000Z","dependencies_parsed_at":"2023-09-25T02:45:26.401Z","dependency_job_id":"c6a799df-da83-4c1f-8e1e-939abd175cf4","html_url":"https://github.com/ethauvin/akismet-kotlin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fakismet-kotlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fakismet-kotlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fakismet-kotlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fakismet-kotlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethauvin","download_url":"https://codeload.github.com/ethauvin/akismet-kotlin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252429952,"owners_count":21746571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["akismet","akismet-api","akismet-client","android","blog","comments","ham","java","kotlin","library","spam"],"created_at":"2025-05-05T02:53:56.891Z","updated_at":"2025-05-05T02:53:57.342Z","avatar_url":"https://github.com/ethauvin.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause)\n[![Kotlin](https://img.shields.io/badge/kotlin-2.1.20-7f52ff)](https://kotlinlang.org/)\n[![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld\u0026labelColor=2392FF)](https://rife2.com/bld)\n[![Release](https://img.shields.io/github/release/ethauvin/akismet-kotlin.svg)](https://github.com/ethauvin/akismet-kotlin/releases/latest)\n[![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/akismet-kotlin?label=snapshot\u0026server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/akismet-kotlin/)\n[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/akismet-kotlin.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/akismet-kotlin)\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_akismet-kotlin\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_akismet-kotlin)\n[![GitHub CI](https://github.com/ethauvin/akismet-kotlin/actions/workflows/bld.yml/badge.svg)](https://github.com/ethauvin/akismet-kotlin/actions/workflows/bld.yml)\n[![CircleCI](https://circleci.com/gh/ethauvin/akismet-kotlin/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/akismet-kotlin/tree/master)\n\n# [Akismet](https://www.akismet.com) for Kotlin, Java and Android\n\nA pretty complete and straightforward implementation of the [Automattic's Akismet](https://akismet.com/development/api/) API, a free service which can be used to actively stop comments spam.\n\n## Examples (TL;DR)\n\n### Kotlin\n\n```kotlin\nval akismet = Akismet(apiKey = \"YOUR_API_KEY\", blog = \"YOUR_BLOG_URL\")\nval comment = AkismetComment(userIp = \"127.0.0.1\", userAgent = \"curl/7.29.0\").apply {\n    referrer = \"https://www.google.com\"\n    type = CommentType.COMMENT\n    author = \"admin\"\n    authorEmail = \"test@test.com\"\n    authorUrl = \"https://www.CheckOutMyCoolSite.com\"\n    dateGmt = Akismet.dateToGmt(Date())\n    content = \"Thanks for reviewing our software.\"\n}\n// ...\n\nval isSpam = akismet.checkComment(comment)\nif (isSpam) {\n    // ...\n}\n```\n\n[View Full Examples](https://github.com/ethauvin/akismet-kotlin/blob/master/examples)\n\n### Java\n\n```java\nfinal Akismet akismet = new Akismet(\"YOUR_API_KEY\", \"YOUR_BLOG_URL\");\nfinal AkismetComment comment = new AkismetComment(\n    new CommentConfig.Builder(\"127.0.0.1\", \"curl/7.29.0\")\n            .referrer(\"https://www.google.com\")\n            .type(CommentType.COMMENT)\n            .author(\"admin\")\n            .authorEmail(\"test@test.com\")\n            .authorUrl(\"https://www.CheckOutMyCoolSite.com\")\n            .dateGmt(Akismet.dateToGmt(new Date()))\n            .content(\"Thanks for reviewing our software.\")\n            .build\n);\n//...\n\nfinal boolean isSpam = akismet.checkComment(comment);\nif (isSpam) {\n    // ...\n}\n```\n\n[View Full Examples](https://github.com/ethauvin/akismet-kotlin/blob/master/examples)\n\n## bld\n\nTo use with [bld](https://rife2.com/bld), include the following dependency in your [build](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/bld/src/bld/java/com/example/ExampleBuild.java) file:\n\n```java\nrepositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);\n\nscope(compile)\n    .include(dependency(\"net.thauvin.erik:akismet-kotlin:1.1.0-SNAPSHOT\"));\n```\n\n## Gradle\n\nTo use with [Gradle](https://gradle.org/), include the following dependency in your [build](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/gradle/build.gradle.kts) file:\n\n```gradle\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"net.thauvin.erik:akismet-kotlin:1.1.0-SNAPSHOT\")\n}\n```\n\nInstructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://central.sonatype.com/artifact/net.thauvin.erik/akismet-kotlin).\n\n## HttpServletRequest\n\nThe more information is sent to Akismet, the more accurate the response is. An [HttpServletRequest](https://javaee.github.io/javaee-spec/javadocs/javax/servlet/http/HttpServletRequest.html) can be used as a parameter so that all the relevant information is automatically included.\n\n```kotlin\nAkismetComment(request = context.getRequest())\n```\n\nThis will ensure that the user's IP, agent, referrer and various environment variables are automatically extracted from the request.\n\n[View Full Example](https://github.com/ethauvin/akismet-kotlin/blob/master/examples/gradle/src/main/kotlin/com/example/AkismetServlet.kt)\n\n## JSON\n\nSince comments mis-identified as spam or ham can be submitted to Askimet to improve the service. A comment can be saved as a JSON object to be stored in a database, etc.\n\n```kotlin\nvar json = comment.toJson()\n```\n\nAt a latter time, the comment can then be submitted:\n\n```kotlin\nakismet.submitSpam(Akismet.jsonComment(json))\n```\n\n## Contributing\n\nIf you want to contribute to this project, all you have to do is clone the GitHub\nrepository:\n\n```console\ngit clone git@github.com:ethauvin/akismet-kotlin.git\n```\n\nThen use [bld](https://rife2.com/bld) to build:\n\n```console\ncd akismet-kotlin\n./bld compile\n```\n\nThe project has an [IntelliJ IDEA](https://www.jetbrains.com/idea/) project structure. You can just open it after all the dependencies were downloaded and peruse the code.\n\n### More…\n\nIf all else fails, there's always more [Documentation](https://ethauvin.github.io/akismet-kotlin/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethauvin%2Fakismet-kotlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethauvin%2Fakismet-kotlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethauvin%2Fakismet-kotlin/lists"}