Tweepy rate_limit_status- 如何获取剩余的推文帖子
Posted
技术标签:
【中文标题】Tweepy rate_limit_status- 如何获取剩余的推文帖子【英文标题】:Tweepy rate_limit_status- how to get remaining tweet posts 【发布时间】:2014-12-14 22:54:54 【问题描述】:使用 tweepy rate_limit_status 调用,我得到以下 json 输出。但是,我无法辨别剩余的推文帖子/写的数量。我已经监控了以下所有值,但无法找到剩余的推文帖子/写入数量。
如何使用 tweepy 获得这个值?如果无法使用 tweepy,twitter api?
u'rate_limit_context':
u'access_token': u'XXXXXXXXXXXXXXXXXX'
,
u'resources':
u'account':
u'/account/verify_credentials':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/account/update_profile':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/account/settings':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/account/login_verification_enrollment':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'blocks':
u'/blocks/list':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/blocks/ids':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'users':
u'/users/derived_info':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/users/lookup':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/users/search':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/users/suggestions/:slug/members':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/users/suggestions/:slug':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/users/show/:id':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/users/suggestions':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/users/report_spam':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/users/profile_banner':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'search':
u'/search/tweets':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'saved_searches':
u'/saved_searches/show/:id':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/saved_searches/list':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/saved_searches/destroy/:id':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'lists':
u'/lists/subscribers/show':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/lists/subscriptions':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/lists/members/show':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/lists/statuses':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/lists/subscribers':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/lists/list':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/lists/show':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/lists/memberships':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/lists/members':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/lists/ownerships':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'geo':
u'/geo/similar_places':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/geo/id/:place_id':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/geo/reverse_geocode':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/geo/search':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'application':
u'/application/rate_limit_status':
u'reset': 1413769491,
u'limit': 180,
u'remaining': 177
,
u'trends':
u'/trends/available':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/trends/closest':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/trends/place':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'followers':
u'/followers/list':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/followers/ids':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'favorites':
u'/favorites/list':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'device':
u'/device/token':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'friendships':
u'/friendships/outgoing':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/friendships/show':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/friendships/incoming':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/friendships/no_retweets/ids':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/friendships/lookup':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'mutes':
u'/mutes/users/list':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/mutes/users/ids':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'friends':
u'/friends/list':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/friends/following/ids':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/friends/ids':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/friends/following/list':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'direct_messages':
u'/direct_messages/show':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/direct_messages':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/direct_messages/sent':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/direct_messages/sent_and_received':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'statuses':
u'/statuses/retweets_of_me':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/statuses/retweeters/ids':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/statuses/mentions_timeline':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/statuses/user_timeline':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/statuses/oembed':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/statuses/lookup':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/statuses/show/:id':
u'reset': 1413769788,
u'limit': 180,
u'remaining': 180
,
u'/statuses/friends':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/statuses/home_timeline':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/statuses/retweets/:id':
u'reset': 1413769788,
u'limit': 60,
u'remaining': 60
,
u'help':
u'/help/tos':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/help/settings':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/help/configuration':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/help/privacy':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
,
u'/help/languages':
u'reset': 1413769788,
u'limit': 15,
u'remaining': 15
【问题讨论】:
【参考方案1】:所有创建或修改数据的 twitter API 调用都不受应用程序的速率限制,因此不会由该端点返回。但是,它们在所有应用程序(包括官方 Twitter 应用程序)中仅限于用户。据我所知,除了查看用户的活动并计算自己之外,没有其他方法可以查看用户在达到这些限制方面的进展情况。
https://support.twitter.com/forums/10711/entries/15364#
【讨论】:
您知道在 2400 个总职位津贴中每小时间隔限制的值吗?以上是关于Tweepy rate_limit_status- 如何获取剩余的推文帖子的主要内容,如果未能解决你的问题,请参考以下文章