Projects / bookRoom
bookRoom
Books a GT library study room through LibCal.
Why
The room I want is the same room, at the same time, most weeks. The form is the same form. A script can log in, check that the slot is open, and submit it. I did not need a calendar product.
Diagrams
A solid outline is the path in the repo. A dashed outline is the alternative that shape is refusing.
GT credentials come from the environment. The program checks the configured room and time, then submits that slot on LibCal. It does not search the library for a different room.
flowchart TD
env["GT_USERNAME and GT_PASSWORD"]
slot["Configured room and time"]
libcal["LibCal submit"]
env --> slot --> libcal
class env,slot,libcal chosen
The form is the same form most weeks, so the script books one slot. Credentials stay out of the repo. A password in the environment is still a password on the machine.
flowchart TD
q{What gets booked}
q -->|"the room and time in the config"| one["One slot"]
q -->|"whatever else is open"| search["Search the library"]
cred{Where the password lives}
cred -->|"the environment"| env["Not in git"]
cred -->|"next to the script"| git["Committed"]
class one,env chosen
class search,git rejected
Why this shape
GT credentials come from the environment (GT_USERNAME, GT_PASSWORD, and the student fields LibCal asks for). They are not in the repo. The program checks the configured room and time, then submits. One shot, one slot. It does not search the whole library for a nicer room.
Where it breaks
LibCal changes the form and the submit fails. The script also cannot see that you already booked a conflicting slot until the site says so. And a password in the environment is still a password on the machine. It stays out of git. It does not stay out of a shell history if you inline it.