Added check for authentication if user is getting rate limit status for an authenticated user
This commit is contained in:
parent
c69834935b
commit
b82f88c101
1 changed files with 4 additions and 1 deletions
|
|
@ -82,7 +82,10 @@ class setup:
|
||||||
if rate_for == "requestingIP":
|
if rate_for == "requestingIP":
|
||||||
return simplejson.load(urllib.request.urlopen("http://twitter.com/account/rate_limit_status.json"))
|
return simplejson.load(urllib.request.urlopen("http://twitter.com/account/rate_limit_status.json"))
|
||||||
else:
|
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:
|
except HTTPError as e:
|
||||||
if self.debug is True:
|
if self.debug is True:
|
||||||
print(e.headers)
|
print(e.headers)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue