Brian Lovin
/
Hacker News

Show HN: Host a Website in the URL

smolsite.zip

I wrote this silly thing a couple of weeks ago. It's absolutely useless but it's a fun tech demo for my web server library. Enjoy!

Daily Digest email

Get the top HN stories in your inbox every day.

Lerc

selcuka

Neat. You can then let TinyURL host your web site:

https://tinyurl.com/dmk9e4m2

Zuiii

Congratulations, you've turned tinyurl into a free web hosting service.

6th

I love the way the smoke seems to be coming off the top of it.

Just a second. I'm late for golf!

louthy

If it gets out of hand, make sure you know the new number for the security services:

0118999881999119725 ...3

And yes, I have that memorised!

seanthemon

Of course! Made in Britain

pluijzer

I made a QR code from this link. It really isn't anything crazy. Isn't that cool, we can host websites from QR codes!

yonatan8070

Hosting a website without a computer is quite cool if you ask me

prox

Wow, this is just crazy cool. I can imagine this growing into a thing.

7ewis

I was fully expecting to see Rick Astley!

SLWW

and now my Thinkpad is rethinking it's lack of resources.

acidx

I love this!

undefined

[deleted]

dmazzoni

Just in case anyone doesn't already know, you can do that with a data uri as well:

data:text/html,<h1>My%20small%20website</h1><p>Look,%20it's%20real!</p>

You can use a data uri generator to base64-encode it, if you want.

Advantages of smolsite:

- Zip might let you fit a bit more than a data uri

- Some JS APIs would work on a smolsite url, but wouldn't work in a data uri

maxbond

You can use this trick to get a handy notepad.

    data:text/html,<html contenteditable>
I keep it on my bookmarks toolbar.

loueed

I also have a bookmarklet for quick notes.

> data:text/html,<html contenteditable><body style="margin: 10vh auto; max-width: 720px; font-family: system-ui"><h1>New Note

I added some basic styles so I can screenshare :D

Also in most browsers, CTRL + B, I and U work in contenteditable divs.

undefined

[deleted]

petabytes

Reminds me of what I did with ChromeOS in middle school, built a whole code editor in the URL bar.

undebuggable

Duh, one can load preconfigured ACE editor with syntax highlighting with it.

pcthrowaway

> Some JS APIs would work on a smolsite url, but wouldn't work in a data uri

In before someone writes a smolsite to install a service worker on the domain that sends analytics for all other smolsites to their own server

account42

Just another reason why service workers were a mistake and should be removed.

rpastuszak

I'm using Base64 + gzip (IIRC) which allows me to store ca 5kb of text in a single Tweet: https://sonnet.io/projects#:~:text=Laconic!%20(a%20Twitter%2...

undebuggable

(Un)fortunately web browsers [1] and URL shorteners block opening and redirecting to data URLs so they are useful mostly as bookmarks in the web browser.

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_...

geonnave

On the subject of weird stuff on a URL, here is a prime dog: https://geonnave.github.io/primg/#17976931348623159077293051...

teacpde

This one is amazing, even just the fact that someone thought about representing images with binary format of prime number

userbinator

dmurray

The first version of this I saw came from the webcomic in this reddit thread about a prime number that looks like a giraffe.

After one commenter showed off this technique, someone else found a minimal prime giraffe: 7.

[0] https://www.reddit.com/r/math/comments/7qpfls/does_there_exi...

SushiHippie

Nice, reminds me of nopaste [0], which is a pastebin that stores the text in the url compressed with lzma and encoded with base64.

[0] https://nopaste.boris.sh/

dspillett

That will send the content to the server for unpacking. A slightly more convoluted option might be to put the zip in the anchor part instead and have the response serve code to unpack it from there client side. Though now the server can't scan for damaging content being sent via it, even if it wanted to, as the anchor part does not get sent to the server.

cnity

I thought the same thing (though you could do it without anchors as long as the static content server used a glob for routing all traffic to the same web page). It would really simplify hosting.

debarshri

this is really cool and I think it feel like how show HN should be instead of marketing ploy for other orgs pushing their product.

hsbauauvhabzb

I love this type of stuff too, but be aware ycombinator is a start up incubator - people showing off there wares is presumably encouraged, up to a point.

yellow_lead

It is and the leaders of yc even give instructions on how to best do their "launch hn."

debarshri

Launch and Show HN are different I think.

matheusmoreira

I don't think it qualifies as advertising. People come to Hacker News to see what hackers are working on. It's certainly a major reason why I come here.

Every Show HN post I've seen was interesting. Motivated me to start my own projects and polish them so I can show them here. It's a really good feeling when someone else submits your work and you get to talk about it.

Sponge5

> It's a really good feeling when someone else submits your work and you get to talk about it.

You may only "Show HN" something you've made yourself.

https://news.ycombinator.com/showhn.html

matheusmoreira

I know, I've never made a Show HN post myself. I meant to say other people independently submitted my project here once.

mathgeek

Do you get the impression that novel shows are pushed out by the more corporate ones?

debarshri

If you see here [1], many of them are building by orgs trying to sell some services. They may or may not violate the guidelines though.

[1] https://news.ycombinator.com/show

fouc

yeah and that's why interesting show HNs get upvoted

GMoromisato

I had an idea once to implement Borges's Library of Babel just like this: all the text is in the URL. With more sophisticated encoding, you can optimize English words. Then hook it up to a "search system" so you can search for your own name, clips of text, etc.

Eventually you'd hit the URL size limit, of course, but maybe we add a layer on top for curators to bundle sets of URLs together to produce larger texts. Maybe add some LLM magic to generate the bundles.

You'd end up with a library that has, not just every book ever written, but every book that could ever be written.

[Just kidding, of course: I know this is like saying that Notepad already has every book in existence--you just have to type them in.]

ossopite

This reminds me rather of https://libraryofbabel.info/

GMoromisato

Nice! That's exactly what I had in mind.

As usual, no idea is unique--it's all about who executes first!

tintedfireglass

No idea is unique, because the library of babel has all of the ideas humans can ever think of ;)

mk12345

Nice, I had a similar idea a while ago! I wanted to support other media types, such as images, audio and webpages. It was a really fun experiment!

https://mkaandorp.github.io/hdd-of-babel/

GMoromisato

Very cool!

alpb

joe5150

The comment in the first link about Yahoo embedding a giant b64-encoded JSON object in the URL reminds me of something horrible I did in a previous job.

To get around paying our website vendor (think locked-down hosted CMS) for an overpriced event calendar module, I coded a public page that would build a calendar using a base64-encoded basic JSON "events" schema embedded in a "data-events" attribute. Staff would use a non-public page that would pull the existing events data from the public page to prepopulate the calendar builder, which they could then use to edit the calendar and spit out a new code snippet to put on the public page. And so on.

It basically worked! But I think they eventually did just fork over the money for the calendar add-on.

tomcam

Wait what was horrible about it?

joe5150

Mostly just the DIV with a giant string of base64-encoded JSON in a data attribute that looked pretty ugly. Website visitors were of course basically none the wiser if it all worked.

rpastuszak

Can't find the HN link now, but here's the "Twitter CDN" project I posted a few years back (base64+gzip data URIs):

https://sonnet.io/projects#:~:text=Laconic!%20(a%20Twitter%2...

ihaveajob

This is hilarious, but I think it may have some practical applications. Watch out for hackers though.

grepfru_it

I immediately thought this is a great way to ship malicious payloads to an unexpected party. A good WAF would block it as sus, but a few tricks could probably get around that as well

anamexis

How is it different from any webpage in that regard?

misterbwong

The difference is that the contents of this website can be crafted by the attacker directly via the URL without having to do anything to the host.

mazokum

Reminded me of a site from the creator of Advent of Code to share solutions of the puzzles (or any plaintext for that matter).

https://github.com/topaz/paste

senseiV

Nice!

I remember seeing this for the first time on HN with urlpages, inspired me to build my own version of these

https://js-labs.js.org/

Daily Digest email

Get the top HN stories in your inbox every day.