summaryrefslogtreecommitdiff
path: root/main.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-10-07 18:44:13 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-10-07 18:44:13 +0200
commitb5c357c081a4901c892ab0e61e33ab94ade98086 (patch)
treefcc2b13bf09d5b7cb0c4be6489645aa8cdae9355 /main.lisp
parente6b65cb7b6c16d1fb9ecb86260dddb1fc0c4b115 (diff)
Make use of Akismet for spam detection.
darcs-hash:8828531ab148ca71cca0a0dbef7733717834cbb4
Diffstat (limited to 'main.lisp')
-rw-r--r--main.lisp33
1 files changed, 32 insertions, 1 deletions
diff --git a/main.lisp b/main.lisp
index 90487cd..bbc08e6 100644
--- a/main.lisp
+++ b/main.lisp
@@ -62,6 +62,10 @@
(:mst-plus *script-dir*)
(:nfs.net #p"/home/protected/journal/")))
(*cache-dir* (merge-pathnames #p"cache/" *data-dir*))
+ (*wordpress-key* (with-open-file (file (merge-pathnames
+ "wordpress-api-key.key"
+ *data-dir*))
+ (read-line file)))
(database-file (merge-pathnames #p"journal.sqlite3" *data-dir*))
(sqlite-library (merge-pathnames #p"libsqlite3.so"
(ecase *site*
@@ -126,8 +130,35 @@
:author (getf *query* :author)
:email (getf *query* :email)
:website (getf *query* :website)
- :body (getf *query* :comment-body))))
+ :body (getf *query* :comment-body)
+ :submitter-ip (gethash "REMOTE_ADDR" *http-env*)
+ :submitter-user-agent (gethash "HTTP_USER_AGENT" *http-env*))))
(push comment (comments-about entry))
+ (with-slots (spam-p) comment
+ (setq spam-p (detect-spam comment
+ :referrer (gethash "HTTP_REFERER" *http-env*)))
+ (when spam-p
+ (push (format nil
+ "<p>Ihr Kommentar wurde als ~
+ m&ouml;gliche unerw&uuml;nschte ~
+ Werbung (Spam) klassifiert. Der ~
+ Inhaber dieses Journals wird Ihre ~
+ Nachricht manuell moderieren ~
+ m&uuml;ssen, weshalb eine ~
+ Ver&ouml;ffentlichung noch etwas ~
+ auf sich warten lassen kann.</p> ~
+ ~
+ <p>Wenn Sie ganz sichergehen ~
+ wollen, da&szlig; Ihr Beitrag ~
+ ver&ouml;ffentlicht wird, dann ~
+ k&ouml;nnen Sie versuchen, ihn ~
+ abzu&auml;ndern und erneut ~
+ einzuschicken.</p>~
+ ~
+ <p>Hinweis: Diese Website verwendet ~
+ <a href=\"http://akismet.com/\">Akismet</a> ~
+ f&uuml;r die Spamerkennung.</p>")
+ *journal-warnings*)))
(update-records-from-instance comment)
(update-records-from-instance entry)))
(show-web-journal))