From ecee9a438a20c89ca446e0670566cb7ec0be6553 Mon Sep 17 00:00:00 2001 From: Ryan McGrath Date: Wed, 1 Jul 2009 05:16:22 -0400 Subject: [PATCH] Example for checking rate limits --- tango_examples/rate_limit.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tango_examples/rate_limit.py diff --git a/tango_examples/rate_limit.py b/tango_examples/rate_limit.py new file mode 100644 index 0000000..ae85973 --- /dev/null +++ b/tango_examples/rate_limit.py @@ -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")