app.py 687 Bytes
Newer Older
1
import sys
Ivaylo Ivanov's avatar
Ivaylo Ivanov committed
2 3
from lib.scanner import Scanner

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
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()