(New small feature) 0.4.3 - repeating checking the content

main
KKlochko 3 years ago
parent 95362fc3b6
commit 2b121c3e89

@ -11,6 +11,9 @@
New feature: get an anime info from page New feature: get an anime info from page
** 0.3.0 <2022-07-09> ** 0.3.0 <2022-07-09>
New feature: send a notification New feature: send a notification
** 0.4.1 <2022-07-09> ** 0.4.2 <2022-07-09>
New feature: check for new url or update state New feature: check for a new url and for the updated state
New small feature: add the urls config file New small feature: add the urls config file
Little Fix: add update status in quotes
** 0.4.3 <2022-07-09>
New small feature: repeating checking the content.

@ -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,15 +54,18 @@ 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.
for url in urls: # Repeating the checking with the waiting period.
data = scr.get_anime(url) while True:
if data == None: for url in urls:
continue data = scr.get_anime(url)
url, title, status = data if data == None:
r = db.add_anime_if(url, title, status) continue
if r == -1: url, title, status = data
n = Notification(title, MESSAGE) r = db.add_anime_if(url, title, status)
n.send() if r == -1:
n = Notification(title, MESSAGE)
n.send()
time.sleep(WAITING_PERIOD)
if __name__ == "__main__": if __name__ == "__main__":
main() main()

Loading…
Cancel
Save