Skip to content

Automatically reserves rooms at NTNU (Only using python requests)

Notifications You must be signed in to change notification settings

AmiAhm/Room-Reserver-NTNU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatic Room Reserver

Reserves rooms at NTNU by user-selected criterias following a prioritized list.

(spaghetti level code)

Requirements

Runs python3 using the following libraries:

  • requests

  • lxml

  • numpy

  • pandas

Setup:

  1. Make sure you have python setup with the correct libraries.
  2. Create env variable "FUSER" with feide-username
  3. Create env variable "FPASSWORD" with feide-password
  4. Run python3 roomreserver.py init=True
  5. In the newly created buildings.csv rank what buildings you want to choose from. HIGHER IS BETTER. 0 will be ignored.
  6. In the newly created roomtypes.csv rank what buildings you want to choose from. HIGHER IS BETTER. 0 will be ignored.
  7. In the newly created areas.csv rank what buildings you want to choose from. HIGHER IS BETTER. 0 will be ignored.
  8. If you want to rank rooms before reserving run python3 roomreserver.py start="HH:MM" duration="HH:MM" min_size="XX" reserve=F and edit ranks in the newly created room_priority.csv.

How to run:

python3 roomreserver.py start="HH:MM" desc="Reservation description HERE" duration="HH:MM" min_size="XX" By default: duration="02:00" min_size="10"

Rooms with negative rank will be ignored. Rooms without rank will by default be set to rank 0

To run without reserving rooms and only search for new rooms at selected filters: reserve=False

Arguments:

Parameter Description Default value Format
init Is script in initialize state. E.g. needs to search rooms and create necessary .csv files False "T" or "F"
reserve If not init, should post reserve requests? True "T" or "F"
store Store new rooms found in .csv? (Will make script somewhat slower) True "T" or "F"
duration Length of reservation 02:00 "HR:MM"
min_size Minimum size of room (number of people) 10 Int
reserve_in Days into the future for when to reserve 14 Int
start Start time of reservation (Not needed when init) "HR:MM"
desc Description of reservation (Not needed when init) "YOUR DESCRIPTION"
slack_log Log to slack, needs SLACK_URL, SLACK_TOKEN and SLACK_CHANNEL F

Other

This script was updated in October 2020 on https://tp.uio.no/ntnu/rombestilling/. Might not work in the future :(

About

Automatically reserves rooms at NTNU (Only using python requests)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages