Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use routing instead of query params #93

Open
vegeta897 opened this issue Aug 22, 2021 · 2 comments
Open

Use routing instead of query params #93

vegeta897 opened this issue Aug 22, 2021 · 2 comments
Assignees
Labels
enhancement Improving existing functionality

Comments

@vegeta897
Copy link
Owner

I am wary of people sharing Snow-Stamp links and cutting off query parameters, thinking they are useless. Most websites have taught us that they are, because they're most often used for tracking data.

Query parameters are currently used for everything in Snow-Stamp:

s: snowflake
f: encoded snowflake
t: encoded time-zone
l: locale

I should try to replace as much of these as possible with routing. The snowflake can go right after the url, e.g. pixelatomy.com/snow-stamp/86913608335773696. I will have to figure out how to differentiate an encoded snowflake from an un-encoded one.

The time-zone and locale don't fit the routing paradigm as well as the snowflake does. Maybe it would be better for those to remain as query parameters. If anyone knows of a better solution, I'd appreciate your input!

Also, I have to remember to keep the site backwards compatible with query parameters so old links still function

@vegeta897 vegeta897 added the enhancement Improving existing functionality label Aug 22, 2021
@vegeta897 vegeta897 self-assigned this Aug 22, 2021
@Nixill
Copy link

Nixill commented Dec 15, 2021

I will have to figure out how to diferentiate an encoded snowflake from an un-encoded one.

Two ideas. For all examples, I'm going to use f=1thoka as a starting point:

  1. Change the encoding scheme to a modified base 26, so that all encoded snowflakes are letters. In regular base 26, our stamp becomes 96ido6.
    a. First example, shift all digits by 10. The example stamp becomes ifsnyf.
    b. Second example, shift numeric digits by 26. The example stamp becomes yvidoy.
  2. Prefix encoded snowflakes with an f or some other specific indicator. The example stamp becomes f1thoka.

In either case, leave the query parameter version as base 36, without a prefix, for backwards compatibility.

The time-zone and locale don't fit the routing paradigm as well as the snowflake does. Maybe it would be better for those to remain as query parameters. If anyone knows of a better solution, I'd appreciate your input!

Those could be the second and third routing parameters, omissible if empty (or - for empty time zone without empty locale). Also, I think they should be empty by default. If someone from Germany sends me (Eastern US) their link, I'd still like to view the site in English with an Eastern Time stamp, not German with Central European Time.

@vegeta897
Copy link
Owner Author

I appreciate your input! That makes sense.

The time-zone and locale would not affect what you see upon visiting the link; the URL would immediately be overwritten when you open the page with whatever sharing settings you have set (either defaults or loaded from localstorage). You can already see this behavior by visiting a snowsta.mp link with someone else's locale and time-zone. This information is only used to generate localized embeds for places like Discord or Twitter. That's why I think it might make more sense for them to remain as query params, since they're not used for changing the page itself like a routing should; they're essentially just some meta-data for the purpose of embeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants