minor improvements on configuration
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Some explanations added and options implemented
This commit is contained in:
11
README.md
11
README.md
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user