hi. i am building an api for a project, and a portion implements
twitter. Cakephp is my framework. The problem i am having is despite
my approach, i am getting
{"request":"\/statuses\/user_timeline.xml?
screen_name=user_screen_name_example","error":"Rate limit exceeded.
Clients may not make more than 150 requests per hour."}
However, if i query the twitter api to see how many requests i truly
have left, i am no where near 150. I have in my controller var
$cacheAction = "1800"; and i am using the Cache helper so as to limt
the hits on the request...
[[ the approaches]]
The first attempt was to use the Twittersource from the bakery(http://
bakery.cakephp.org/articles/view/twitter-datasource).
The second approach was to curl the results through a custom method.
function _getCurrentTweets($user = NULL)
{
$tw = curl_init();
curl_setopt($tw, CURLOPT_GET, 1);
if (!$user) {
curl_setopt($tw, CURLOPT_URL, $this->Tweet->tweets);//
ie:
http://twitter.com/statuses/friends.xml?my_screen_name=101010
curl_setopt($tw, CURLOPT_USERPWD, $this->Tweet->login);
}else
{
$t_url = $this->Tweet->tweetsWithUser.$user; // ie:
http://twitter.com/statuses/user_timeline.xml?screen_name=$user
curl_setopt($tw, CURLOPT_URL, $t_url);
}
curl_setopt($tw, CURLOPT_RETURNTRANSFER, TRUE);
$twi = curl_exec($tw);
curl_close($tw);
$tweeters = new SimpleXMLElement($twi);
return $tweeters;
}
perhaps there is a bigger picture i am missing? I had thought this was
a caching issue, but now i am not so sure.