mirror of https://github.com/Askill/optar.git
sleep timer in main
This commit is contained in:
parent
0eb5bde3be
commit
074c087fc1
2
main.py
2
main.py
|
|
@ -1,4 +1,4 @@
|
||||||
from src.Watcher import Watcher
|
from src.Watcher import Watcher
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
Watcher("../sites.txt", "../keywords.txt").watch()
|
Watcher("../sites.txt", "../keywords.txt").watch(3600)
|
||||||
|
|
@ -18,7 +18,7 @@ class Watcher:
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
return f.read().splitlines()
|
return f.read().splitlines()
|
||||||
|
|
||||||
def watch(self):
|
def watch(self, sleep):
|
||||||
while True:
|
while True:
|
||||||
keywords = self.read_txt_file(self.keywords_source_path)
|
keywords = self.read_txt_file(self.keywords_source_path)
|
||||||
sites = self.read_txt_file(self.sites_source_path)
|
sites = self.read_txt_file(self.sites_source_path)
|
||||||
|
|
@ -36,7 +36,7 @@ class Watcher:
|
||||||
for url, content in contents.items():
|
for url, content in contents.items():
|
||||||
matches.append(self.search_sites(url, content, keywords))
|
matches.append(self.search_sites(url, content, keywords))
|
||||||
print(matches)
|
print(matches)
|
||||||
time.sleep(3600)
|
time.sleep(sleep)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def remove_protocol(site):
|
def remove_protocol(site):
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"https://www.patricematz.de": ["https://www.patricematz.de/", "https://www.linkedin.com/in/patrice-matz-b73b6814a/", "https://github.com/Askill", "https://www.patricematz.de/images/praktikum.pdf", "https://www.patricematz.de/images/bachelor.pdf", "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf", "https://irs.projects.patricematz.de", "https://github.com/Askill/Inverse-Rezeptsuche", "https://irs.projects.patricematz.de/", "https://github.com/Askill/Video-Synopsis", "https://github.com/Askill/UI", "https://github.com/Askill/Photo-Wall", "https://www.patricematz.de/photowall/demo/", "https://github.com/Askill/Flask-URL-Checker", "https://patricematz.de/starmapper.htm"], "https://www.patricematz.de/photowall/demo/": ["javascript:void(0)"], "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf": [], "https://www.patricematz.de/images/bachelor.pdf": [], "https://www.patricematz.de/images/praktikum.pdf": [], "https://www.patricematz.de/": ["https://www.patricematz.de/", "https://www.linkedin.com/in/patrice-matz-b73b6814a/", "https://github.com/Askill", "https://www.patricematz.de/images/praktikum.pdf", "https://www.patricematz.de/images/bachelor.pdf", "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf", "https://irs.projects.patricematz.de", "https://github.com/Askill/Inverse-Rezeptsuche", "https://irs.projects.patricematz.de/", "https://github.com/Askill/Video-Synopsis", "https://github.com/Askill/UI", "https://github.com/Askill/Photo-Wall", "https://www.patricematz.de/photowall/demo/", "https://github.com/Askill/Flask-URL-Checker", "https://patricematz.de/starmapper.htm"]}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"https://www.patricematz.de": ["https://www.patricematz.de/", "https://www.linkedin.com/in/patrice-matz-b73b6814a/", "https://github.com/Askill", "https://www.patricematz.de/images/praktikum.pdf", "https://www.patricematz.de/images/bachelor.pdf", "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf", "https://irs.projects.patricematz.de", "https://github.com/Askill/Inverse-Rezeptsuche", "https://irs.projects.patricematz.de/", "https://github.com/Askill/Video-Synopsis", "https://github.com/Askill/UI", "https://github.com/Askill/Photo-Wall", "https://www.patricematz.de/photowall/demo/", "https://github.com/Askill/Flask-URL-Checker", "https://patricematz.de/starmapper.htm"], "https://www.patricematz.de/photowall/demo/": ["javascript:void(0)"], "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf": [], "https://www.patricematz.de/images/bachelor.pdf": [], "https://www.patricematz.de/images/praktikum.pdf": [], "https://www.patricematz.de/": ["https://www.patricematz.de/", "https://www.linkedin.com/in/patrice-matz-b73b6814a/", "https://github.com/Askill", "https://www.patricematz.de/images/praktikum.pdf", "https://www.patricematz.de/images/bachelor.pdf", "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf", "https://irs.projects.patricematz.de", "https://github.com/Askill/Inverse-Rezeptsuche", "https://irs.projects.patricematz.de/", "https://github.com/Askill/Video-Synopsis", "https://github.com/Askill/UI", "https://github.com/Askill/Photo-Wall", "https://www.patricematz.de/photowall/demo/", "https://github.com/Askill/Flask-URL-Checker", "https://patricematz.de/starmapper.htm"]}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"https://www.patricematz.de": ["https://www.patricematz.de/", "https://www.linkedin.com/in/patrice-matz-b73b6814a/", "https://github.com/Askill", "https://www.patricematz.de/images/praktikum.pdf", "https://www.patricematz.de/images/bachelor.pdf", "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf", "https://irs.projects.patricematz.de", "https://github.com/Askill/Inverse-Rezeptsuche", "https://irs.projects.patricematz.de/", "https://github.com/Askill/Video-Synopsis", "https://github.com/Askill/UI", "https://github.com/Askill/Photo-Wall", "https://www.patricematz.de/photowall/demo/", "https://github.com/Askill/Flask-URL-Checker", "https://patricematz.de/starmapper.htm"], "https://www.patricematz.de/photowall/demo/": ["javascript:void(0)"], "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf": [], "https://www.patricematz.de/images/bachelor.pdf": [], "https://www.patricematz.de/images/praktikum.pdf": [], "https://www.patricematz.de/": ["https://www.patricematz.de/", "https://www.linkedin.com/in/patrice-matz-b73b6814a/", "https://github.com/Askill", "https://www.patricematz.de/images/praktikum.pdf", "https://www.patricematz.de/images/bachelor.pdf", "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf", "https://irs.projects.patricematz.de", "https://github.com/Askill/Inverse-Rezeptsuche", "https://irs.projects.patricematz.de/", "https://github.com/Askill/Video-Synopsis", "https://github.com/Askill/UI", "https://github.com/Askill/Photo-Wall", "https://www.patricematz.de/photowall/demo/", "https://github.com/Askill/Flask-URL-Checker", "https://patricematz.de/starmapper.htm"]}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{"https://www.patricematz.de": ["https://www.patricematz.de/", "https://www.linkedin.com/in/patrice-matz-b73b6814a/", "https://github.com/Askill", "https://www.patricematz.de/images/praktikum.pdf", "https://www.patricematz.de/images/bachelor.pdf", "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf", "https://irs.projects.patricematz.de", "https://github.com/Askill/Inverse-Rezeptsuche", "https://irs.projects.patricematz.de/", "https://github.com/Askill/Video-Synopsis", "https://github.com/Askill/UI", "https://github.com/Askill/Photo-Wall", "https://www.patricematz.de/photowall/demo/", "https://github.com/Askill/Flask-URL-Checker", "https://patricematz.de/starmapper.htm"], "https://www.patricematz.de/photowall/demo/": ["javascript:void(0)"], "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf": [], "https://www.patricematz.de/images/bachelor.pdf": [], "https://www.patricematz.de/images/praktikum.pdf": [], "https://www.patricematz.de/": ["https://www.patricematz.de/", "https://www.linkedin.com/in/patrice-matz-b73b6814a/", "https://github.com/Askill", "https://www.patricematz.de/images/praktikum.pdf", "https://www.patricematz.de/images/bachelor.pdf", "https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf", "https://irs.projects.patricematz.de", "https://github.com/Askill/Inverse-Rezeptsuche", "https://irs.projects.patricematz.de/", "https://github.com/Askill/Video-Synopsis", "https://github.com/Askill/UI", "https://github.com/Askill/Photo-Wall", "https://www.patricematz.de/photowall/demo/", "https://github.com/Askill/Flask-URL-Checker", "https://patricematz.de/starmapper.htm"]}
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"https://www.patricematz.de/": [
|
||||||
|
"https://www.patricematz.de/",
|
||||||
|
"https://www.linkedin.com/in/patrice-matz-b73b6814a/",
|
||||||
|
"https://github.com/Askill",
|
||||||
|
"https://www.patricematz.de/images/praktikum.pdf",
|
||||||
|
"https://www.patricematz.de/images/bachelor.pdf",
|
||||||
|
"https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf",
|
||||||
|
"https://irs.projects.patricematz.de",
|
||||||
|
"https://github.com/Askill/Inverse-Rezeptsuche",
|
||||||
|
"https://irs.projects.patricematz.de/",
|
||||||
|
"https://github.com/Askill/Video-Synopsis",
|
||||||
|
"https://github.com/Askill/UI",
|
||||||
|
"https://github.com/Askill/Photo-Wall",
|
||||||
|
"https://www.patricematz.de/photowall/demo/",
|
||||||
|
"https://github.com/Askill/Flask-URL-Checker",
|
||||||
|
"https://patricematz.de/starmapper.htm"
|
||||||
|
],
|
||||||
|
"https://www.patricematz.de/photowall/demo/": [
|
||||||
|
"javascript:void(0)"
|
||||||
|
],
|
||||||
|
"https://www.patricematz.de/images/21-Master-Thesis-Matz.pdf": [],
|
||||||
|
"https://www.patricematz.de/images/bachelor.pdf": [],
|
||||||
|
"https://www.patricematz.de/images/praktikum.pdf": []
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue