minor improvements on configuration
All checks were successful
continuous-integration/drone/push Build is passing

Some explanations added and options implemented
This commit is contained in:
2020-01-19 04:39:43 +01:00
parent 1ca20a2789
commit 61c37d6700
2 changed files with 8 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
# Bib Reminder for Munich public library
This automatically sending pushover messages when a lent item is about to be returned, while also extending the period if possible.
This automatically sending pushover messages when a lent item is about to be returned, while also extending the period of the lending if possible.
Configure the docker container with the following variables.
@@ -9,10 +9,13 @@ Configure the docker container with the following variables.
### Required
- `PUSHOVER_KEY` Your pushover API Key
- `PUSHOVER_CLIENTS` A comma seperated list of pushover client ids.
- `HEALTHCHECK_URL` An url for performing a healthcheck (see healthckeck.io for details)
- `PUSHOVER_CLIENTS` A comma seperated list of pushover client ids. All the notifications will be sent to this ids
- `NOTIFY_USERS` A coma separated list of <USER>:<pushover client id> tulles to send pushover messages selectivly
- `HEALTHCHECK_URL` OPTIONAL url for performing a healthcheck (see healthckeck.io for details)
- `BIB_USERS` A comma seperated list of combinations of <USER>:<PWD> combinations to check and extend lent items.
- `LIBRARY_URL` The url of the OPAC entry page of your library
- `LIBRARY_URL` The url of the OPAC entry page of your library, defaults to the one of Stadtbibliothek München
- `RUN_AT_HOUR` Check at hour, default 6
- `RUN_AT_MINUTE` Check at minute, default 0
Example:

View File

@@ -30,7 +30,7 @@ def main():
break
now = datetime.datetime.utcnow
to = (now() + datetime.timedelta(days = 1)).replace(hour=6, minute=0, second=0)
to = (now() + datetime.timedelta(days = 1)).replace(hour=os.environ.get('RUN_AT_HOUR', 6), minute=os.environ.get('RUN_AT_MINUTE', 0), second=0)
time.sleep((to-now()).seconds)
def check(username, password, notify_ids):
@@ -69,8 +69,6 @@ def check(username, password, notify_ids):
except:
print("No client")
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})')
return []
return allinfo