Giter VIP home page Giter VIP logo

desk-booker's Introduction

OfficeSpace desk booker script

Usage

→ go run main.go -h
Usage of /tmp/go-build697668133/b001/exe/main:
  -csrfToken string
    	OfficeSpace 'X-CSRF-Token' header.  Default $OS_CSRF_TOKEN. (default "")
  -daysToBook int
    	Number of days out to book, including today. (default 10)
  -employeeId string
    	Employee ID from OfficeSpace.  Default $OS_EMPLOYEE_ID. (default "")
  -huddleSession string
    	OfficeSpace '_huddle_session' cookie.  Default $OS_HUDDLE_SESSION. (default "")
  -seatId string
    	Seat ID from OfficeSpace.  Default $OS_SEAT_ID. (default "")
exit status 2

You can also set these varibles via shell variables

OS_HUDDLE_SESSION=
OS_EMPLOYEE_ID=
OS_CSRF_TOLKEN=
OS_SEAT_ID=

Where do I get this information?

Navigate to OfficeSpace in Okta, pick the desk you want to book, and open up the network console:

1

Then book the desk, you'll need to grab a cookie, a header, and 2 variables from the payload sent.

2

3

Example

→ go run main.go
Attempting to book seat 735 for 10 days
Attempting to book day 0 (2019-10-01)... Failed. Error booking desk: employeeAlreadySeated
Attempting to book day 1 (2019-10-02)... Failed. Error booking desk: employeeAlreadySeated
Attempting to book day 2 (2019-10-03)... Failed. Error booking desk: employeeAlreadySeated
Attempting to book day 3 (2019-10-04)... Failed. Error booking desk: employeeAlreadySeated
Attempting to book day 4 (2019-10-05)... Success. [#95] You should receive a booking confirmation email shortly.
Attempting to book day 5 (2019-10-06)... Success. [#96] You should receive a booking confirmation email shortly.
Attempting to book day 6 (2019-10-07)... Success. [#97] You should receive a booking confirmation email shortly.
Attempting to book day 7 (2019-10-08)... Success. [#98] You should receive a booking confirmation email shortly.
Attempting to book day 8 (2019-10-09)... Failed. Error booking desk: invalidPeriod
Attempting to book day 9 (2019-10-10)... Failed. Error booking desk: invalidPeriod

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.