开发者

Any way to get the users home timeline and their user details in a single request?

开发者 https://www.devze.com 2023-02-27 05:39 出处:网络
I have a Twitter \"widget\" on my site where I allow users to login and pull in their twitter details and home timeline. I\'m using OAuth for this and I have a little concern over rate limiting. In my

I have a Twitter "widget" on my site where I allow users to login and pull in their twitter details and home timeline. I'm using OAuth for this and I have a little concern over rate limiting. In my widget, I'm having to make 2 requests every 开发者_开发百科time I need the latest data. One request for the users details (and latest status) (the top section of my widget), and a separate request for their home timeline (the bottom section of my widget). What I'm wondering is if there is a way to get both with a single request. It just seems like it's a waste of requests to have to do it twice. Any way to do this or is this something I need to make a feature request for to Twitter? Does anyone else think that it would make sense for Twitter to always return the latest user details with each API request/result?

Any way to get the users home timeline and their user details in a single request?


Your best bet is not to pull the user details with every refresh; cache it locally and only update the display of user details intermittently. Or give your use an option so they can control their own rate limit usage.


There's no single API to return what you're looking for. You can ask them to add it but don't hold your breath :).

0

精彩评论

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