recaptcha-8.05.26/0000755000175000017500000000000011016734047012373 5ustar yuriyurirecaptcha-8.05.26/lua/0000755000175000017500000000000011016733026013150 5ustar yuriyurirecaptcha-8.05.26/lua/luadoc.log0000644000175000017500000000034011016733026015117 0ustar yuriyuriTue May 27 00:14:41 2008 INFO processing file `recaptcha.lua' Tue May 27 00:14:41 2008 DEBUG found module `...' Tue May 27 00:19:51 2008 INFO processing file `recaptcha.lua' Tue May 27 00:19:51 2008 DEBUG found module `...' recaptcha-8.05.26/lua/recaptcha.lua0000644000175000017500000000733211016733026015612 0ustar yuriyurimodule(..., package.seeall) ----------------------------------------------------------------------------- -- ReCaptcha (http://recaptcha.net/) is a free captcha web service that -- shows the visitors words from old books helping digitize them. This, -- module provides a Lua interface to recaptcha. You will need to get your -- own API key from recaptcha.net to use it. -- -- See http://sputnik.freewisdom.org/lib/recaptcha -- License: MIT/X -- (c) 2008 Yuri Takhteyev ----------------------------------------------------------------------------- local ReCaptcha = {} local ReCaptcha_mt = {__metatable = {}, __index = ReCaptcha} ----------------------------------------------------------------------------- -- Creates a new ReCaptcha object. -- -- @param args a single argument with two fields: the private API -- key and the public API key. -- @return an instance of ReCaptcha. ----------------------------------------------------------------------------- function new(args) local obj = setmetatable({}, ReCaptcha_mt) obj.private = args[2] obj.public = args[1] return obj end ----------------------------------------------------------------------------- -- Returns a table of names of fields posted by the captcha widget. -- -- @return a table of field names. ----------------------------------------------------------------------------- function ReCaptcha:get_fields() return {"recaptcha_challenge_field", "recaptcha_response_field"} end ----------------------------------------------------------------------------- -- Returns the html block that creates the ReCaptcha widget. -- -- @param options a table of options. -- @return a string containing JavaScript and HTML for -- inclusion in an HTML document. ----------------------------------------------------------------------------- function ReCaptcha:get_html(options) options = options or {} return string.format([[ ]], options.theme or "white", options.lang or "en", self.public, self.public) end ----------------------------------------------------------------------------- -- Verifies the captcha. -- -- @param params the table of POST parameters submitted by the client. -- @param remote_ip user's IP address. -- @return true if the verification is successful and false -- otherwise. ----------------------------------------------------------------------------- function ReCaptcha:verify(params, remote_ip) require("socket.http") local result, err = socket.http.request( "http://api-verify.recaptcha.net/verify", "privatekey="..self.private .."&remoteip="..remote_ip .."&challenge="..params.recaptcha_challenge_field .."&response="..(params.recaptcha_response_field or "") ) if not result then return false, err else if result=="true" then return true else result, err = string.match(result, "(%w+)\n(.*)") return (result and result=="true"), err end end end recaptcha-8.05.26/petrodoc~0000644000175000017500000000423511016733026014333 0ustar yuriyuripackage = 'ReCaptcha' versions = { {'8.05.26', 'May 26, 2008', 'the initial release'}, } summary = 'A Lua interface to reCaptcha.' maintainer = 'Yuri Takhteyev (yuri@freewisdom.org)' detailed = [[ reCaptcha is a free captcha web service that shows the visitors words from old books helping digitize them. This, module provides a Lua interface to recaptcha. You will need to get your own API key from recaptcha.net to use it. ]] license = 'MIT/X11' homepage = 'http://sputnik.freewisdom.org/lib/recaptcha/' favicon = 'http://media.freewisdom.org/etc/recaptcha.ico' download = 'http://sputnik.freewisdom.org/files/recaptcha-$version.tar.gz' --download = "/tmp/versium-$version.tar.gz" push = "scp %s yuri@web10.webfaction.com:~/webapps/static/files/" --push = "cp %s /tmp/" logo = 'recaptcha.png' keywords = 'lua, recaptcha, captcha' rss = homepage.."releases.rss" -------------------------------------------------------------------------------- dependencies = [[ 'luasocket >= 2.0' ]] -------------------------------------------------------------------------------- Installation = [[ The Lua interface Recaptcha to recaptcha consists of a single file (recaptcha.lua) of less than 100 lines, plus a test script (tests/recaptcha.cgi) which is meant to be used with WSAPI. Here is a list of recent releases: You can also install it using LuaRocks with luarocks install recaptcha or: luarocks --from http://sputnik.freewisdom.org/rocks/earth install recaptcha ]] TOC = { { "Overview", "

"..detailed.."

" }, { "Installation", markdown(Installation) }, { "Using Recaptcha", markdown(include("doc/howto.md")) }, { "Contact", "Please contact Yuri Takhteyev (yuri -at- freewisdom.org) with any questions."}, { "LuaDoc", make_luadoc{"recaptcha.lua"} }, { "License", markdown(include("LICENSE.txt")) } } ------------------------------------------------------------------------------- recaptcha-8.05.26/recaptcha/0000755000175000017500000000000011016734047014325 5ustar yuriyurirecaptcha-8.05.26/recaptcha/lua/0000755000175000017500000000000011016734047015106 5ustar yuriyurirecaptcha-8.05.26/recaptcha/lua/luadoc.log0000644000175000017500000000106011016734662017060 0ustar yuriyuriTue May 27 00:14:41 2008 INFO processing file `recaptcha.lua' Tue May 27 00:14:41 2008 DEBUG found module `...' Tue May 27 00:19:51 2008 INFO processing file `recaptcha.lua' Tue May 27 00:19:51 2008 DEBUG found module `...' Tue May 27 00:28:40 2008 INFO processing file `recaptcha.lua' Tue May 27 00:28:40 2008 DEBUG found module `...' Tue May 27 00:29:41 2008 INFO processing file `recaptcha.lua' Tue May 27 00:29:41 2008 DEBUG found module `...' Tue May 27 00:35:14 2008 INFO processing file `recaptcha.lua' Tue May 27 00:35:14 2008 DEBUG found module `...' recaptcha-8.05.26/recaptcha/lua/recaptcha.lua0000644000175000017500000000733211016734662017553 0ustar yuriyurimodule(..., package.seeall) ----------------------------------------------------------------------------- -- ReCaptcha (http://recaptcha.net/) is a free captcha web service that -- shows the visitors words from old books helping digitize them. This, -- module provides a Lua interface to recaptcha. You will need to get your -- own API key from recaptcha.net to use it. -- -- See http://sputnik.freewisdom.org/lib/recaptcha -- License: MIT/X -- (c) 2008 Yuri Takhteyev ----------------------------------------------------------------------------- local ReCaptcha = {} local ReCaptcha_mt = {__metatable = {}, __index = ReCaptcha} ----------------------------------------------------------------------------- -- Creates a new ReCaptcha object. -- -- @param args a single argument with two fields: the private API -- key and the public API key. -- @return an instance of ReCaptcha. ----------------------------------------------------------------------------- function new(args) local obj = setmetatable({}, ReCaptcha_mt) obj.private = args[2] obj.public = args[1] return obj end ----------------------------------------------------------------------------- -- Returns a table of names of fields posted by the captcha widget. -- -- @return a table of field names. ----------------------------------------------------------------------------- function ReCaptcha:get_fields() return {"recaptcha_challenge_field", "recaptcha_response_field"} end ----------------------------------------------------------------------------- -- Returns the html block that creates the ReCaptcha widget. -- -- @param options a table of options. -- @return a string containing JavaScript and HTML for -- inclusion in an HTML document. ----------------------------------------------------------------------------- function ReCaptcha:get_html(options) options = options or {} return string.format([[ ]], options.theme or "white", options.lang or "en", self.public, self.public) end ----------------------------------------------------------------------------- -- Verifies the captcha. -- -- @param params the table of POST parameters submitted by the client. -- @param remote_ip user's IP address. -- @return true if the verification is successful and false -- otherwise. ----------------------------------------------------------------------------- function ReCaptcha:verify(params, remote_ip) require("socket.http") local result, err = socket.http.request( "http://api-verify.recaptcha.net/verify", "privatekey="..self.private .."&remoteip="..remote_ip .."&challenge="..params.recaptcha_challenge_field .."&response="..(params.recaptcha_response_field or "") ) if not result then return false, err else if result=="true" then return true else result, err = string.match(result, "(%w+)\n(.*)") return (result and result=="true"), err end end end recaptcha-8.05.26/recaptcha/petrodoc~0000644000175000017500000000423511016734662016274 0ustar yuriyuripackage = 'ReCaptcha' versions = { {'8.05.26', 'May 26, 2008', 'the initial release'}, } summary = 'A Lua interface to reCaptcha.' maintainer = 'Yuri Takhteyev (yuri@freewisdom.org)' detailed = [[ reCaptcha is a free captcha web service that shows the visitors words from old books helping digitize them. This, module provides a Lua interface to recaptcha. You will need to get your own API key from recaptcha.net to use it. ]] license = 'MIT/X11' homepage = 'http://sputnik.freewisdom.org/lib/recaptcha/' favicon = 'http://media.freewisdom.org/etc/recaptcha.ico' download = 'http://sputnik.freewisdom.org/files/recaptcha-$version.tar.gz' --download = "/tmp/versium-$version.tar.gz" push = "scp %s yuri@web10.webfaction.com:~/webapps/static/files/" --push = "cp %s /tmp/" logo = 'recaptcha.png' keywords = 'lua, recaptcha, captcha' rss = homepage.."releases.rss" -------------------------------------------------------------------------------- dependencies = [[ 'luasocket >= 2.0' ]] -------------------------------------------------------------------------------- Installation = [[ The Lua interface Recaptcha to recaptcha consists of a single file (recaptcha.lua) of less than 100 lines, plus a test script (tests/recaptcha.cgi) which is meant to be used with WSAPI. Here is a list of recent releases: You can also install it using LuaRocks with luarocks install recaptcha or: luarocks --from http://sputnik.freewisdom.org/rocks/earth install recaptcha ]] TOC = { { "Overview", "

"..detailed.."

" }, { "Installation", markdown(Installation) }, { "Using Recaptcha", markdown(include("doc/howto.md")) }, { "Contact", "Please contact Yuri Takhteyev (yuri -at- freewisdom.org) with any questions."}, { "LuaDoc", make_luadoc{"recaptcha.lua"} }, { "License", markdown(include("LICENSE.txt")) } } ------------------------------------------------------------------------------- recaptcha-8.05.26/recaptcha/doc/0000755000175000017500000000000011016734047015072 5ustar yuriyurirecaptcha-8.05.26/recaptcha/doc/howto.md~0000644000175000017500000000150011016734662016751 0ustar yuriyuri ## Creating the catpcha object You will need to get your PRIVATE and PUBLIC API keys from recaptcha. Once you have them, create an instance or ReCaptcha like this: captcha = recaptcha.new{PRIVATE, PUBLIC} ## Generating the Widget Include the output of captcha:get_html() into your form. For instance: my_html = "
" .. "..." -- add your fields .. captcha:get_html() .. "" .. "
" ## Verifying user's input Send your POST fields and the user's IP address to captcha:verify(). For instance, for WSAPI: local request = wsapi.request.new(wsapi_env) local ok, err = captcha:verify(request.POST, wsapi_env.REMOTE_ADDR) if ok then ... else print ("Error: "..err) end recaptcha-8.05.26/recaptcha/doc/recaptcha.png0000644000175000017500000001743511016734662017547 0ustar yuriyuriPNG  IHDR^;sRGBbKGD pHYs  tIME/0M tEXtCommentCreated with The GIMPd%ntIDATx{\e C*HbFb[yCeV{Pj㛇Yfg55!JC5K,I* #M=< ss߿F#1\zAb"A 1 HLAb"D$& 1Ab"AD HLAb"A$& 1 AD$& HLAb"A((FxTGʠPA,F^^eq!zB$rC`Q=DKVV! @GpW5JIɅZ]Ze2BB|绐ƋFCJJ.u5:H䆨-(r@6[g5եHKՠJFڦyyEPƅRAN*te$& kzwHLD+1!BQDb"]ًuPJILDçX_Бa6lz ht&0 B!IOCbo|ju)TR,Z"B,vHkb[DJˣP!/uӦ@cVE"7{B*Ֆ D"7ar Ž:}ëեPKqRG"뢢7D1Q+f\FNx>RO{9dwVH-#,^ \.+BW׳ )#C \e\XB*cq2V‰G @L, M=q%si|JiifD #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D$& 1Ab"A 1 HLAb"D$& 1 AD HLAb"A$& 1 HLAD$& HLAb"A 1 HLAD$& 1Ab"A8Bh*xIENDB`recaptcha-8.05.26/recaptcha/doc/recaptcha.ico0000644000175000017500000000217611016734662017531 0ustar yuriyuri h(  tttetttttt3tttdtttttttttttttttttltbtttttt"ttitttt tt tctttttttttEtgttvttt!tttttttitttftttttttt(tttttttttttttttttntttt tttttwtHtrecaptcha.net. Once you have them, create an instance or ReCaptcha like this: captcha = recaptcha.new{PRIVATE, PUBLIC} ## Generating the Widget Include the output of captcha:get_html() into your form. For instance: my_html = "
" .. "..." -- add your fields .. captcha:get_html() .. "" .. "
" ## Verifying user's input Send your POST fields and the user's IP address to captcha:verify(). For instance, for WSAPI: local request = wsapi.request.new(wsapi_env) local ok, err = captcha:verify(request.POST, wsapi_env.REMOTE_ADDR) if ok then ... else print ("Error: "..err) end recaptcha-8.05.26/recaptcha/doc/index.html0000644000175000017500000001660211016734662017077 0ustar yuriyuri ReCaptcha

Overview

reCaptcha is a free captcha web service that shows the visitors words from old books helping digitize them. This, module provides a Lua interface to recaptcha. You will need to get your own API key from recaptcha.net to use it.

Installation

The Lua interface Recaptcha to recaptcha consists of a single file (recaptcha.lua) of less than 100 lines, plus a test script (tests/recaptcha.cgi) which is meant to be used with WSAPI. Here is a list of recent releases:

You can also install it using LuaRocks with

luarocks install recaptcha

or:

luarocks --from=http://sputnik.freewisdom.org/rocks/earth install recaptcha

Using Recaptcha

Creating the catpcha object

You will need to get your PRIVATE and PUBLIC API keys from recaptcha.net. Once you have them, create an instance or ReCaptcha like this:

captcha = recaptcha.new{PRIVATE, PUBLIC}

Generating the Widget

Include the output of captcha:get_html() into your form. For instance:

my_html = "<form action='...' method='post'...>"
          .. "..." -- add your fields
          .. captcha:get_html()
          .. "<input type='submit'/>"
          .. "</form>"

Verifying user's input

Send your POST fields and the user's IP address to captcha:verify(). For instance, for WSAPI:

local request = wsapi.request.new(wsapi_env)
local ok, err = captcha:verify(request.POST, wsapi_env.REMOTE_ADDR)

if ok then
   ...
else
   print ("Error: "..err)
end

Contact

Please contact Yuri Takhteyev (yuri -at- freewisdom.org) with any questions.

LuaDoc

recaptcha

ReCaptcha:get_fields() Returns a table of names of fields posted by the captcha widget.
Returns: a table of field names.
ReCaptcha:get_html() Returns the html block that creates the ReCaptcha widget.
options:
a table of options.
Returns: a string containing JavaScript and HTML for inclusion in an HTML document.
ReCaptcha:verify() Verifies the captcha.
params:
the table of POST parameters submitted by the client.
remote_ip:
user's IP address.
Returns: true if the verification is successful and false otherwise.
new() Creates a new ReCaptcha object.
args:
a single argument with two fields: the private API key and the public API key.
Returns: an instance of ReCaptcha.

License

Copyright (c) 2008 Yuri Takhteyev

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

recaptcha-8.05.26/recaptcha/doc/recaptcha.xcf0000644000175000017500000007703411016734662017544 0ustar yuriyurigimp xcf fileBBfS gimp-commentCreated with The GIMPgimp-image-grid(style intersections) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches) &;Wzr|E Recaptcha2     eq&#&/'7G6#%%&& 9887668 ) % %   9 8 8 7 6 6 8  )  %  %                    h9h8h8h7h6h6h8h h)h h%h h%h hhhhhhhhhhhhhhhhhh ~tj87 7656 N8 ( P% V% 6J* 4\    !(9<<6 1/**!                         "/49                                                              !   ( 9 <  < 6 1 /  *  *  !                                                                              "   /  4  9hhhhh hhhhh hhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhh!hhh(h9h<hh<h6 h1h/hhhh*hh*hh!hhhhh hhh hhhhh hhhhh hhhhhhhh h hhhhh h hhhh h hhhhhhh hhhh hhh hhh hhhhhhhhhh hh h h hhh h hhhhh h h hhhh h hhh"hhh/hh4hh9h XC2" |PAU VN/6 N&A!$' NOv3,S .[gK^+3+kg(5ω$V3- Y}. (R\8e;l<k5ۿӮrS0_Jv,.y*%W)bqW gW%i7WJJH W|7<MJ |W^3 >W m$ J HA > kzTd3C,8!!!\? 7  s5%,zcn|   6? Nt3.Ǻ  J. | `$jqUX!~b /48?==;;::99::::999:::=?<::9 , * & !              $ 3 ? = = ; ; : : 9 9 : : : : 9 9 9 : : : = ? < : : 9 ,  *  & !                                                                                  $  3 ?h=h=h;h;h:h:h9h9h:h:h:h:h9h9h9h:h:h:h=h?h<h:h:h9h h,h h*h h&h h!h hhhh hhhh hhhh hhh hhhhhhhhh hhhhhhhhh hhhhhhhhh hhhhhhhhhhhh hhhhhhh hhhhhh hhhhh hhhhhhhhh hhhh hhhhhhhhhhhh$h h3 h?=<D : :y9e98z8::::9F99.::"29C<Q> ; 9U98 ,b * :&w J!3 ntِ8}_  HM#%1 Y,w Y!CC(H] C7Ct!_. # # j?H#E * 24-                   " 4 -                                                                                     " h4h-hhh hh hh hhhhh hhhh hhhhh hhhhh hhhh hhh hhhh hhh hhhhh hhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhh h hhhhhhhhhh hh hh h"h3,# UW ! ,W<! _JvW %W w3W bW 8} |>  C JC1YCC,!\7  ? !!#|&!!8j%3.7!U"q`                 `                     `hhhhh h h h h h h h h h h h h h h h h h`   b     _ w  H  (!Ct   H @ @ @ @ @ @ @ @ @ @ @ @iX4, Recaptcha     Y&&WW'9)***:>GTWWWW 3 678999       3 6 7 8 9 9 9                                                   h3 h6h7h8h9h9h9h hhhh hhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhh hhhhh hhhh @<:::::::::: @ < : : : : : : : : : : @h<h:h:h:h:h:h:h:h:h:h:   M 3 67899            j .,+** )              @                      M 3 6 7 8 9 9                                                                                                         j  . ,  +  *  *  )                                                                    @hhhhhhhhhhh hhhhh hhhh hhhhhM h3 h6h7h8h9h9h hhh hh hh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh h hhhhhh hhhhhhhhh hhhhh hhh hh hhj hh.h,hh+hh*hh*h h)h hhhhhh hh hh hhhh hhhhhhhhhhhhhhhhhhhhhh hhh hhh h hhhhhh hhhhhhhhh hhhhh hhh hh hh@j2  567999 6 h VJ*2"U ADC PNA,z' X3 |v VN^( $O-F  !NKg\ $+.[+Y. gkωV3Rlk,W-_JvW+%W*W)bW) W( |W J7 >3JHJm7<MHd3Tk! ,?CC\7    ?!s ,5%|  n3.tUJ. qb@::88                            H                       C : : 8 8                                                                                             H                                                                                                  Ch:h:h8h8hh hhh hhh hhh hhhhh h hhhhh h hhhhh h hhhhh h hhhhh h hhhhh h hhhhhh hhhhh hh hhh h hhh h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh h hh hh h hHh hhh hhhhh hhhhhhh hhhhhhh hhhhhhh hhhhhhh hhhhhhh hhhhhh h hhh hhh hhhhh hh hhh h hhh h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh h hh hh h hC@€ ;y9e999::::::::2C77"Q ِ :nt#% J&MYU b H  5 ش   w3 ] _ ,8}_w.  ˖# 1H(Y !CCt7?**##H jE B                             B                             C                                                                                                   B                                                                                                   Ch hh hh h hh h h hhhhh hhhhh hhhhh hh hhh hh hhh hh hhh hhhh hhhh hhhh hhh hhhhhhhhhhhhhhhhhhhhhh hhhhh hhhh hhhhh hhhhh h h hh h hhhBh hh hh h hh h h hhhhh hhhhh hhhhh hh hhh hh hhh hh hhh hhhh hhhh hhhh hhh hhhhhhhhhhhhhhhhhhhhhh hhhhh hhhh hhhhh hhhhh h h hh h hhhC k,W _JvW<   %W.!!# W UbW  W  |W  > J w3 _C 8} ,1\YCC ?! 7%| 3.&!!! U7!!8# qbjB                                d                                              dhhhhhhh h h h h h h h h h h h h h h h hhhhhhhh h h h h h h h h h h h h h h h hd b  5     w  H ( !Ct     Hc @ @ @ @ @ @ @ @ @ @ @ @iX4, New LayerG     XXzZzfY[^f%f5kowNw^xyzJ$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ݻww+wDDw#݈33DD" "ww$w"("U,U . w1 f233343)Uw33(f"D'w'3''D'D( ݻww+wDDw#݈33DD" "ww$w"("U,U . w1 f233343)Uw33(f"D'w'3''D'D( Ļ+ջ#ę̢đ $ݑ(, ݈. 1 234)ܺ(Ԑ'''''( @$$$$$$$$$$$ Uf  " 3 f"33UfwUw"wfwDwwww3fw"wDfw3fUf w 3DD 3wD"D 3 3fD w wDDf$$$$$$$$$$$ Uf  " 3 f"33UfwUw"wfwDwwww3fw"wDfw3fUf w 3DD 3wD"D 3 3fD w wDDf$$$$$$$$$$$ ̪  Ĉ    ݢ 滢   $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#w##$f$%%w%3%&&&w&U&D&D&"&(((D&D&D&f&w&&&%U%%%"$w$$3##$$$$$$$$$$$$$$$$$$$$$$$$$$$$#w##$f$%%w%3%&&&w&U&D&D&"&(((D&D&D&f&w&&&%U%%%"$w$$3##$$$$$$$$$$$$$$$$$$$$$$$$$$$$#########$$$$$$$$$$$$$$$$$$#########$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'"w(w)f)++++w+3,,U--.3 /" 0D1f݈D"==<<D;;w:39887w6f5w4 3 1 30 f.f "*"w(wf$fwwUD݈UU '"w(w)f)++++w+3,,U--.3 /" 0D1f݈D"==<<D;;w:39887w6f5w4 3 1 30 f.f "*"w(wf$fwwUD݈UU '())+++++,,--. / 0ܡ1á==<<;;:9887654 3 ̈1 0 . ݑ*($̪Ī fDDfDfDUf  U w 3 ++w+D+D+D+,,,+"+D+D+U+w+++*D**)")w)(3('"'&&%D%$w#3""! wff 3!"$$$$$$fDDfDfDUf  U w 3 ++w+D+D+D+,,,+"+D+D+U+w+++*D**)")w)(3('"'&&%D%$w#3""! wff 3!"$$$$$$               !"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$̈wDDw0T̈wDDw0TĻ0T$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$iX4,White2     {{1|-|9{m{}{{{{{{{{| | @ @ @ @ @ @ @ @ @ @ @ @iX4, Background     |}~~}D}T}d}t}}}}}}}} @ @ @ @ @ @ @ @ @ @ @ @iX4,recaptcha-8.05.26/recaptcha/doc/releases.rss0000644000175000017500000000067611016734662017442 0ustar yuriyuri ReCaptcha http://sputnik.freewisdom.org/lib/recaptcha/ http://sputnik.freewisdom.org/files/recaptcha-$version.tar.gz ReCaptcha 8.05.26 http://sputnik.freewisdom.org/files/recaptcha-8.05.26.tar.gz the initial release recaptcha-8.05.26/recaptcha/rockspec0000644000175000017500000000145411016734662016070 0ustar yuriyuripackage = "ReCaptcha" version = "8.05.26-0" source = { url = "http://sputnik.freewisdom.org/files/recaptcha-8.05.26.tar.gz", } description = { summary = "A Lua interface to reCaptcha.", detailed = [===[ reCaptcha is a free captcha web service that shows the visitors words from old books helping digitize them. This, module provides a Lua interface to recaptcha. You will need to get your own API key from recaptcha.net to use it. ]===], license = "MIT/X11", homepage = "http://sputnik.freewisdom.org/lib/recaptcha/", maintainer = "Yuri Takhteyev (yuri@freewisdom.org)", } dependencies = { 'luasocket >= 2.0' } build = { type = "none", install = { lua = { ["recaptcha"] = "lua/recaptcha.lua", } } } recaptcha-8.05.26/recaptcha/petrodoc0000644000175000017500000000423511016734662016076 0ustar yuriyuripackage = 'ReCaptcha' versions = { {'8.05.26', 'May 26, 2008', 'the initial release'}, } summary = 'A Lua interface to reCaptcha.' maintainer = 'Yuri Takhteyev (yuri@freewisdom.org)' detailed = [[ reCaptcha is a free captcha web service that shows the visitors words from old books helping digitize them. This, module provides a Lua interface to recaptcha. You will need to get your own API key from recaptcha.net to use it. ]] license = 'MIT/X11' homepage = 'http://sputnik.freewisdom.org/lib/recaptcha/' favicon = 'http://media.freewisdom.org/etc/recaptcha.ico' download = 'http://sputnik.freewisdom.org/files/recaptcha-$version.tar.gz' --download = "/tmp/versium-$version.tar.gz" push = "scp %s yuri@web10.webfaction.com:~/webapps/static/files/" --push = "cp %s /tmp/" logo = 'recaptcha.png' keywords = 'lua, recaptcha, captcha' rss = homepage.."releases.rss" -------------------------------------------------------------------------------- dependencies = [[ 'luasocket >= 2.0' ]] -------------------------------------------------------------------------------- Installation = [[ The Lua interface Recaptcha to recaptcha consists of a single file (recaptcha.lua) of less than 100 lines, plus a test script (tests/recaptcha.cgi) which is meant to be used with WSAPI. Here is a list of recent releases: You can also install it using LuaRocks with luarocks install recaptcha or: luarocks --from=http://sputnik.freewisdom.org/rocks/earth install recaptcha ]] TOC = { { "Overview", "

"..detailed.."

" }, { "Installation", markdown(Installation) }, { "Using Recaptcha", markdown(include("doc/howto.md")) }, { "Contact", "Please contact Yuri Takhteyev (yuri -at- freewisdom.org) with any questions."}, { "LuaDoc", make_luadoc{"recaptcha.lua"} }, { "License", markdown(include("LICENSE.txt")) } } ------------------------------------------------------------------------------- recaptcha-8.05.26/recaptcha/LICENSE.txt0000644000175000017500000000204211016734662016151 0ustar yuriyuriCopyright (c) 2008 Yuri Takhteyev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. recaptcha-8.05.26/recaptcha/tests/0000755000175000017500000000000011016734662015472 5ustar yuriyurirecaptcha-8.05.26/recaptcha/tests/recaptcha.cgi0000755000175000017500000000227711016734662020123 0ustar yuriyuri#! /bin/bash /home/yuri/sputnik/bin/wsapi.cgi require("recaptcha") PRIVATE="" PUBLIC="" OWN_URL="/cgi-bin/recaptcha.cgi" -- you might need to change this captcha = recaptcha.new{PRIVATE, PUBLIC} return function(wsapi_env) require("wsapi.request") local request = wsapi.request.new(wsapi_env) local buffer = "" if request.POST.recaptcha_challenge_field then local status, err = captcha:verify(request.POST, wsapi_env.REMOTE_ADDR) buffer = "You typed in: '"..request.POST.recaptcha_response_field.."'.
" if status then buffer = buffer.."ok
" else buffer = buffer.."failed
" buffer = buffer..err.."
" end buffer = buffer.."

" end buffer = buffer..string.format([[ The captcha widget should be shown between the two lines.

%s
]], OWN_URL, captcha:get_html()) require("wsapi.response") response = wsapi.response.new() response:write(buffer) return response:finish() end recaptcha-8.05.26/recaptcha/tests/recaptcha.cgi~0000644000175000017500000000227711016734662020316 0ustar yuriyuri#! /bin/bash /home/yuri/sputnik/bin/wsapi.cgi require("recaptcha") PRIVATE="" PUBLIC="" OWN_URL="/cgi-bin/recaptcha.cgi" -- you might need to change this captcha = recaptcha.new{PRIVATE, PUBLIC} return function(wsapi_env) require("wsapi.request") local request = wsapi.request.new(wsapi_env) local buffer = "" if request.POST.recaptcha_challenge_field then local status, err = captcha:verify(request.POST, wsapi_env.REMOTE_ADDR) buffer = "You typed in: '"..request.POST.recaptcha_response_field.."'.
" if status then buffer = buffer.."ok
" else buffer = buffer.."failed
" buffer = buffer..err.."
" end buffer = buffer.."

" end buffer = buffer..string.format([[ The captcha widget should be shown between the two lines.

%s
]], OWN_URL, captcha:get_html()) require("wsapi.response") response = wsapi.response.new() response:write(buffer) return response:finish() end recaptcha-8.05.26/doc/0000755000175000017500000000000011016733026013134 5ustar yuriyurirecaptcha-8.05.26/doc/howto.md~0000644000175000017500000000157011016733026015017 0ustar yuriyuri ## Installation Lua Recaptcha is available as a rock ## Creating the catpcha object You will need to get your PRIVATE and PUBLIC API keys from recaptcha. Once you have them, create an instance or ReCaptcha like this: captcha = recaptcha.new{PRIVATE, PUBLIC} ## Generating the Widget Include the output of captcha:get_html() into your form. For instance: my_html = "
" .. "..." -- add your fields .. captcha:get_html() .. "" .. "
" ## Verifying user's input Send your POST fields and the user's IP address to captcha:verify(). For instance, for WSAPI: local request = wsapi.request.new(wsapi_env) local ok, err = captcha:verify(request.POST, wsapi_env.REMOTE_ADDR) if ok then ... else print ("Error: "..err) end recaptcha-8.05.26/doc/recaptcha.png0000644000175000017500000001743511016733026015606 0ustar yuriyuriPNG  IHDR^;sRGBbKGD pHYs  tIME/0M tEXtCommentCreated with The GIMPd%ntIDATx{\e C*HbFb[yCeV{Pj㛇Yfg55!JC5K,I* #M=< ss߿F#1\zAb"A 1 HLAb"D$& 1Ab"AD HLAb"A$& 1 AD$& HLAb"A((FxTGʠPA,F^^eq!zB$rC`Q=DKVV! @GpW5JIɅZ]Ze2BB|绐ƋFCJJ.u5:H䆨-(r@6[g5եHKՠJFڦyyEPƅRAN*te$& kzwHLD+1!BQDb"]ًuPJILDçX_Бa6lz ht&0 B!IOCbo|ju)TR,Z"B,vHkb[DJˣP!/uӦ@cVE"7{B*Ֆ D"7ar Ž:}ëեPKqRG"뢢7D1Q+f\FNx>RO{9dwVH-#,^ \.+BW׳ )#C \e\XB*cq2V‰G @L, M=q%si|JiifD #,̷ pZ~tAN`UL^fG~ {4njMm0_:#CBV۩R'L .eA*mxSJ RSΤsq!J:˚E&!,̯5Ppg ܆dQoGMpվTM7!5 'xMI ܬopBB*È|DGB&H ]H5Sd\BmCzv-V} /))V~OD"OAlfޝ{h!>Wo;Z֦b`&$>QJWju(!#OyScLb/v b/VsF!{ޯbI.EJJMAnN(u"&îuN[OS`?8B@'xYCob*-t? %hL>>+ے1uT#Puj꩘JJ8|"o%ğs`KQf¥XUY{&j&NLL:=ME ;P='X,@H;wMW_i.b~JGIC])tm zs:Xnⅅ57 ?aJr-vצ?zh̫7o޵ugJ-0Qu^o Aե*{*HN~0oNL {v5}][Zgc5 @qq6~oެ&RY\-$&sj5 C޽-Wܽ[۷"=-vޢ:v}_ }$%Ņ;`sO㹿B+'C;m"#Rh4ZV\_z@^^t2ĖluHGHMz}HX*sӦMpt,_wENN!HJLAhhn  xŊ,Q}PXx' ]TQ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ZRo-v8<-Z׮Ʒ3WU#̎.FlD r¯,| <{oTAj[D@i}YףG/2eG蝏 0ݕ"<>φՎMٯ_'-g*H9pWZA8|li"/O3-ƻ.\Aǎ2(*W5˗SO}wF6d^GLLl㏿.}a~דpgz3g1kvl1b?]H&A/,Q.hC̶ ѣun1N4*~i1wsf'!33$2| qk6LԯA,h4Mrr p`F#ĆMo[4-OEYMH<{u\Ǐ~4 ?okkjm6JBQhZì8 ϣg}jZFXL"vzlê 1cJ,j{?5w%22xφ!&ĴŋH?ìc⡶֜ yWlz\9Qr!}x[\ޔK 4|}E-jmq18okNjvׯ;^ .c$ F mw0v\OQ\7sHTFOV7cxyy@0j7=]0ۢE ƹn:̝ bb[1r5x!Y7:JBB| rN6l%D/wø==M\}۫`fx:4njY/Ydg51`z@`yE|}&Y'a JlzII'a4ѺqYs90 Ldw^_o>jyR4V%J nٽt}A #,̗JHp7hiSE!;^~Ld"{ZJ$&UNrax\!HD$&vR(EP*WTזHJ= z9GbjxBQJG R'B$ƃJPT*U)q!mi|4`ȍL6A4he_ 1 HLAD$& 1Ab"A 1 HLAb"D$& 1 AD HLAb"A$& 1 HLAD$& HLAb"A 1 HLAD$& 1Ab"A8Bh*xIENDB`recaptcha-8.05.26/doc/recaptcha.ico0000644000175000017500000000217611016733026015570 0ustar yuriyuri h(  tttetttttt3tttdtttttttttttttttttltbtttttt"ttitttt tt tctttttttttEtgttvttt!tttttttitttftttttttt(tttttttttttttttttntttt tttttwtHt" .. "" ## Verifying user's input Send your POST fields and the user's IP address to captcha:verify(). For instance, for WSAPI: local request = wsapi.request.new(wsapi_env) local ok, err = captcha:verify(request.POST, wsapi_env.REMOTE_ADDR) if ok then ... else print ("Error: "..err) end recaptcha-8.05.26/doc/index.html0000644000175000017500000001647711016733026015150 0ustar yuriyuri ReCaptcha

Overview

reCaptcha is a free captcha web service that shows the visitors words from old books helping digitize them. This, module provides a Lua interface to recaptcha. You will need to get your own API key from recaptcha.net to use it.

Installation

The Lua interface Recaptcha to recaptcha consists of a single file (recaptcha.lua) of less than 100 lines, plus a test script (tests/recaptcha.cgi) which is meant to be used with WSAPI. Here is a list of recent releases:

You can also install it using LuaRocks with

luarocks install recaptcha

or:

luarocks --from http://sputnik.freewisdom.org/rocks/earth install recaptcha

Using Recaptcha

Creating the catpcha object

You will need to get your PRIVATE and PUBLIC API keys from recaptcha. Once you have them, create an instance or ReCaptcha like this:

captcha = recaptcha.new{PRIVATE, PUBLIC}

Generating the Widget

Include the output of captcha:get_html() into your form. For instance:

my_html = "<form action='...' method='post'...>"
          .. "..." -- add your fields
          .. captcha:get_html()
          .. "<input type='submit'/>"
          .. "</form>"

Verifying user's input

Send your POST fields and the user's IP address to captcha:verify(). For instance, for WSAPI:

local request = wsapi.request.new(wsapi_env)
local ok, err = captcha:verify(request.POST, wsapi_env.REMOTE_ADDR)

if ok then
   ...
else
   print ("Error: "..err)
end

Contact

Please contact Yuri Takhteyev (yuri -at- freewisdom.org) with any questions.

LuaDoc

recaptcha

ReCaptcha:get_fields() Returns a table of names of fields posted by the captcha widget.
Returns: a table of field names.
ReCaptcha:get_html() Returns the html block that creates the ReCaptcha widget.
options:
a table of options.
Returns: a string containing JavaScript and HTML for inclusion in an HTML document.
ReCaptcha:verify() Verifies the captcha.
params:
the table of POST parameters submitted by the client.
remote_ip:
user's IP address.
Returns: true if the verification is successful and false otherwise.
new() Creates a new ReCaptcha object.
args:
a single argument with two fields: the private API key and the public API key.
Returns: an instance of ReCaptcha.

License

Copyright (c) 2008 Yuri Takhteyev

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

recaptcha-8.05.26/doc/recaptcha.xcf0000644000175000017500000007703411016733026015603 0ustar yuriyurigimp xcf fileBBfS gimp-commentCreated with The GIMPgimp-image-grid(style intersections) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches) &;Wzr|E Recaptcha2     eq&#&/'7G6#%%&& 9887668 ) % %   9 8 8 7 6 6 8  )  %  %                    h9h8h8h7h6h6h8h h)h h%h h%h hhhhhhhhhhhhhhhhhh ~tj87 7656 N8 ( P% V% 6J* 4\    !(9<<6 1/**!                         "/49                                                              !   ( 9 <  < 6 1 /  *  *  !                                                                              "   /  4  9hhhhh hhhhh hhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhh!hhh(h9h<hh<h6 h1h/hhhh*hh*hh!hhhhh hhh hhhhh hhhhh hhhhhhhh h hhhhh h hhhh h hhhhhhh hhhh hhh hhh hhhhhhhhhh hh h h hhh h hhhhh h h hhhh h hhh"hhh/hh4hh9h XC2" |PAU VN/6 N&A!$' NOv3,S .[gK^+3+kg(5ω$V3- Y}. (R\8e;l<k5ۿӮrS0_Jv,.y*%W)bqW gW%i7WJJH W|7<MJ |W^3 >W m$ J HA > kzTd3C,8!!!\? 7  s5%,zcn|   6? Nt3.Ǻ  J. | `$jqUX!~b /48?==;;::99::::999:::=?<::9 , * & !              $ 3 ? = = ; ; : : 9 9 : : : : 9 9 9 : : : = ? < : : 9 ,  *  & !                                                                                  $  3 ?h=h=h;h;h:h:h9h9h:h:h:h:h9h9h9h:h:h:h=h?h<h:h:h9h h,h h*h h&h h!h hhhh hhhh hhhh hhh hhhhhhhhh hhhhhhhhh hhhhhhhhh hhhhhhhhhhhh hhhhhhh hhhhhh hhhhh hhhhhhhhh hhhh hhhhhhhhhhhh$h h3 h?=<D : :y9e98z8::::9F99.::"29C<Q> ; 9U98 ,b * :&w J!3 ntِ8}_  HM#%1 Y,w Y!CC(H] C7Ct!_. # # j?H#E * 24-                   " 4 -                                                                                     " h4h-hhh hh hh hhhhh hhhh hhhhh hhhhh hhhh hhh hhhh hhh hhhhh hhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhh h hhhhhhhhhh hh hh h"h3,# UW ! ,W<! _JvW %W w3W bW 8} |>  C JC1YCC,!\7  ? !!#|&!!8j%3.7!U"q`                 `                     `hhhhh h h h h h h h h h h h h h h h h h`   b     _ w  H  (!Ct   H @ @ @ @ @ @ @ @ @ @ @ @iX4, Recaptcha     Y&&WW'9)***:>GTWWWW 3 678999       3 6 7 8 9 9 9                                                   h3 h6h7h8h9h9h9h hhhh hhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhh hhhhh hhhh @<:::::::::: @ < : : : : : : : : : : @h<h:h:h:h:h:h:h:h:h:h:   M 3 67899            j .,+** )              @                      M 3 6 7 8 9 9                                                                                                         j  . ,  +  *  *  )                                                                    @hhhhhhhhhhh hhhhh hhhh hhhhhM h3 h6h7h8h9h9h hhh hh hh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh h hhhhhh hhhhhhhhh hhhhh hhh hh hhj hh.h,hh+hh*hh*h h)h hhhhhh hh hh hhhh hhhhhhhhhhhhhhhhhhhhhh hhh hhh h hhhhhh hhhhhhhhh hhhhh hhh hh hh@j2  567999 6 h VJ*2"U ADC PNA,z' X3 |v VN^( $O-F  !NKg\ $+.[+Y. gkωV3Rlk,W-_JvW+%W*W)bW) W( |W J7 >3JHJm7<MHd3Tk! ,?CC\7    ?!s ,5%|  n3.tUJ. qb@::88                            H                       C : : 8 8                                                                                             H                                                                                                  Ch:h:h8h8hh hhh hhh hhh hhhhh h hhhhh h hhhhh h hhhhh h hhhhh h hhhhh h hhhhhh hhhhh hh hhh h hhh h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh h hh hh h hHh hhh hhhhh hhhhhhh hhhhhhh hhhhhhh hhhhhhh hhhhhhh hhhhhh h hhh hhh hhhhh hh hhh h hhh h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh h hh hh h hC@€ ;y9e999::::::::2C77"Q ِ :nt#% J&MYU b H  5 ش   w3 ] _ ,8}_w.  ˖# 1H(Y !CCt7?**##H jE B                             B                             C                                                                                                   B                                                                                                   Ch hh hh h hh h h hhhhh hhhhh hhhhh hh hhh hh hhh hh hhh hhhh hhhh hhhh hhh hhhhhhhhhhhhhhhhhhhhhh hhhhh hhhh hhhhh hhhhh h h hh h hhhBh hh hh h hh h h hhhhh hhhhh hhhhh hh hhh hh hhh hh hhh hhhh hhhh hhhh hhh hhhhhhhhhhhhhhhhhhhhhh hhhhh hhhh hhhhh hhhhh h h hh h hhhC k,W _JvW<   %W.!!# W UbW  W  |W  > J w3 _C 8} ,1\YCC ?! 7%| 3.&!!! U7!!8# qbjB                                d                                              dhhhhhhh h h h h h h h h h h h h h h h hhhhhhhh h h h h h h h h h h h h h h h hd b  5     w  H ( !Ct     Hc @ @ @ @ @ @ @ @ @ @ @ @iX4, New LayerG     XXzZzfY[^f%f5kowNw^xyzJ$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ݻww+wDDw#݈33DD" "ww$w"("U,U . w1 f233343)Uw33(f"D'w'3''D'D( ݻww+wDDw#݈33DD" "ww$w"("U,U . w1 f233343)Uw33(f"D'w'3''D'D( Ļ+ջ#ę̢đ $ݑ(, ݈. 1 234)ܺ(Ԑ'''''( @$$$$$$$$$$$ Uf  " 3 f"33UfwUw"wfwDwwww3fw"wDfw3fUf w 3DD 3wD"D 3 3fD w wDDf$$$$$$$$$$$ Uf  " 3 f"33UfwUw"wfwDwwww3fw"wDfw3fUf w 3DD 3wD"D 3 3fD w wDDf$$$$$$$$$$$ ̪  Ĉ    ݢ 滢   $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#w##$f$%%w%3%&&&w&U&D&D&"&(((D&D&D&f&w&&&%U%%%"$w$$3##$$$$$$$$$$$$$$$$$$$$$$$$$$$$#w##$f$%%w%3%&&&w&U&D&D&"&(((D&D&D&f&w&&&%U%%%"$w$$3##$$$$$$$$$$$$$$$$$$$$$$$$$$$$#########$$$$$$$$$$$$$$$$$$#########$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'"w(w)f)++++w+3,,U--.3 /" 0D1f݈D"==<<D;;w:39887w6f5w4 3 1 30 f.f "*"w(wf$fwwUD݈UU '"w(w)f)++++w+3,,U--.3 /" 0D1f݈D"==<<D;;w:39887w6f5w4 3 1 30 f.f "*"w(wf$fwwUD݈UU '())+++++,,--. / 0ܡ1á==<<;;:9887654 3 ̈1 0 . ݑ*($̪Ī fDDfDfDUf  U w 3 ++w+D+D+D+,,,+"+D+D+U+w+++*D**)")w)(3('"'&&%D%$w#3""! wff 3!"$$$$$$fDDfDfDUf  U w 3 ++w+D+D+D+,,,+"+D+D+U+w+++*D**)")w)(3('"'&&%D%$w#3""! wff 3!"$$$$$$               !"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$̈wDDw0T̈wDDw0TĻ0T$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$iX4,White2     {{1|-|9{m{}{{{{{{{{| | @ @ @ @ @ @ @ @ @ @ @ @iX4, Background     |}~~}D}T}d}t}}}}}}}} @ @ @ @ @ @ @ @ @ @ @ @iX4,recaptcha-8.05.26/doc/releases.rss0000644000175000017500000000067611016733026015501 0ustar yuriyuri ReCaptcha http://sputnik.freewisdom.org/lib/recaptcha/ http://sputnik.freewisdom.org/files/recaptcha-$version.tar.gz ReCaptcha 8.05.26 http://sputnik.freewisdom.org/files/recaptcha-8.05.26.tar.gz the initial release recaptcha-8.05.26/rockspec0000644000175000017500000000145411016733026014127 0ustar yuriyuripackage = "ReCaptcha" version = "8.05.26-0" source = { url = "http://sputnik.freewisdom.org/files/recaptcha-8.05.26.tar.gz", } description = { summary = "A Lua interface to reCaptcha.", detailed = [===[ reCaptcha is a free captcha web service that shows the visitors words from old books helping digitize them. This, module provides a Lua interface to recaptcha. You will need to get your own API key from recaptcha.net to use it. ]===], license = "MIT/X11", homepage = "http://sputnik.freewisdom.org/lib/recaptcha/", maintainer = "Yuri Takhteyev (yuri@freewisdom.org)", } dependencies = { 'luasocket >= 2.0' } build = { type = "none", install = { lua = { ["recaptcha"] = "lua/recaptcha.lua", } } } recaptcha-8.05.26/petrodoc0000644000175000017500000000423511016733026014135 0ustar yuriyuripackage = 'ReCaptcha' versions = { {'8.05.26', 'May 26, 2008', 'the initial release'}, } summary = 'A Lua interface to reCaptcha.' maintainer = 'Yuri Takhteyev (yuri@freewisdom.org)' detailed = [[ reCaptcha is a free captcha web service that shows the visitors words from old books helping digitize them. This, module provides a Lua interface to recaptcha. You will need to get your own API key from recaptcha.net to use it. ]] license = 'MIT/X11' homepage = 'http://sputnik.freewisdom.org/lib/recaptcha/' favicon = 'http://media.freewisdom.org/etc/recaptcha.ico' download = 'http://sputnik.freewisdom.org/files/recaptcha-$version.tar.gz' --download = "/tmp/versium-$version.tar.gz" push = "scp %s yuri@web10.webfaction.com:~/webapps/static/files/" --push = "cp %s /tmp/" logo = 'recaptcha.png' keywords = 'lua, recaptcha, captcha' rss = homepage.."releases.rss" -------------------------------------------------------------------------------- dependencies = [[ 'luasocket >= 2.0' ]] -------------------------------------------------------------------------------- Installation = [[ The Lua interface Recaptcha to recaptcha consists of a single file (recaptcha.lua) of less than 100 lines, plus a test script (tests/recaptcha.cgi) which is meant to be used with WSAPI. Here is a list of recent releases: You can also install it using LuaRocks with luarocks install recaptcha or: luarocks --from http://sputnik.freewisdom.org/rocks/earth install recaptcha ]] TOC = { { "Overview", "

"..detailed.."

" }, { "Installation", markdown(Installation) }, { "Using Recaptcha", markdown(include("doc/howto.md")) }, { "Contact", "Please contact Yuri Takhteyev (yuri -at- freewisdom.org) with any questions."}, { "LuaDoc", make_luadoc{"recaptcha.lua"} }, { "License", markdown(include("LICENSE.txt")) } } ------------------------------------------------------------------------------- recaptcha-8.05.26/LICENSE.txt0000644000175000017500000000204211016733026014210 0ustar yuriyuriCopyright (c) 2008 Yuri Takhteyev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. recaptcha-8.05.26/tests/0000755000175000017500000000000011016733026013531 5ustar yuriyurirecaptcha-8.05.26/tests/recaptcha.cgi0000755000175000017500000000230111016733026016146 0ustar yuriyuri#! /bin/bash /home/yuri/sputnik/bin/wsapi.cgi require("recaptcha") PRIVATE="6Led-wEAAAAAAKuR-82cVYNAKk7ELyFDIzzccXdi" PUBLIC="6Led-wEAAAAAACh6qVVx-L4Kzd_YOkDj33jx97qN" OWN_URL="/cgi-bin/recaptcha.cgi" captcha = recaptcha.new{PRIVATE, PUBLIC} return function(wsapi_env) require("wsapi.request") local request = wsapi.request.new(wsapi_env) local buffer = "" if request.POST.recaptcha_challenge_field then local status, err = captcha:verify(request.POST, wsapi_env.REMOTE_ADDR) buffer = "You typed in: '"..request.POST.recaptcha_response_field.."'.
" if status then buffer = buffer.."ok
" else buffer = buffer.."failed
" buffer = buffer..err.."
" end buffer = buffer.."

" end buffer = buffer..string.format([[ The captcha widget should be shown between the two lines.

%s
]], OWN_URL, captcha:get_html()) require("wsapi.response") response = wsapi.response.new() response:write(buffer) return response:finish() end