From b82f88c1010b6a0a06f26c60f5f7440d82215880 Mon Sep 17 00:00:00 2001 From: Ryan McGrath Date: Wed, 1 Jul 2009 05:18:52 -0400 Subject: [PATCH] Added check for authentication if user is getting rate limit status for an authenticated user --- tango3k.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tango3k.py b/tango3k.py index addb42e..c707aae 100644 --- a/tango3k.py +++ b/tango3k.py @@ -82,7 +82,10 @@ class setup: if rate_for == "requestingIP": return simplejson.load(urllib.request.urlopen("http://twitter.com/account/rate_limit_status.json")) else: - return simplejson.load(self.opener.open("http://twitter.com/account/rate_limit_status.json")) + if self.authenticated is True: + return simplejson.load(self.opener.open("http://twitter.com/account/rate_limit_status.json")) + else: + print("You need to be authenticated to check for this.") except HTTPError as e: if self.debug is True: print(e.headers)