Tweepy rate_limit_status-如何获得剩余的推文帖子

时间:2014-10-20 01:52:59

标签: python twitter tweepy

使用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 个答案:

答案 0 :(得分:1)

所有对创建或修改数据的twitter API的调用都不是基于应用程序的应用程序的速率限制,因此该端点不会返回。但是,它们在所有应用程序中总体上受用户限制,包括官方Twitter应用程序。据我所知,除了查看他们的活动和计算自己之外,没有办法看到用户在这些限制方面的进展。

https://support.twitter.com/forums/10711/entries/15364#