Skip to content

Commit

Permalink
Add option to exclude specific centers
Browse files Browse the repository at this point in the history
  • Loading branch information
danburg committed Jun 20, 2021
1 parent af1be07 commit b370403
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Further optional arguments:
```
--center "<name>" [--center <name> …] : filter centers to only choose one from the provided list
--additional-center "<name;city;link>" [--ac <name;city;link> …] : Add additional centers or doctors e.g. "Corona Impfzentren - Berlin;Berlin;/institut/berlin/ciz-berlin-berlin"
-f, --filter <name> [--filter <name> …] : exclude specific centers
-p <index>, --patient <index> : select patient for which book a slot
-z, --pfizer : looking only for a Pfizer vaccine
-m, --moderna : looking only for a Moderna vaccine
Expand Down
7 changes: 6 additions & 1 deletion doctoshotgun.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)')
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b370403

Please sign in to comment.