Hacker News new | past | comments | ask | show | jobs | submit login

A button to generate a shortened link. For example, when you click share on YouTube, you get a youtu.be link.



Why do you still need shortened links? For text messages, aesthetics, or ease of analog communication? Twitter, previously the main use case, no longer counts link length in tweets.


While I don't think the URL shortening matters too much, there's still another important attribute of using these shortlinks that manifests itself on youtube: They also omit irrelevant metadata like URL parameters that were specific to your session or the way you arrived at the site.

For example, youtube will often include extra garbage parameters for stuff like playlists - which the youtu.be shorturls omit, making them perfect for sharing videos.


These parameters are not apparent to those with whom you share the shortlink, but I'd wager that the site stores a mapping from the shortlink to the session in which it was generated. Which may be OK for you; I don't know.


the youtu.be link contains nothing but the video's identifier, so I don't see how they could store a mapping


Is the identifier unique? Does it have to be? Without switching to a different browser on a different IP addr and finding the same video again through a different search, would you even know?


Yes, the format is youtu.be/<video id> where <video id> matches the one in the long URL (youtube.com/watch?v=<video id>&extra patameters...) and is unique to the video.


Basically aesthetics. Especially with amazon, if I'm on mobile and copy a link (https://www.amazon.com/Haribo-Gummi-Candy-Gold-Bears-5-Pound...), it's got a bunch of excess weight. I can just cut it down to https://www.amazon.com/dp/B000EVOSE4/ without any loss of data. Alternatively, you can use bit.ly or an extension (https://chrome.google.com/webstore/detail/native-url-shorten...) to shorten it to http://amzn.to/2aTrW7v. However, this is a pain on mobile. The share buttons should just work. I think they might do it this way for increased analytics or referral links, however they should be able to do that with bit.ly too.


This feature already exists and you don't need a button for it. It's part of HTML metadata, specifically the <link rel="shortlink"> tag.

You could either provide some sort of button to your browser to place this into the clipboard, or use an extension like pentadactyl to add a keyboard shortcut for it. (It's simply “y” by default - so copying URLs works like yanking in vim)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: