ottojo / uulm_mensa_bot

Cafeteria order lib/cli/bot for uulm
2 stars 0 forks source link

pickup slot shows -1 available places #6

Open ottojo opened 1 year ago

ottojo commented 1 year ago
 TRACE my_mensa_lib > Calling API url: https://togo.my-mensa.de/5ecb878c-9f58-4aa0-bb1b/ulm19c552/api/get_free_slots/
 TRACE my_mensa_lib > Response: Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("togo.my-mensa.de")), port: None, path: "/5ecb878c-9f58-4aa0-bb1b/ulm19c552/api/get_free_slots/", query: None, fragment: None }, status: 200, headers: {"server": "nginx", "date": "Wed, 06 Sep 2023 20:28:04 GMT", "content-type": "application/json", "transfer-encoding": "chunked", "connection": "keep-alive", "expires": "Thu, 19 Nov 1981 08:52:00 GMT", "cache-control": "no-store, no-cache, must-revalidate", "pragma": "no-cache", "set-cookie": "mmp_5b9fa=8s2c19oi05vq5f0q34mpipsihm; path=/", "vary": "Accept-Encoding", "x-powered-by": "PleskLin"} }
 TRACE my_mensa_lib > Text: "{\"11:30:00\":81,\"12:00:00\":86,\"12:30:00\":85,\"13:00:00\":87,\"13:30:00\":-1}"
Free slots for 2023-09-07:
  11:30:00: 81
  12:00:00: 86
  12:30:00: 85
  13:00:00: 87
  13:30:00: -1

site does not display last entry

ottojo commented 1 year ago

The webapp just filters that

slotsClean: function() {
    let slotsClean = {};
    $.each(this.slots, function(zeitstart, rest) {
        if (rest != -1) {
            slotsClean[zeitstart] = rest;
        }
    })
    console.log('slotsrange2', {
        slotsClean,
        slots: this.slots
    })
    return slotsClean;
},