contact-scan/app.py

28 lines
687 B
Python
Raw Normal View History

2018-12-18 21:55:28 +00:00
import sys
2018-12-18 14:18:04 +00:00
from lib.scanner import Scanner
2018-12-18 21:55:28 +00:00
if len(sys.argv) != 3:
print("Incorrect number of arguments supplied. Usage:")
print("python3 app.py URL_FILE KEYWORD_FILE")
sys.exit(0)
# Get filenames
url_filename = sys.argv[1]
keyword_filename = sys.argv[2]
# Open the url file and get the list of URLs
url_file = open(url_filename, 'r')
urls = url_file.read().split('\n')
# Replace spaces
for url in urls:
url = url.replace(" ", "")
# Open the keyword file and get the list of keywords
keyword_file = open(keyword_filename, 'r')
keywords = keyword_file.read().split('\n')
# Scan the contacts in the URL
contact_scanner = Scanner(urls, keywords)
contact_scanner.get_contacts()