开发者

"Could not authenticate you." -error when using Twitter OAuth

I'm building my first system using Twitters OAuth and have some issues.

First, I'm using Abraham's Twitter-class for this and I have followed this tutorial. However, I get these lines on my callback.php:

Warning: array_merge() [function.arra开发者_如何学Cy-merge]: Argument #2 is not an array in C:\xampp\htdocs\twitter\twitterOAuth\OAuth.php on line 301

Warning: strtoupper() expects parameter 1 to be string, array given in C:\xampp\htdocs\twitter\twitterOAuth\OAuth.php on line 373
Oops - an error has occurred.
SimpleXMLElement Object
(
    [request] => /account/verify_credentials.xml
    [error] => Could not authenticate you.
)

Is this problem by Twitter-class, or am I doing something wrong? I have my Consumer Key and Consumer Secret in config.php as tutorial says, but should I store something else?

Martti Laine


The Snipe.net tutorial is for an older version of TwitterOAuth. Make sure you read the new documentation

http://github.com/abraham/twitteroauth/blob/master/DOCUMENTATION

In general updating to the new version is changing:

$content = $to->OAuthRequest('https://twitter.com/account/verify_credentials.xml', array(), 'GET');

to:

$content = $to->get('account/verify_credentials');


I was having the same error, caused by a simple mistake:

Doesn’t work: $this->twitteroauth->post('statuses/update’, $message);

Works: $this->twitteroauth->post('statuses/update', array("status" => $message));

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜