From b37040353eaeead59a2c02b3708949be4f416da7 Mon Sep 17 00:00:00 2001 From: Dreiundzwanzig Date: Sun, 20 Jun 2021 11:22:05 +0200 Subject: [PATCH] Add option to exclude specific centers --- README.md | 1 + doctoshotgun.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c38ff1..fe78aac 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Further optional arguments: ``` --center "" [--center …] : filter centers to only choose one from the provided list --additional-center "" [--ac …] : Add additional centers or doctors e.g. "Corona Impfzentren - Berlin;Berlin;/institut/berlin/ciz-berlin-berlin" +-f, --filter [--filter …] : exclude specific centers -p , --patient : select patient for which book a slot -z, --pfizer : looking only for a Pfizer vaccine -m, --moderna : looking only for a Moderna vaccine diff --git a/doctoshotgun.py b/doctoshotgun.py index 0c654fe..8807f32 100755 --- a/doctoshotgun.py +++ b/doctoshotgun.py @@ -520,7 +520,8 @@ def main(self): parser.add_argument('--janssen', '-j', action='store_true', help='select only Janssen vaccine') parser.add_argument('--patient', '-p', type=int, default=-1, help='give patient ID') parser.add_argument('--time-window', '-t', type=int, default=7, help='set how many next days the script look for slots (default = 7)') - parser.add_argument('--center', '-c', action='append', help='filter centers') + parser.add_argument('--center', '-c', action='append', help='include specific centers') + parser.add_argument('--filter', '-f', action='append', help='exclude specific centers') parser.add_argument('--additional-center', '-ac', action='append', help='Add additional centers or doctors: "name;city;link" e.g. "Corona Impfzentren - Berlin;Berlin;/institut/berlin/ciz-berlin-berlin"') parser.add_argument('--start-date', type=str, default=None, help='first date on which you want to book the first slot (format should be DD/MM/YYYY)') parser.add_argument('--end-date', type=str, default=None, help='last date on which you want to book the first slot (format should be DD/MM/YYYY)') @@ -607,6 +608,10 @@ def main(self): if center['name_with_title'] not in args.center: logging.debug("Skipping center '%s'", center['name_with_title']) continue + elif args.filter: + if center['name_with_title'] in args.filter: + logging.debug("Skipping center '%s'", center['name_with_title']) + continue else: if docto.normalize(center['city']) not in cities: logging.debug("Skipping city '%(city)s' %(name_with_title)s", center)