Added check for authentication if user is getting rate limit status for an authenticated user

This commit is contained in:
Ryan McGrath 2009-07-01 05:18:52 -04:00
parent c69834935b
commit b82f88c101

View file

@ -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)