Cleanup.
This commit is contained in:
parent
32fd9c3c57
commit
6f47f40bd1
5 changed files with 124 additions and 115 deletions
|
@ -6,7 +6,7 @@ import java.util.Date
|
|||
import kotlin.system.exitProcess
|
||||
|
||||
fun main() {
|
||||
val akismet = Akismet("YOUR_API_KEY", "http://yourblogdomainname.com/blog/")
|
||||
val akismet = Akismet(apiKey = "YOUR_API_KEY", blog = "http://yourblogdomainname.com/blog/")
|
||||
val comment = AkismetComment(userIp = "127.0.0.1", userAgent = "curl/7.29.0")
|
||||
|
||||
with(comment) {
|
||||
|
|
|
@ -5,10 +5,12 @@ import net.thauvin.erik.akismet.AkismetComment
|
|||
import java.io.IOException
|
||||
import java.util.Date
|
||||
import javax.servlet.ServletException
|
||||
import javax.servlet.annotation.WebServlet
|
||||
import javax.servlet.http.HttpServlet
|
||||
import javax.servlet.http.HttpServletRequest
|
||||
import javax.servlet.http.HttpServletResponse
|
||||
|
||||
@WebServlet(description = "Akismet Servlet", displayName = "Akismet", urlPatterns = ["/comment/*"])
|
||||
class AkismetServlet : HttpServlet() {
|
||||
private val akismet = Akismet("YOUR_API_KEY", "http://yourblogdomainname.com/blog/")
|
||||
|
||||
|
@ -17,7 +19,7 @@ class AkismetServlet : HttpServlet() {
|
|||
val id = request.getParameter("id")
|
||||
|
||||
akismet.appUserAgent = request.servletContext.serverInfo
|
||||
|
||||
|
||||
val comment = AkismetComment(request)
|
||||
with(comment) {
|
||||
permalink = "${akismet.blog}/comment/$id"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue