I am using codebird to authenticate on two different sites (two clients). The clients are using the same hosting company (although likely different servers). It works perfectly fine on one site (running wordpress) and fails with code 32, 401 error on the other (running Drupal). Any idea why this could be happening? It’s driving me nuts. Obviously each client has their own app setup with their own keys and tokens. I have checked, double-checked, and re-checked the code that is not authenticating properly. The app causing the problem is the one associated with this account. I have run an account_verify successfully using curl with the request generated from the OAuth Tool in my app. Have also run a statuses/user_timeline request successfully with cURL. I am really at a loss as to why the code works on one site and not on the other. My PHP is below and before you ask, yes they are using the same version of Codebird.
class GetTweets {
static public function get_most_recent($screen_name, $count, $retweets)
{
require_once('codebird.php');
$CONSUMER_KEY = '';
$CONSUMER_SECRET = '';
$ACCESS_TOKEN = '';
$ACCESS_TOKEN_SECRET = '';
\Codebird\Codebird::setConsumerKey($CONSUMER_KEY, $CONSUMER_SECRET);
$cb = \Codebird\Codebird::getInstance();
$cb->setToken($ACCESS_TOKEN, $ACCESS_TOKEN_SECRET);
$params = array(
'screen_name' => $screen_name,
'count' => $count,
'rts' => $retweets,
);
$tweets = (array) $cb->statuses_userTimeline($params);
return json_encode($tweets);
}
}