diff --git a/bibcheck.py b/bibcheck.py index 6b0703f..2289536 100644 --- a/bibcheck.py +++ b/bibcheck.py @@ -25,7 +25,7 @@ def main(): for user, pwd in users: allinfo += check(user, pwd, notify.get(user, [])) if 'HEALTHCHECK_URL' in os.environ: - requests.post(f"{os.environ['HEALTHCHECK_URL']}/start", data='\n'.join(allinfo).encode('utf8')) + requests.post(f"{os.environ['HEALTHCHECK_URL']}", data='\n'.join(allinfo).encode('utf8')) if 'RUN_FOREVER' in os.environ and os.environ['RUN_FOREVER'] == 'False': break @@ -55,10 +55,9 @@ def check(username, password, notify_ids): date = datetime.datetime.strptime(info[1], '%d.%m.%Y') delta = date - datetime.datetime.now() allinfo.append(str(info)) - if delta.days <= 10 or delta.days == 20 or delta.days == 15: for client in itertools.join(notify_ids, os.environ['PUSHOVER_CLIENTS'].split(',')): - pushover.Client(client).send_message('Bitte an {} denken, Abgabe {} ({})'.format(info[3], info[1], username), title="Erinnerung") + pushover.Client(client).send_message(f'Bitte an {info[3]} denken, Abgabe {info[3]} - {username}', title="Erinnerung") except (StopIteration, mechanize._mechanize.LinkNotFoundError) as e: for client in itertools.join(notify_ids, os.environ['PUSHOVER_CLIENTS'].split(',')): pushover.Client(client).send_message(f'nichts ausgeliehen {username} ({e})')