Skip to content

Commit

Permalink
Merge pull request sherlock-project#889 from sherlock-project/csv_dir…
Browse files Browse the repository at this point in the history
…ectory_fix

Save csv file to output directory (if specified).
  • Loading branch information
hoadlck committed Dec 8, 2020
2 parents f8a1c33 + a8fdc2e commit ecf7e4d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ usage: sherlock [-h] [--version] [--verbose] [--folderoutput FOLDEROUTPUT]
[--browse] [--local]
USERNAMES [USERNAMES ...]

Sherlock: Find Usernames Across Social Networks (Version 0.12.9)
Sherlock: Find Usernames Across Social Networks (Version 0.14.0)

positional arguments:
USERNAMES One or more usernames to check with social networks.
Expand Down
11 changes: 9 additions & 2 deletions sherlock/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from sites import SitesInformation

module_name = "Sherlock: Find Usernames Across Social Networks"
__version__ = "0.13.0"
__version__ = "0.14.0"



Expand Down Expand Up @@ -637,7 +637,14 @@ def main():
file.write(f"Total Websites Username Detected On : {exists_counter}\n")

if args.csv:
with open(username + ".csv", "w", newline='', encoding="utf-8") as csv_report:
result_file = f"{username}.csv"
if args.folderoutput:
# The usernames results should be stored in a targeted folder.
# If the folder doesn't exist, create it first
os.makedirs(args.folderoutput, exist_ok=True)
result_file = os.path.join(args.folderoutput, result_file)

with open(result_file, "w", newline='', encoding="utf-8") as csv_report:
writer = csv.writer(csv_report)
writer.writerow(['username',
'name',
Expand Down

0 comments on commit ecf7e4d

Please sign in to comment.