Skip to content

Commit

Permalink
fixed issue sherlock-project#9
Browse files Browse the repository at this point in the history
  • Loading branch information
sdushantha committed Dec 26, 2018
1 parent ad23efc commit 41a44be
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Jupyter Notebook
.ipynb_checkpoints
.ipynb
*.ipynb
30 changes: 20 additions & 10 deletions data.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
},
"Blogger": {
"url": "https://{}.blogspot.com",
"errorType": "status_code"
"errorType": "status_code",
"noPeriod": "True"
},
"Google Plus": {
"url": "https://plus.google.com/+{}",
Expand All @@ -38,7 +39,8 @@
},
"GitHub": {
"url": "https://www.github.com/{}",
"errorType": "status_code"
"errorType": "status_code",
"noPeriod": "True"
},
"Steam": {
"url": "https://steamcommunity.com/id/{}",
Expand All @@ -64,7 +66,8 @@
},
"DeviantART": {
"url": "https://{}.deviantart.com",
"errorType": "status_code"
"errorType": "status_code",
"noPeriod": "True"
},
"VK": {
"url": "https://vk.com/{}",
Expand Down Expand Up @@ -161,12 +164,14 @@
"Kongregate": {
"url": "https://www.kongregate.com/accounts/{}",
"errorType": "message",
"errorMsg": "Sorry, no account with that name was found."
"errorMsg": "Sorry, no account with that name was found.",
"noPeriod": "True"
},
"LiveJournal": {
"url": "https://{}.livejournal.com",
"errorType": "message",
"errorMsg": "Unknown Journal"
"errorMsg": "Unknown Journal",
"noPeriod": "True"
},
"VSCO": {
"url": "https://vsco.co/{}",
Expand All @@ -185,7 +190,8 @@
"Dribbble": {
"url": "https://dribbble.com/{}",
"errorType": "message",
"errorMsg": "Whoops, that page is gone."
"errorMsg": "Whoops, that page is gone.",
"noPeriod": "True"
},
"Codecademy": {
"url": "https://www.codecademy.com/{}",
Expand All @@ -208,7 +214,8 @@
},
"Newgrounds": {
"url": "https://{}.newgrounds.com",
"errorType": "status_code"
"errorType": "status_code",
"noPeriod": "True"
},
"Wattpad": {
"url": "https://www.wattpad.com/user/{}",
Expand Down Expand Up @@ -243,7 +250,8 @@
"Contently": {
"url": "https://{}.contently.com/",
"errorType": "message",
"errorMsg": "We can't find that page!"
"errorMsg": "We can't find that page!",
"noPeriod": "True"
},
"Houzz": {
"url": "https://houzz.com/user/{}",
Expand Down Expand Up @@ -302,7 +310,8 @@
},
"Slack": {
"url": "https://{}.slack.com",
"errorType": "status_code"
"errorType": "status_code",
"noPeriod": "True"
},
"Trip": {
"url": "https://www.trip.skyscanner.com/user/{}",
Expand Down Expand Up @@ -336,7 +345,8 @@
"WordPress": {
"url": "https://{}.wordpress.com",
"errorType": "response_url",
"errorUrl": "wordpress.com/typo/?subdomain="
"errorUrl": "wordpress.com/typo/?subdomain=",
"noPeriod": "True"
},
"Unsplash": {
"url": "https://unsplash.com/@{}",
Expand Down
7 changes: 6 additions & 1 deletion sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ def main():
for social_network in data:
url = data.get(social_network).get("url").format(username)
error_type = data.get(social_network).get("errorType")


cant_have_period = data.get(social_network).get("noPeriod")

if cant_have_period == "True":
print("\033[37;1m[\033[91;1m-\033[37;1m]\033[92;1m {}:\033[93;1m Not Found!".format(social_network))
continue

r = requests.get(url, headers=headers)

Expand Down

0 comments on commit 41a44be

Please sign in to comment.