pull/1789/merge
Mohammed Patrawala 8 months ago committed by GitHub
commit 78cc2573c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,4 +7,5 @@ stem>=1.8.0
torrequest>=0.1.0
pandas>=1.0.0
openpyxl<=3.0.10
exrex>=0.11.0
exrex>=0.11.0
fpdf>=1.7.2

@ -26,6 +26,7 @@ from result import QueryResult
from notify import QueryNotifyPrint
from sites import SitesInformation
from colorama import init
from fpdf import FPDF
module_name = "Sherlock: Find Usernames Across Social Networks"
__version__ = "0.14.3"
@ -519,6 +520,10 @@ def main():
action="store_true", dest="xlsx", default=False,
help="Create the standard file for the modern Microsoft Excel spreadsheet (xslx)."
)
parser.add_argument("--pdf",
action="store_true", dest="xlsx", default=False,
help="Create the standard pdf file."
)
parser.add_argument("--site",
action="append", metavar="SITE_NAME",
dest="site_list", default=None,
@ -765,6 +770,37 @@ def main():
DataFrame = pd.DataFrame({"username": usernames, "name": names, "url_main": url_main, "url_user": url_user, "exists": exists, "http_status": http_status, "response_time_s": response_time_s})
DataFrame.to_excel(f'{username}.xlsx', sheet_name='sheet1', index=False)
if args.pdf:
# save FPDF() class into
# a variable pdf
pdf = FPDF()
# Add a page
pdf.add_page()
# set style and size of font
# that you want in the pdf
pdf.set_font("Arial", size=28)
pdf.cell(200, 10, txt="SHERLOCK", ln=2, align='C')
pdf.cell(200, 10, txt=f"Username: {username}", ln=2, align='C')
pdf.set_font("Arial", size=15)
# open the text file in read mode
f = open(f"{username}.txt", "r")
# insert the texts in pdf
for x in f:
pdf.cell(200, 10, txt=x, ln=1, align='L')
# Check if the pdf already exists
#if yes then replace it with new pdf
# if not, create a new one
# save the pdf with name username.pdf
if os.path.exists(f"{username}.pdf"):
os.remove(f"{username}.pdf")
pdf.output(f"{username}.pdf")
print()
query_notify.finish()

@ -21,9 +21,9 @@ checksymbols = ["_", "-", "."]
"""
class TestMultipleUsernames(unittest.TestCase):
def test_area(self):
test_usernames = ["test{?}test" , "test{?feo" , "test"]
test_usernames = ["test{?}test", "test{?feo", "test"]
for name in test_usernames:
if(sh.CheckForParameter(name)):
self.assertAlmostEqual(sh.MultipleUsernames(name), ["test_test" , "test-test" , "test.test"])
self.assertAlmostEFqual(sh.MultipleUsernames(name), ["test_test" , "test-test" , "test.test"])
else:
self.assertAlmostEqual(name, name)
Loading…
Cancel
Save