Quantcast

Zend_Service_Twitter user timeline : Oauth issue ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Zend_Service_Twitter user timeline : Oauth issue ?

lucas.corbeaux
Hi there, I encounter a strange behavior with Twitter API since April 12, with status->userTimeline() method : even with a valid oAuth access token, every userTimeline() (and only that method) remains unauthenticated. Here is a code snippet that reproduce the issue (assumed that my-fully-functional.token contains a valid oath serialized token). $accessToken->getParam('screen_name'), 'accessToken' => $accessToken )); function displayXRateLimitClass(Zend_Service_Twitter $twitter) { $headers = $twitter->getLocalHttpClient()->getLastResponse()->getHeaders(); echo $headers['X-ratelimit-class'] . "\n"; } $twitter->account->verifyCredentials(); displayXRateLimitClass($twitter); $twitter->status->friendsTimeline(); displayXRateLimitClass($twitter); $twitter->status->publicTimeline(); displayXRateLimitClass($twitter); $twitter->status->userTimeline(); displayXRateLimitClass($twitter); Here is the output : api_identified api_identified api_identified api Should be : api_identified api_identified api_identified api_identified It's really a problem, because unauthenticated calls quotas are IP based and not user based… and limited to 150 calls an hour. I don't post an issue now, because I'm not sure if it's a Zend_Service_Twitter issue, a Zend_Oauth issue, or a Twitter API issue… I already posted on Twitter forum, it seems that they modified their oAuth implementation : https://dev.twitter.com/discussions/7701 I'm not really familiar with Oauth details, so I didn't look really closely to the issue. Any clue, someone ? Lucas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend_Service_Twitter user timeline : Oauth issue ?

lucas.corbeaux
Sorry for the previous unreadable post... here is the good one (non HTML version).

Hi there,

I encounter a strange behavior with Twitter API since April 12, with status->userTimeline() method : even with a valid oAuth access token, every userTimeline() (and only that method) remains unauthenticated.

Here is a code snippet that reproduce the issue (assumed that my-fully-functional.token contains a valid oath serialized token).

<?php
require_once 'Zend/Oauth/Token/Access.php';
require_once 'Zend/Service/Twitter.php';

$accessToken = unserialize(
    file_get_contents('my-fully-functional.token')
);

$twitter = new Zend_Service_Twitter(array(
    'username' => $accessToken->getParam('screen_name'),
    'accessToken' => $accessToken
));

function displayXRateLimitClass(Zend_Service_Twitter $twitter) {
    $headers = $twitter->getLocalHttpClient()->getLastResponse()->getHeaders();
    echo $headers['X-ratelimit-class'] . "\n";
}

$twitter->account->verifyCredentials();
displayXRateLimitClass($twitter);

$twitter->status->friendsTimeline();
displayXRateLimitClass($twitter);

$twitter->status->publicTimeline();
displayXRateLimitClass($twitter);

$twitter->status->userTimeline();
displayXRateLimitClass($twitter);


Here is the output :
api_identified
api_identified
api_identified
api

Should be :
api_identified
api_identified
api_identified
api_identified

It's really a problem, because unauthenticated calls quotas are IP based and not user based… and limited to 150 calls an hour.

I don't post an issue now, because I'm not sure if it's a Zend_Service_Twitter issue, a Zend_Oauth issue, or a Twitter API issue… I already posted on Twitter forum, it seems that they modified their oAuth implementation : https://dev.twitter.com/discussions/7701

I'm not really familiar with Oauth details, so I didn't look really closely to the issue.

Any clue, someone ?

Lucas
Loading...