3 ms·
Inspired by ZeroBin I started to wonder whether you could create a pastebin service with no server side component. Shortly (yeah I'm not really sure what is wit
by lucaspiller 15y ago
Inspired by ZeroBin I started to wonder whether you could create a pastebin service with no server side component. Shortly (yeah I'm not really sure what is with the name) is the result of that.
Data is compressed using the deflate algorithm, then base64 encoded to ensure it can be stored safely in a URL. It is then set as the window.location.hash of the current page. Testing with various URL shorteners has shown that they don't care about long URLs generated by this. I still need to add checks to ensure that the URL isn't too long (I'm looking at you IE), but as a quick proof-of-concept I'm happy with what I've come up with. I'm wondering whether the same idea could be used to share data in other formats...
- b2spirit 15y agoShortly is catchy. Brilliant idea, by the way.
- NameNickHN 15y agoGreat idea. Most URL shorteners offer APIs. Why not automatically create a short URL?
- alecperkins 15y agoI use the same method for share links in http://padhacker.net http://padhacker.net, a server-less JSFiddle-type of tool. The data is just JSON, but I've been toying with adding arbitrary binary files. The link fragments explode with even small images. Some sort of chunking might be able to address this, with part of the fragment pointing to the next short URL in the series. (I recall seeing a project on top of bit.ly doing exactly this, but can't seem to find it.)