ScheduleStorm icon indicating copy to clipboard operation
ScheduleStorm copied to clipboard

Stateless Schedule Sharing

Open Step7750 opened this issue 6 years ago • 2 comments

This is a bit of an idea I've been playing around with to store a self-contained version of the schedule being viewed within the URL itself in a stateless manner to enable easy sharing that is completely client side.

If we were to use a binary encoding optimized for UTF-16, we could probably store the entirety of a schedule within a couple of mapped symbols appended to the URL without it being extremely long.

For example, we can use Base65536 (or some other mapping with nicer symbols but a worse bit/char ratio):

  • Want to store classes 15709, 13036, 10346, 10386, 13782, 12486, 13270

  • Normalized to 5703, 3030, 340, 380, 3776, 2480, 3264 We need 13 bits for each ID if normalized Binary 10110 01000111, 01011 11010110, 00001 01010100, 00001 01111100, 01110 11000000, 01001 10110000, 01100 11000000

  • We'd also want to the store the schedule university and term. Since these are variable length and we don't necessarily want to limit ourselves to only X amount of universities without backwards compatibility, it may be best to make this human readable in the URL while also providing some context.

As a result, we could encode a schedule into the URL like: schedulestorm.com#UCalgary_2181_𧰘鍇誰𧸂㣬棘

Or in braille encoding: schedulestorm.com#UCalgary_2181_⡈⡷⢲⡺⡅⣒⠠⡏⠟⠐⡋⣤

We could optionally assign an incrementing ID to each university and/or term, and encode that in binary and use a variable length encoding scheme.

Step7750 avatar Mar 11 '18 20:03 Step7750

This seems to make the facebook sharing and imgur uploading redundant. Also sharing a link with chinese or braile encoding in the URL, in my opinion, would seem not that trust worthy.

Perplex avatar Mar 12 '18 00:03 Perplex

It depends on whether the user wants an interactive copy sent or not. Facebook sharing doesn't allow images anymore, so it only serves to share the site URL now.

For how the encoding looks, we can't do that much better unless the state is stored server side with our own scheme. I'd prefer this stateless approach due to the very little overhead and being able to dynamically change the site URL whenever a user is flipping through schedules. It also brings down any server side attack vectors associated with allowing users to upload things.

Step7750 avatar Mar 13 '18 14:03 Step7750