Add support for writing to Comma-Separated Values (CSV) File with all of the results. Unfortunately, the request text is so long that it is not visible in spreadsheet programs. So, I am leaving this off for now.

pull/33/head
Christopher K. Hoadley 5 years ago
parent b17072b3cd
commit d9e600d05d

3
.gitignore vendored

@ -5,3 +5,6 @@
# Output files, except requirements.txt
*.txt
!requirements.txt
# Comma-Separated Values (CSV) Reports
*.csv

@ -8,6 +8,7 @@ import json
import os
import sys
import re
import csv
from argparse import ArgumentParser, RawDescriptionHelpFormatter
import platform
@ -192,6 +193,10 @@ def main():
action="store_false", dest="verbose",
help="Disable debugging information (Default Option)."
)
parser.add_argument("--csv",
action="store_true", dest="csv", default=False,
help="Create Comma-Separated Values (CSV) File."
)
parser.add_argument("username",
nargs='+', metavar='USERNAMES',
action="store",
@ -217,5 +222,26 @@ def main():
print()
results = sherlock(username, verbose=args.verbose)
if args.csv == True:
with open(username + ".csv", "w", newline='') as csv_report:
writer = csv.writer(csv_report)
writer.writerow(['username',
'name',
'url_main',
'url_user',
'exists',
'http_status'
]
)
for site in results:
writer.writerow([username,
site,
results[site]['url_main'],
results[site]['url_user'],
results[site]['exists'],
results[site]['http_status']
]
)
if __name__ == "__main__":
main()
main()

Loading…
Cancel
Save