Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simple cleanup of the code
  • Loading branch information
madnificent committed May 5, 2009
1 parent a625bfa commit 457710c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.textile
@@ -1,3 +1,4 @@
h1. cl-recaptcha

cl-recaptcha is a simple interconnection between recaptcha.net and common-lisp. It can be used for the trivial usage of the recaptcha service.
cl-recaptcha is a simple interconnection between recaptcha.net and common-lisp. It can be used for the trivial usage of the recaptcha service.

2 changes: 1 addition & 1 deletion cl-recaptcha.asd
Expand Up @@ -3,7 +3,7 @@

(in-package :cl-recaptcha.sysdef)

(defsystem :cl-recaptcha.sysdef
(defsystem :cl-recaptcha
:name "CL Recaptcha"
:author "Aad Versteden <madnificent@gmail.com>"
:version "0"
Expand Down
5 changes: 5 additions & 0 deletions code.lisp
Expand Up @@ -6,6 +6,7 @@
:*public-captcha-key*
:challenge-js
:challenge-ns
:challenge
:challenge-ajax-src
:verify-captcha))

Expand All @@ -29,6 +30,10 @@
(format nil
"<script type=\"text/javascript\" src=\"~A\"></script>" *js-source*))

(defun challenge (&optional (public-key *public-captcha-key*))
"This is the simplest way. It combines the script and the noscript version."
(concatenate 'string (challenge-js public-key) (challenge-ns public-key)))

(defun verify-captcha ( recaptcha-challenge-field recaptcha-response-field remote-ip &key (private-key *private-captcha-key*) )
"Verifies the result the user gave. There are two values returned. The first indicates the success or failure, the second indicates the error code the captcha-server gave."
(let ((response
Expand Down

0 comments on commit 457710c

Please sign in to comment.