diff --git a/main.py b/main.py index 0f57aed..078b3c6 100644 --- a/main.py +++ b/main.py @@ -1,21 +1,48 @@ -import src.monitor as monitor import src.tools as tools +import src.monitor as monitor +import src.proxy as proxy +import os +import glob +import json from colorama import Style, Fore, init + +def readsites(p=None): + + dod = {} + if p: + sitedir = p + else: + rootdir = os.path.dirname(os.path.abspath(__file__)) + sitedir = rootdir + r"\sites" + + for sitefile in glob.glob(sitedir + r"\*.json"): + sfn = os.path.basename(sitefile) + site, ext = os.path.splitext(sfn) + print(f"Parsing {sfn}") + with open(sitefile, 'r') as f: + data = json.load(f) + dod[site] = data + + print(dod) + + if __name__ == "__main__": - url = "https://www.nike.com/de/launch?s=upcoming" num_monitors = 10 + # Initialize Colorama init(autoreset=True) + readsites() + tools.clear() print(f"Creating {num_monitors} new Monitors...\n{tools.spacer}") for i in range(0, num_monitors): mon = monitor.Monitor() mon.name = f"Monitor {i}" - mon.url = url + mon.url = "test" print(f"{Fore.MAGENTA}{mon.name}{Style.RESET_ALL} |" f" {tools.keyword('URL')}({mon.url}) {tools.keyword('PROXY')}({mon.proxy})") print(tools.spacer) diff --git a/sites/nike.json b/sites/nike.json new file mode 100644 index 0000000..ea64640 --- /dev/null +++ b/sites/nike.json @@ -0,0 +1,3 @@ +{ + "url": "https://www.nike.com/de/launch?s=upcoming" +} diff --git a/src/monitor.py b/src/monitor.py index 7ded08a..8984718 100644 --- a/src/monitor.py +++ b/src/monitor.py @@ -1,6 +1,7 @@ class Monitor: def __init__(self): + self.url = None self.name = None self.proxy = None diff --git a/src/proxy.py b/src/proxy.py new file mode 100644 index 0000000..3223274 --- /dev/null +++ b/src/proxy.py @@ -0,0 +1,9 @@ +class Proxy: + + def __init__(self): + + self.name = None + self.url = None + self.usr = None + self.pwd = None + self.status = None