|
|
@ -20,6 +20,7 @@
|
|
|
|
from db import DataBase
|
|
|
|
from db import DataBase
|
|
|
|
from scraper import Scraper
|
|
|
|
from scraper import Scraper
|
|
|
|
from notify import Notification
|
|
|
|
from notify import Notification
|
|
|
|
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
|
|
def get_urls(file_path):
|
|
|
|
def get_urls(file_path):
|
|
|
|
"""Read file that containes urls."""
|
|
|
|
"""Read file that containes urls."""
|
|
|
@ -53,6 +54,8 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
# Checks for new urls in file and add as current state
|
|
|
|
# Checks for new urls in file and add as current state
|
|
|
|
# If one of page has updated then notifing.
|
|
|
|
# If one of page has updated then notifing.
|
|
|
|
|
|
|
|
# Repeating the checking with the waiting period.
|
|
|
|
|
|
|
|
while True:
|
|
|
|
for url in urls:
|
|
|
|
for url in urls:
|
|
|
|
data = scr.get_anime(url)
|
|
|
|
data = scr.get_anime(url)
|
|
|
|
if data == None:
|
|
|
|
if data == None:
|
|
|
@ -62,6 +65,7 @@ def main():
|
|
|
|
if r == -1:
|
|
|
|
if r == -1:
|
|
|
|
n = Notification(title, MESSAGE)
|
|
|
|
n = Notification(title, MESSAGE)
|
|
|
|
n.send()
|
|
|
|
n.send()
|
|
|
|
|
|
|
|
time.sleep(WAITING_PERIOD)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|