Live data from Hacker News

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

github.com

121–130 of 182 posts

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

#121
This could be implemented on top of any collaborative tool such as Wikipedia or anywhere a user can enter some text something like a comment section. For example instead of creating Github issue every time one could just reply to an existing issue with the desired URL and have the tool redirect to it based on a unique id.

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

#122
I would find it better if he'd add something like an auto accept pull request bot, that allows you to append a single url (with validation check + rate limiting) to a file, that will be read by the url shortener + auto deploy on new master commit. That would be truly databaseless.

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

#123

I made a URL shortener for the organization I work at using Amazon S3. I created a bucket that is hosted as a website, to which I upload empty files with the "Redirect" metadata field to indicate the destination.

I'm happy I wasn't the only one to do this, especially after seeing this comment:

> Unlike many URL shorteners, this one does not need a database and can be entirely hosted on GitHub pages.

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

#125

I would find it better if he'd add something like an auto accept pull request bot, that allows you to append a single url (with validation check + rate limiting) to a file, that will be read by the url shortener + auto deploy on new master commit. That would be truly databaseless.

Well I would believe that even a `json` file or any other form of storage written to disk is considered a database, But your suggestion definitely brings it further away from an actual database!

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

#126

I would find it better if he'd add something like an auto accept pull request bot, that allows you to append a single url (with validation check + rate limiting) to a file, that will be read by the url shortener + auto deploy on new master commit. That would be truly databaseless.

Well I would believe that even a `json` file or any other form of storage written to disk is considered a database, But your suggestion definitely brings it further away from an actual database!

Well, if by your definition a flat .txt file is considered to be a database then yes.

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

#127

> 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

A URL shortener can be done with no database - I did it using only Lambda functions once, but I wouldn't recommend it. :) https://kevinkuchta.com/2018/03/lambda-only-url-shortener/

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

#128
post #8

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

Any particular reason why you wrote 1 rather than 0?

Not really. Copied it from somewhere else where the placeholder value was 7. 1 came to my mind before 0. Zero seems like it could be UB.

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

#129

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…

"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

[2] https://0x.co/hnfaq.html

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

#130

> 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

Just like serverless still has servers, this can be reasonably called dbless :)

Exactly, so let's not repeat that mistake!
Post reply on HN