Example for checking rate limits
This commit is contained in:
parent
860563b9f9
commit
ecee9a438a
1 changed files with 10 additions and 0 deletions
10
tango_examples/rate_limit.py
Normal file
10
tango_examples/rate_limit.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import tango
|
||||
|
||||
# Instantiate with Basic (HTTP) Authentication
|
||||
twitter = tango.setup(authtype="Basic", username="example", password="example")
|
||||
|
||||
# This returns the rate limit for the requesting IP
|
||||
rateLimit = twitter.getRateLimitStatus()
|
||||
|
||||
# This returns the rate limit for the requesting authenticated user
|
||||
rateLimit = twitter.getRateLimitStatus(rate_for="user")
|
||||
Loading…
Add table
Add a link
Reference in a new issue