People have many reasons they want a shorter URL. Twitter is only one of them.
For example, if I go to some random product page on Amazon, the link looks something like this:
https://www.amazon.com/Really-Long-Product-Name/dp/PRODUCTID/?_encoding=UTF8&pd_rd_w=garbage&pf_rd_p=long-garbage-value-that-doesnt-matter-to-the-user&pf_rd_r=MORELONGGARBAGE&pd_rd_r=another-really-long-garbage-value&pd_rd_wg=garbage&ref_=even_more_garbage&th=1
That link looks ridiculous and isn't suited for sharing in many situations. For most people, this is the link they really want: https://www.amazon.com/dp/PRODUCTID/
I know there are tools out there that can shorten URLs like that. I used to have a browser extension which did exactly that. It doesn't work for everything, but at least your link wont die because a third-party service shut down or messed up.Because of that it ultimately needs to a site-specific database/algorithm, perhaps with a fallback to the default behaviour like simply cleaning up the most common garbage like (_encoding/usg/etc). I suspect it's possible to use some sort of machine learning to guess the meaningful parts of the URL path/query/fragments, but even for that we need some human curation for the training set. I wish we could collaborate on a shared database/library for that, have sketched some ideas/applications/prior art here: https://beepb00p.xyz/exobrain/projects/cannon.html
I started thinking about it since I have a similar problem in Promnesia (https://github.com/karlicoss/promnesia#readme), a knowledge management tool I'm working on. Ideally I want to normalise URLS, so they address the exact bit of information, and nothing more.
Additionally, CleanURLs to the rescue! https://github.com/ClearURLs
load the page with the original URL
for each part of the URL:
remove that part of the URL
load the page with the modified URL
if the page rendered differently:
put that part back
You'd need to incorporate an ad blocker, otherwise changing ads on each reload could screw it up. Of course, you'd also probably want to hard-code in logic for popular websites like Amazon to avoid wasting time with reloads.And I know there are limitations to the concept. It wont work for pages which require authentication or any kind of session data. It wont work for pages which are intentionally dynamic. It wont work for sites which cannot be accessed by the service. It wont be useful for pages who simply have long URLs. But it probably covers the many common use cases for a URL shortener, and you could always fall back on traditional shortening methods (redirecting) when it doesn't work.
So it basically automates detecting useful bits for a particular URL, but it's kind of time consuming and flaky. It could be very helpful to populate the 'rules' database though, and then this database could be shared with other people so they don't have to scrape.
I guess when I said ML (or preferably some fuzzy algorithm/heuristic), I was referring to generifying rules so they also work on the sites not in the rules database. If humans can detect garbage in the URL looking at a few examples, the computer can too :)
Affiliate links used to catch some heat on HN but https://amzn.to seems to be showing up in more and more comments without too much blowback. It wasn't mentioned much that affiliates could view everything people bought while under their cookie, but I'm not sure if that's still possible.
There are worse things that could happen than shutting down too. Someone with control of an old shortener domain could set up spoof versions of the site that a link used to forward to and use it to harvest passwords or get people to install malware.
Ok, maybe you mean mobile only: i have a wifi only android phone that I don't use email on, none of those options work.
But really, opaque short URLs are significantly worse than the full URL: you have to go to extra effort to create them, and extra effort to retrieve from them, and you’re adding an additional point of failure, and you can no longer just read the URL.
EDIT: also for vanity "rememberable" urls
But for "vanity", the best vanity URL is a domain name. Buy it, own it.
foo.com/sites/blog/signup-for-my-conference-2022-seo-friendly-url
vs
shortenedurl.com/conf-2022
URL shorteners offering vanity urls solved people not needing to deal with the hassle of purchasing a vanity domain via a registrar, setting up DNS records, and waiting for propagation.
URL shorteners came later, and solved the problem of people needing to deal with “more steps” in order to have short memorable urls. Achieving memorable urls in “less steps” is one of the major selling points of url shorteners.
However, url shorteners did not solve short memorable urls — DNS had already solved that. But, as you’ve pointed out, acquiring a domain and setting up DNS records takes more work than simply using a url shortener service.