douti19680318 2013-10-30 20:27 采纳率: 0%
浏览 86
已采纳

使用Twitter的REST API检索速率限制状态

I'm working with the REST API from Twitter, using abraham's twitteroauth lib. I'm trying to get the rate limit status of my api key to be able to show it directly on my admin panel, I'm using something like :

$rate = $connection->get('application/rate_limit_status');
print_r($rate->resources->statuses);

But I have no idea how to get for example only the '/statuses/home_timeline' status. I've tried several things like $rate->resources->statuses->'/statuses/home_timeline' or $rate->resources->statuses['/statuses/home_timeline'] but nothing seems to work.

Can someone maybe get me on the right way ?

  • 写回答

1条回答 默认 最新

  • duangouhui0446 2014-02-06 06:33
    关注

    Try $rate->resources->statuses->{'/statuses/home_timeline'}

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?