1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax http.server.filters kernel
4 multiline furnace.actions furnace.alloy furnace.conversations ;
9 { "responder" "a responder" }
10 { "recaptcha" recaptcha }
12 { $description "A " { $link filter-responder } " wrapping another responder. Set the domain, public, and private keys using the key you get by registering with recaptcha." } ;
15 { $var-description "Set to the error string returned by the recaptcha server." } ;
17 HELP: validate-recaptcha
18 { $description "Validates a recaptcha using the recaptcha web service API." } ;
20 ARTICLE: "recaptcha-example" "Recaptcha example"
21 "There are several steps to using the recaptcha library."
23 { "Wrap the responder in a " { $link <recaptcha> } }
24 { "Wrap the responder in an " { $link <alloy> } " if it is not already, to enable conversations and database access" }
25 { "Call " { $link validate-recaptcha } " from the " { $slot "validate" } " slot of the " { $link action } }
26 { "Put the chloe tag " { $snippet "<recaptcha/>" } " inside a form tag in the template served by your " { $link action } }
29 "There is an example web app using recaptcha support:"
31 "USING: furnace.recaptcha.example http.server ;"
32 "<recaptcha-app> main-responder set-global"
36 ARTICLE: "furnace.recaptcha" "Recaptcha support for Furnace"
37 "The " { $vocab-link "furnace.recaptcha" } " vocabulary implements support for the recaptcha. Recaptcha is a web service that provides the user with a captcha, a test that is easy to solve by visual inspection, but hard to solve by writing a computer program. Use a captcha to protect forms from abusive users." $nl
39 "The recaptcha responder is a " { $link filter-responder } " that wraps another responder. Set the " { $slot "domain" } ", " { $slot "public-key" } ", and " { $slot "private-key" } " slots of this responder to your recaptcha account information." $nl
41 "Wrapping a responder with recaptcha support:"
42 { $subsections <recaptcha> }
43 "Validating recaptcha:"
44 { $subsections validate-recaptcha }
45 "Symbol set after validation:"
46 { $subsections recaptcha-error }
48 { $subsections "recaptcha-example" } ;
50 ABOUT: "furnace.recaptcha"