Gossamer Forum
Home : Products : Others : Gossamer Community :

captcha, I am not a robot

Quote Reply
captcha, I am not a robot
I am trying to use Google's "I am not a robot" captcha. Apparently they acquired recaptcha, and changed it.

I want to use it on my community user signup page. Adding the code to the user signup template is easy, and it works fine.

The verify part is causing the problem. Google's instructions are found here:
https://developers.google.com/recaptcha/docs/verify


I tried to include the appropriate code as part of
sub user_signup
in
/cgi-bin/community/private/lib/Community/Web/user.pm


the XXXXXXXXXX represents the code assigned to me by Google for the captcha.

Code:
my $URL = 'https://www.google.com/recaptcha/api/siteverify?secret=XXXXXXXXXX&response=g-recaptcha-response';
my $contents = get $URL or die;
# Split contents variable by comma
my ($success, $challenge_time, $hostname) = split /,/, $contents;
# Split success variable by colon
my ($success_title, $success_value) = split /:/, $success;
#strip whitespace:
$success_value =~ s/^\s+//;
if ($success_value eq "true")
{
print "it worked";
}else{
print "it did not";
}


I get this error message
Code:
Can't locate object method "get" via package "https://www.google.com/recaptcha/api/siteverify?secret=XXXXXXXXXXXX&response=g-recaptcha-response" (perhaps you forgot to load "https://www.google.com/recaptcha/api/siteverify?secret=XXXXXXXX&response=g-recaptcha-response"?) at /var/home/cyberinstitute/cyberinstitute.org/cgi-bin/community/private/lib/Community/Web/User.pm line 439.
Thanks for your help!
Subject Author Views Date
Thread captcha, I am not a robot tora 3346 Jan 8, 2018, 12:43 PM
Post Re: [tora] captcha, I am not a robot
Andy 3245 Jan 8, 2018, 11:27 PM