Show HN: I made an open-source Bitly alternative
dub.sh
dub.sh
That way, when you shut down your service, we can figure out what some of these short links went to.
That's a reasonable assumption, since the service is not likely to be sustainable financially.
I love that it's open source, the site design is beautiful, and the service looks well made. Good luck!
If you are sending automated sms, to around phone carrier blocking people use bit.ly etc. A new domain would take a lot of testing.
Gonna think about how I can optimize that further! Thanks for the headsup y'all!
To go even further, if you have gigabit internet and the data center that hosts your drive is in the same city as you, then putting your swap in cloud storage could potentially be faster than storing it on a hard drive!
Obviously, this is making a lot of assumptions, like your ISP doesn't do any silly routing (I'm in Portland, and for a while a couple years ago, my ISP routed all my traffic through Seattle), assumes the cloud storage provider is using solid state storage, and all the code involved in retrieving it doesn't add more than a couple ms of latency.
There's a delay with data reaching a location, so why can't we send data to ourselves around the globe and when it gets to us, send it around again.. just around and around.
I don't get it.
I just merged a PR to fix this though – are you still facing this issue?
Can y'all check again and let me know if the performance issue is still bad? Feel free to reply here or send me an email at steven[at]dub.sh
FYI Shu (https://github.com/shuding) is the creator of the globe library that I'm using on the home page: https://cobe.vercel.app, it's really good!
Length (in many contexts). Agree or disagree, but that answers your question for the "why" from what I have seen in my experience. Marketing wants to link to something sexy like "te.st/dog" vs "news.ycombinator.com/item?id=32939407". Many sites may have longer url structures (esp nested structures) for various reasons that are not easy to remember or sexy to have on an ad, so when it's short it's easy to remember, and simple to type out for the user.
People using these kind of links shorterner are people using bad tools and bad UIs. This is that usage that needs to be corrected, and not by inventing things even more stupid.
It never occured to me to type an url from a radio or TV message and I've never heard anyone spelling an url from a url shortener. All TV/radio broadcasters will rather tell you check for more information in "name of the show" on "domain of the TV/radio channel" or their social media feed. They all have a web presence anyway.
Agreed
>It never occurred to me to type an url from a radio or TV message and I've never heard anyone spelling an url from a url shortener.
It happens. How do I know? Every time I've included a url (shortened or not) in a radio/tv ad, I've gotten verified traffic.
> All TV/radio broadcasters will rather tell you check for more information in "name of the show" on "domain of the TV/radio channel" or their social media feed.
This is a best practice for sure, but we all answer to someone, and that someone might not care.
Disagree. I can't scan or type a QR code into my computer.
- BlitzMail, via email - Joplin, via desktop client - Nextcloud/Owncloud - Termux, e.g. via ssh, rsync, ...
Various messenger apps with desktop clients or web interfaces, e.g. Element (matrix.org) or Threema.
Admittedly, sending it via e-mail or something would cut out a couple of those steps (still a far cry from "just copy/paste"), and is what I do on those rare occasions I do need to take a URL from my phone to my laptop, but you know what's even easier? Just sitting down at the damn keyboard and typing in whatever.com/coolthing.
Why do I need two devices just to browse your damn website on a decent sized screen or buy your product?
- scan a qrcode with a qrcode app (I use a version from f-droid) - choose "share as text" in the app - select the Owncloud app, which asks me what name the file should have
No browser step needed on the phone. In the desktop's browser I navigate to the Owncloud, open the file just saved and click on the link. No cut/copy/paste involved.
What I really do:
- scan the qr code (or the text with an OCR app like TextFairy) - share the snippet with the Joplin app - open the Joplin desktop version and there's the link or text
Or I actually use Blitzmail (share as text from some other app, which counts as the "cut" step of cut/copy/paste), then select the email arriving on the desktop and select the link (i.e. "copy" ) and "paste" it into the browser, where the last step is usually done by the desktop which offers a "open this link" menu for links in texts.
Using the Blitzmail app serves as an easy record keeping device too, when I just send a whole text block containing a link, so I have the context at hand later, if needed.
But it's not rocket science. Why the heck my iOS camera has a built in QRcode reader, but why doesn't Firefox or my webcam app on my PC?
It's niche but I always come across it when setting up a new 2FA account and I need to save the code through the mobile app instead of my PC. Such bullshit.
Agreed that QR codes are better for mobile devices and sometimes useful on a laptop.
But also QR codes can only be scanned as long as visible.
corp.ltd/specialoffer is easy to remember and type on any device
https://help.twitter.com/en/using-twitter/how-to-tweet-a-lin...
Switched it out with a cheap commercial short URL system with its own domain, and the marketers could login anytime and make their own URLs, see all the analytics, edit the destinations, etc.
Everyone was much happier after that. It did indeed cut the wait from days to seconds, and plus they had real-time usage data after that.
The problem is the DNS system itself. It is the reason that your email address gets spammed, and the reason that you can DDOS websites, etc.
DNS is a glorified search engine, and it is only really used for root urls like mydomain.tld . It's pretty much only good in two contexts:
1) for when people dictate a specific domain name verbally to someone, and even then, spelling errors can occur.
2) advertising a URL somewhere to a landing site. But you can just use a QR code that people can scan, or a link in a webpage.
Everything else may as well be at non-human-readable domain names, in which case you can even use distributed hash tables instead of DNS. Perhaps one day browsers will allow plugins realize their own schemas, such as ipfs://hjkldfjhsdfkjgsdhfgsdf and the plugin would do the routing instead of DNS. Is that currently possible with standard browser extensions?
Instead, you could be giving out capabilities, to send you email. And if one of them was abused, you'd simply turn it off, and only accounts who used it in the past could continue to send. New ones wouldn't be.
You want it to be as short and memorable as possible for anything which has limited "screen" time. Which is basically everything, i.e. Radio broadcasts, video streams/adverts, Billboards you drive by, advertisements on websites etc.
I think the paid version let's you do custom URLs but that is just a worse version of doing it yourself since a typo can lead to a completely random website.
I think tinyurl had a similar mechanism.
Nothing, but how would you then track users and redirect through 3 nested services to attribute purchases? ;)
https://some.tld/obvious-tracking/some-transparent.png?someUniqueCodeI mean, on a personal level sure, but if you need to get out an SMS with a link and a coherent message, you want all the characters you can get.
I would give the marketing/sales team a way to update the letter/HEX map as a plain text file.
Nothing's wrong with normal URLs. Every post on my website can be reached by a single decimal number appended to the end of the domain.
But this requires every website on the internet to care about having URLs of reasonable length. URL shorteners allow a third party to put a bandaid over the problem.
I work daily with short links, because we need to pass parameters in URL and, depending on the amount of parameters you use in your URL, it gets bigger quickly.
Then you have many stakeholders, with no IT background, using those links and if for some reason they use ctrl+c missing some part of that big URL, the access will be broken and then they will complain its not working.
Short links are better to avoid that problem.
If you want tracking and statistics though, it gets more complicated. The simple version can be a good way to get into web development now that I think about it. You learn about forms, GET/POST, databases, very basic SQL etc.
how it works with the domain tho? i need to buy a short domain that will concatenate with my database strings, is that correct?
I've seen some random blogging software break when you embed certain kinds of links into articles, for example, ones that have query strings (?key=value), where the question mark gets interpreted as something else by the software and thus the link gets cut off and no longer works.
In cases like that, it makes sense (because you literally don't have a choice, unless you want to migrate to something else).
Also some might enjoy the consistency of short links, instead of having a URL that's really long. That is also pretty nice for putting the URL on a poster, flier, or sending it to someone.
Some also just don't care about the implications of the link going down in the future.
My plan with Dub is to keep this running at a sustainable pace for as long as possible, and I believe it's possible for a few reasons:
- Operating costs for Dub are quite low at the moment, thanks to Edge Functions (https://vercel.com/edge) + Redis.
- I'm leaning into the custom domains & self-hosted aspect with the freemium model – where enterprises and businesses would be able to get set up with a custom domain link shortener super easily.
- Agree that individual short links are definitely not sustainable in the long run, I might set a rule where randomly-generated links > 30 days get deleted, to save it you'll either need to make an account (to prevent spam) or set up your own domain.
* Allow you to "buy" transparent clicks for your URL (e.g. 1 cent per "transparent" click)
* Implement "ad gateway" like what adf.ly does for non-transparent URLs
* Give you X small amount of "transparent" clicks for free
* Use something like IPFS or (gasp) Ethereum blockchain for storing the data... allow you to keep your URLs alive by paying for them (this last one is not that clear)
* [Don't kill me] At some point (back when it had started) I though of putting a WASM miner in a frame when visiting a page.
My main problem is that I have not been able to get a good domain name.
Sort of :-)
Hmm... I wonder if Google interprets and follows QR Codes?
Most comments I see here are questioning why we still need URL shorteners. Print, media, SMS, and analytics are just a few reasons. I wrote some additional info on my blog: https://timleland.com/are-url-shorteners-useful-today/
Another interesting thought is when you create a TinyURL, it's 20 characters long, and Bitly links are 14 characters long. These services cannot create short links anymore. As a URL shortener grows, the number of actual short links diminishes. Currently, T.LY has over 10 million short links, which means plenty of four and five-character short URLs are available.
Two character URLs 3,844 (62^2) unique combinations
Three character URLs 238,328 (62^3) unique combinations
Four character URLs 14,776,336 (62^4) unique combinations
Five character URLs 916,132,832 (62^5) unique combinations
Six character URLs 56,800,235,584 (62^6) unique combinations
Seven character URLs 3,521,614,606,208 (62^7) unique combinations
Eight character URLs 218,340,105,584,896 (62^8) unique combinations
And (if you don't mind answering) how much does such a short domain like t.ly cost?
I'm planning to not allow emojis simply because of the accessibility challenges that it presents to users :')
Emoji domains though, on the other hand, are really cool and more than welcome to be added :)
Also, very interesting note regarding the hash combinations! The main focus of Dub is probably going to be for folks to add their own domains – but this is something that I'll keep in mind as well!
https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
google.com becomes https://aaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
shadyurl.com was fun while it lasted. Tagline: Don’t just shorten your Shady URL, make it suspicious and frightening.
Shorten URLs using invisible spaces
I've not looked into the problem again in 10+ years since. If I did I would 100% skip the free plan.
As far as link shorteners go, I actually host my own containerized instance of YOURLS: https://yourls.org/
It's fairly boring and not really pretty, but it seems to work okay for me.
Actually, as far as self-hosting goes, there's quite a few options out there: https://github.com/awesome-selfhosted/awesome-selfhosted#url...
Of course, one can also find some free services hosted by others.
I also had noticeable lag using Chrome (on desktop)
Your site is good without the globe.
Application error: a client-side exception has occurred (see the browser console for more information).Can y'all check again and let me know if the performance issue is still bad? Feel free to reply here or send me an email at steven[at]dub.sh
I can scroll to bottom without crashing, but it is still high cpu usage and fans start spinning.
For personal use I just curl one of these URLs from my linux machine: https://wiki.archlinux.org/title/List_of_applications#Pasteb...
Can you check again and let me know if the performance issue is still bad?
For something like this there is perhaps extra factors like someone else worrying about abuse by malicious users and the resulting risk of being black-listed by spam filters.
My first idea is blacklisting certain problematic hostnames and not let folks add them. Can you think of any other abuse vectors?
Just be prepared that your service will be (ab)used for linking to malware, pirated content, porn.
Here's the regex that I ended up with: https://github.com/steven-tey/dub/blob/main/lib/utils.ts#L12...
It can be backed by a TOML file for hardcoding URLS or a database for making it easy to add new ones (which I think is the Google way).
If I did a stupid; or a better version already exists: let me know.
That being said, absolutely love your spin on the go/ links – I learned about it from my friend who works at GitHub and it's kinda blown my mind ever since :)
I'm hesitant to try another alternative because I wouldn't want to get set up in a new system, only to have these problems crop up again.
In the meantime, you can also use your own custom domain for maximum control: https://twitter.com/steventey/status/1572958205814214657
Gonna think about how I can optimize that further! Thanks for the headsup!
- Does this use any blacklist to prevent URL shortener looping (i.e. using multiple URL shorteners on top of each other to bypass the checking), or preventing any potentially malicious sites? - Does this have rate limits? URL shorteners get abused quite regularly, so this should be necessary.
I'm planning to blacklist certain problematic hostnames and not let folks add them.
In terms of rate limits, it does have rate limits when it comes to collecting analytics (if you spam click a link >10 times in 10s it still redirects you but it stops recording clicks.
I can't think of how URL looping could bypass checking – could you elaborate?
It started as a simple nginx URL map since I was already running nginx (https://gist.github.com/statico/14fa84d7e79722031d5e49694191...) but is now a tiny containerized app because friends requested an index page. The requirement is that all links need to be named (i.e. no random hashes).
Real shame how it went from convenience tool (and largely coupled with microblogging character limit) to aggressive corporate tracking (though bitly was always a champion of the latter)
https://developers.googleblog.com/2018/03/transitioning-goog...
My plan here is to lean into the custom domains & self-hosted aspect – where enterprises and businesses would be able to get set up with a custom domain link shortener super easily.
Individual short links are definitely not sustainable in the long run, I might set a rule where randomly-generated links > 30 days get deleted, to save it you'll either need to make an account (to prevent spam) or set up your own domain.
Intended to self host for free/minimal cost on CloudFlare, thus comes with built in analytics, BYO domain, etc.
Logical next step would be to hook it into KV and include a basic auth/admin API for editing routes and retrieving stats. But even that would add a bucket load of complexity to what is essentially 20-30 lines of obtuse logic currently.
Definitely no plans to deploy as a service with custom domains and enterprise offerings :)
I'm using Bromite on Android
I had a .vze.com subdomain registered there in approx. 2006 and it still is live. Unfortunately, the target domain and website is long gone.
Great work
And thanks a lot for the kind words!
E.g. https://dub.sh/stats/github
But I like this idea, might just add it to Dub... ;)
Here's the full list of design inspirations for the site: https://twitter.com/steventey/status/1572958213250629633
I recently deployed my own Rallly instance (Doodle alternative) via docker-compose and would love to give dub.sh a try.
Any plans for releasing a docker version?