From 47fac5943fdd31df22079a2edb3e31e2dd5fbda2 Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 7 Mar 2019 23:57:56 +0100 Subject: [PATCH 1/2] Use compound if statement rather than "if and" This approach is a bit strange to read the first few time but has advantages in that it is easier to get right and faster to execute. The interactions between `and`, `or`, `not`, and `()` can get confusing for new coders. For example, the code line 308 does not match the comment on 307 and I believe that in this case the comment correct and the code is wrong (for values < 200) because it is missing parens. I believe that __200 <= status_code < 300__ produces the correct results in a readable (semi-)intuitive code. ``` >>> for status_code in (-1, 1, 199, 200, 201, 299, 300, 301, 1000): ... print(not status_code >= 300 or status_code < 200, ... not (status_code >= 300 or status_code < 200), ... 200 <= status_code < 300) ... True False False True False False True False False True True True True True True True True True False False False False False False False False False ``` --- sherlock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sherlock.py b/sherlock.py index acca9f9f..4e304f8f 100644 --- a/sherlock.py +++ b/sherlock.py @@ -320,7 +320,7 @@ def sherlock(username, site_data, verbose=False, tor=False, unique_tor=False, pr # match the request. Instead, we will ensure that the response # code indicates that the request was successful (i.e. no 404, or # forward to some odd redirect). - if (r.status_code >= 200) and (r.status_code < 300): + if 200 <= r.status_code < 300: # print_found(social_network, url, response_time, verbose) exists = "yes" From 6c5656a84b5cb6c108df70aaa6f11da79ca6cb94 Mon Sep 17 00:00:00 2001 From: Yahya SayadArbabi Date: Fri, 8 Mar 2019 13:25:38 +0330 Subject: [PATCH 2/2] bump version --- sherlock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sherlock.py b/sherlock.py index 4e304f8f..e5593109 100644 --- a/sherlock.py +++ b/sherlock.py @@ -26,7 +26,7 @@ from torrequest import TorRequest from load_proxies import load_proxies_from_csv, check_proxy_list module_name = "Sherlock: Find Usernames Across Social Networks" -__version__ = "0.5.4" +__version__ = "0.5.5" amount = 0 BANNER = r'''