Closed arkag closed 7 years ago
Also seems like the detection for strictly shortening the URL isn't working. I can't shorten this url either, it just pastes the url: https://ptpb.pw/wW4O
I'm very aware shorturl-related things could probably be improved.
I can't shorten this url either
The current behavior is: if it already exists as a paste, you can't (re)create it as a shorturl--this is because a paste with digest 12e63c3be3035fcfb4ce043134f2c5cca8c16e0e
already exists, so instead of modifying it with the redirect=1
attribute like you probably expect, it returns the existing paste with no mutation. See the status: created
vs status: already exists
.
I could probably be easily convinced to tweak this in some way. Mildly related is #152.
/?u=1
I added this because people were complaining about how the default paste response behavior was "too complicated" or "too verbose", etc… This is only a display/response-related thing, and has zero impact on what is actually done during request processing--instead of yaml, you get just a single string which is the paste/shorturl. People use this in their shell aliases/functions for "easier" parsing I guess.
It is also completely unrelated to the /u
route, despite being the same letter.
URL shortening doesn't work when passing the URL only flag: /?u=1
That's because that's not the shorturl route. You want /u
instead.
Other than the API being bad/inconsistent (blame @silverp1), is there an actual bug here? Or do you have a suggested modification?
I also realize maybe you're actually asking for /u
to support ?u=1
(/u?u=1
), which I imagine it probably doesn't(?). I would definitely agree with a request to refactor that view completely, if that's the case.
So I think maybe I was being an idiot. I attempted to shorten this url just now and it seems to work: https://ptpb.pw/YhtO
I am using Hammerspoon on my Mac to create a pbpst like functionality on OSX. I've stopped trying to use the URL only output and instead am using regex to pull the url: via the tag in front of it.
It seems to be working, so I'll close this.
Sorry for the confusion!
No problem!
Different flag provides two different pastes, one gives me the actual redirect, the other gives me the url in a paste.