Hacker News new | ask | show | jobs
by foobarbecue 2986 days ago
Or just use http://a.co/gVf3K0x ...
5 comments

They're talking about generating the shorter link just by looking at the first one (e.g., in your head).

How do you get your link out of https://www.amazon.com/Red-4TB-Hard-Disk-Drive/dp/B00EHBERSE... without using a tool?

I think the idea is that, if you have the original link then you would also be able to find the shorter link by simply clicking share on the page and use short product link generated by Amazon.

In practice, it is unlikely for anyone to share an Amazon link without having navigated to the page at least once. Given most sites have this option, it might seem silly to some that one suggests manually shortening the URL in the address bar instead of just clicking share.

Correct, that was what I was saying, and I agree there are lots of scenarios where you want link shortening without generating a new random string.
I used Amazon an an example because they are the first I learned to do this trick with. I know Amazon has canonical ways to shorten URLs. Many other sites don't. Here's Monoprice:

https://www.monoprice.com/product?c_id=102&cp_id=10260&cs_id...

p_id is all that matters:

https://www.monoprice.com/product?p_id=29523

95 chars to 45 chars.

CDW is more fun. They expect some pretty part of the URL, but don't do anything with it. So you shorten it to 1 char if you want the link to still work:

https://www.cdw.com/product/Tripp-Lite-10ft-Cat6-Gigabit-Sna...

becomes:

https://www.cdw.com/product/T/934322

127 chars to 37.

FWIW, my link is not equivalent to the one I replied to, and this lazy comment of mine probably deserves downvotes for making it seem I was implying that. These a.co links are not generated until requested, and new ones are generated each time they are requested. OP pointing out that you can quickly link to a common unique ID is valuable. I was just pointing out that the existing link shortener is pretty good.
the biggest difference here is I cannot tell if your link is amazon or if its gonna send me to a spam site or use your referral for amazon.
How do you easily shorten down to that? The others all used the same product code...his is a random URL