-
Notifications
You must be signed in to change notification settings - Fork 23
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
Allow choosing custom slugs when shortening a new URL #9
Comments
This needs more design discussion. What would the URL be for someone to add a custom slug for a URL? Should it be some GET information? |
I would like to stick with making it GET accessible since that's how all the other script parameters are made available. I realize it might get (is getting?) kinda silly if we keep stuffing configuration options into the URL, but that was my design goal with this script from the beginning. It's called Sure, we might eventually want to let the script accept JSON via POST or something to allow advanced customization, but with the basic stuff available as part of the URL, I'm at least able to integrate it extremely quickly into other scripts/automations such as bookmarklets, iOS Shortcuts.app shortcuts, shell commands, etc. Anyway, with those design thoughts out of the way... The current URL syntax to shorten a link is:
And for password protecting a new link...
In hindsight, I think specifying the
And then if you wanted a custom slug and password, it could be extended to...
That makes sense to me, especially since it's probably more likely that someone would want to specify a slug vs create a password. (Is that a wrong assumption?) So I like having the slug be the primary (first) parameter. But then what if someone wants a password but without a custom slug? I'm not sure how to handle that. The problem with my custom slug URL suggestions above is that they will break compatibility with the script as it currently is since the Thoughts? |
My thought is that it is probably better to accept normal GET requests. Such as this: That way order does not matter at all and more features can easily be added. The way you did it always seemed a little confusing to me, but I understand your desire for simplicity. |
You're probably right. It will get unwieldy over time. I'm fine with switching to real GET query string parameters. Would |
Good question. I will figure it out, but first, I have an important question: How should this be implemented. I can think of two options:
The former would be cleaner, so I believe that is the way to go. But there is the quesiton of how exactly it should be broken up. The exact endpoints should be established before proceeding. |
I like
and
|
I will implement this through the next few days. I think I should make it backwards compatable. It does not seem to be so hard to do that. But then again, it may make the code a little too complex than it needs to be for something that has only "eight people using it". |
Yeah, I would just go ahead and make it break compatibility. Folks can stabilize around the new API going forward. Thanks for working on this! |
I am having great progress on this, but I have another question. Should the |
Another problem I am trying to work around is with URLs which include I could make it so that it detects when there are perameters which |
I figure that it is a good idea to do use GET requests here. I forgot about password protections. So I will proceed with this part. |
No description provided.
The text was updated successfully, but these errors were encountered: