Live data from Hacker News

Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

github.com

21–30 of 182 posts

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#22
post #8

You could also push static HTML pages to the git root which have, e.g., https://news.ycombinator.com/ '" /> in the header.

I am not familiar with this, could you explain what will happen?

for browsers that load the page that contains that stanza and respect meta refresh, it will refresh and redirect you to the url=.

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#23

Interesting. This could be considered as abuse of github issues though.

Think of this as the software version of graffiti.

It is an artistic and creative way to shorten urls, but likely won’t exist forever. As long as it does though, we can appreciate the art for what it is.

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#24
post #4

Earlier quoted context omitted.

Looks 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 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…

HAHA 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 lo…

Indeed :)

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.

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#25

3425 lines in package-lock.json for a "Minimal URL shortener" https://github.com/nelsontky/gh-pages-url-shortener/blob/mai...

I always wondered if relying so much on external libraries in the long run is more hassle to maintain than doing it by yourself. Security updates will be provided for X major version for a reasonable amount of time, but afterwards you will have to update, check that nothing breaks and update your code as well. Also some of the deps will break regardless of SemVer and you will need to update.

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#27

> Unlike many URL shorteners, this one does not need a database and can be entirely hosted on GitHub pages. it does need a database though. it just uses someone else's database

HAHA yes it does opps slightly clickbait

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#30
Since I am running a URL shortener service https://blanq.io, my two cents:

1. I looked at https://github.com/nelsontky/gh-pages-url-shortener/blob/mai... and it is a basic script that does nothing more than redirection. A lot of URL shorteners on the web do a lot more. Premium ones can track users and route links based on client.

2. Most of URL shortening audience is non-technical and they usually like to pay and forget about it. Hosting and running your own service is an overhead.

3. Handling traffic at scale is challenging. So, if you have a lot of hits, I would not advise spending time maintaining the service.

4. Github can kill this anytime.

That said, this is neat solution for basic needs.

Post reply on HN