6 ms·
I was always fixated with URL shorteners and always wanted to write one myself. While it would be easy to write one that works with a server, I loved the idea o
by nelsontky 6y ago
I was always fixated with URL shorteners and always wanted to write one myself. While it would be easy to write one that works with a server, I loved the idea of hosting and running one for free.
Thus, I wrote this URL shortener which does not need a backend to work at all. It uses GitHub issues as a "database", and unlike most other URL shorteners that do not need backends, this one doesn't need a # prefixed to the alias. (i.e. short URLs look clean like this: nlsn.cf/1 instead of looking like this: nlsn.cf/#1)
I haven't had the time to work on it more but do let me know what you guys think! Thank you and hope yall enjoy it!
- diggan 6y agoLooks nice and simple! Bit strange to claim "there is no database" and then add "GitHub issues is the database", maybe add "there is no traditional RDMS/document database needed" or something similar. You might want to detect infinite loops as well :) https://nlsn.cf/6 https://nlsn.cf/6 Last note, the status code seems to be incorrectly set to 404 instead of any of the redirection status code. If you're hosting it on GitHub pages, I'm not sure you can actually control it. If the status code was correctly set + the Location header, I think all browsers would be able to detect the infinite loop automatically and prevent it.
- quyleanh 6y agoIf you use it personally and you know what you are doing, I think this idea is good. For example I have my own domain and when I share long link to friends, I can use it. By the way, your feedback is good for author improves. Thank you.
- nelsontky 6y agoHAHA so that was you. That was a good one! Yes and that title is definitely slightly misleading I kinda didn't want it to get so long and wanted that slight clickbait effect. Yep I actually cannot control the status code at all. Part of what made this a fun and hacky project was the fact that I was actually redirecting to the actual URLs by catching the 404s. So, the only way i could think of catching the infinite loop was to supply the domain. That being said, I do appreciate the feedback and it's always great to learn more!
- diggan 6y agoIndeed :) I think you could catch the infinitive loop client-side as well by comparing what the URL to redirect to is, and comparing it with the current URL. If they are the same, prevent the redirect. Although you would still be able to create loops by using two issues instead. Maybe just comparing the full hostname? If it's nlsn.cf, don't redirect.
- a1369209993 6y ago> Maybe just comparing the full hostname? If it's nlsn.cf, don't redirect. Doesn't work; eg, make http://someothershorten.er/foo http://someothershorten.er/foo -> http://nlsn.cf/1234 http://nlsn.cf/1234 -> http://someothershorten.er/foo http://someothershorten.er/foo.
- alexvoda 6y agoHow about making it turing complete?
- woutr_be 6y agoThat’s clever! I once did the same, except I used a static site generator that I would push to Github and deploy on Netlify.
- robbiemitchell 6y agoI’d love to know more about how you did this!
- iamacyborg 6y agoYeah I suspect you could do something nifty along these lines with Netlify Functions.
- woutr_be 6y agoI didn’t even use Netlify functions, it was all just HTML and a few lines of JavaScript.
- bdorn 6y ago> does not need a backend GitHub issues infrastructure is a backend!
- rsync 6y ago"I was always fixated with URL shorteners and always wanted to write one myself. While it would be easy to write one that works with a server, I loved the idea of hosting and running one for free." I felt exactly the same way and did, in fact, build one.[1] It was pretty simple. There's an interesting twist to the particular one I built - it's not specifically a URL shortener, it's a "Universal Shortener".[2] Also no tracking or cookies or third party connections, which I find pleasing. The disappointing part is seeing the malicious spam and phishing URLs that get shortened. We have had to manually flag-hold-approve a lot of strings and IIRC we outright block anything with 'paypal' in it. We also gave a kill-function to our upstream ISP so that they could immediately act on phishing complaints without our having to be involved in real-time. [1] https://0x.co https://0x.co [2] https://0x.co/hnfaq.html https://0x.co/hnfaq.html
- nelsontky 6y agoOh that is cool! It does remind me of https://telegra.ph/ https://telegra.ph/ by Telegram! (Even though they weren't really advertising it as a universal shortener). Just a quick question, how did you promote your platform!
- rsync 6y agoI've done almost nothing to promote it. I just mention it once in a while (like now) when the topic of shorteners comes up. I also sent a notice to all rsync.net customers, years ago, when we launched it. That's it.
- ValentineC 6y agoSince we're on HN, and this isn't addressed in either FAQ: did anyone end up paying for custom codes?
- rsync 6y agoYes! People do, in fact, buy codes. I've spent almost zero time on "Oh By" in the last 24 months as things at rsync.net have been very busy. So, we haven't made a sale in months due to lack of publicizing it. However, I think there are unknown, emergent use-cases out there for "Oh By" that I hope people will discover. I am going to pivot back to "Oh By" next year ...