Captcha and scraps

22 views
Skip to first unread message

Кирилл Совкуцан

unread,
Apr 9, 2012, 2:13:14 AM4/9/12
to opensoci...@googlegroups.com
Good day, everyone.
When i try post scrap without any url, it posts well.
But when i try to post any url, i have an error

{"error":{"message":"unauthorized:  Please  enter  the  text  as  it  is  shown  in  the  box.","data":{"errorType":"requiresCaptcha","captchaUrl":"/social/pages/captcha?xid=1333951789263","captchaToken":"token1333951789263"},"code":401}}

I read at this group, that i need to request captcha using Oauth
When i try, i have  404 error

This is my code
$params = array(
                          'oauth_nonce' => md5(time()) ,
                          'oauth_version1.0' ,
                          'oauth_timestamp' => time() ,
                          'oauth_consumer_key' => "CONSUMER_KEY',
                          'oauth_token' =>'TOKEN',
                          'oauth_signature_method' => 'HMAC-SHA1'
                        );
              $signature = $this->build_orkut_signature($params, 'CONSUMER_SECRET', false), 2);
              $params['oauth_signature'] = $signature;

              $client = $token->getHttpClient($this->getProviderConfig('orkut'));
              $client->setUri('http://www.orkut.com'.$content->error->data->captchaUrl);
              $client->setMethod(Zend_Http_Client::GET);
              $client->setParameterGet($params);
              $client->setHeaders('Content-type', 'application/json');
              $response = $client->request();

Can anybody help me?
Thanks.

Bruno Oliveira (Google)

unread,
Apr 9, 2012, 1:00:42 PM4/9/12
to opensoci...@googlegroups.com
Hello! This is not an error, this is a captcha challenge.

Some requests on Orkut require the user to solve a captcha so that we know the user is an actual human and not an evil robot. This is essential in our fight against spam.

So, when you receive a captcha challenge like this one, the correct course of action is to show the captcha to the user and ask them to solve it. Then you should resubmit your request with the captcha solution.

-
Bruno Oliveira (Google)

Bruno Oliveira (Google)

unread,
Apr 9, 2012, 1:03:50 PM4/9/12
to opensoci...@googlegroups.com
Oops, I forgot to add this link, which may be useful:

If you want look at a real-life implementation example, you can look at the code for submitBatchWithCaptcha() on the OrkutAdapter class, in the Orkut Client Library Source Code.

-
Bruno Oliveira (Google)

Robson Dantas

unread,
Apr 16, 2012, 1:43:36 PM4/16/12
to opensoci...@googlegroups.com
Some time ago I developed a php library which allows you to send scraps. There is a scrapall app to show you some demo code, and it handles captcha. See:

--
Robson Dantas
@robsondantas

--
You received this message because you are subscribed to the Google Groups "orkut Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/opensocial-orkut/-/zUc2zb66pCcJ.

To post to this group, send email to opensoci...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-ork...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en.

Reply all
Reply to author
Forward
0 new messages