Skip to content

Instantly share code, notes, and snippets.

require "net/http"
# Veeery simple recaptcha client
class Recaptcha
TRUSTED_PROXIES = /^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\./i
RECAPTCHA_VERIFY_SERVER = 'api-verify.recaptcha.net'
FORM_TEMPLATE = %{
<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=%s">
</script>
<noscript>