Merge pull request #69 from SpiceBot/development

Development
This commit is contained in:
Deathbybandaid 2019-06-19 08:08:52 -04:00 committed by GitHub
commit 597bac19cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,10 +31,13 @@ class Sherlock():
self.dict[social_network]["cache"] = dict()
def check_network(self, username, social_network):
username = str(username).lower()
if username in list(self.dict[social_network]["cache"].keys()):
if time.time() - self.dict[social_network]["cache"][username]["time"] <= 1800:
return self.dict[social_network]["cache"][username]["exists"]
else:
self.dict[social_network]["cache"][username] = dict()
url = self.dict.get(social_network).get("url").format(username)
error_type = self.dict.get(social_network).get("errorType")