5 ms·
Show HN: Shortly, a serverless pastebin
- lucaspiller 15y agoInspired 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.)
- xiaomei 15y agoThis could be extended by adding file upload support. What impact would this have under a SOPA-world?
- zitterbewegung 15y agoHrm, if you add a link shortening service you can host the pastebin http://bit.ly/IcBhvN http://bit.ly/IcBhvN
- aba_sababa 15y agoSweet hack. Would be cool if there was a way to make it secure as well...
- kijin 15y agoWhat kind of security risk do you have in mind?
- wavephorm 15y agoTake a look at this: http://www.vincentcheung.ca/jsencryption/ http://www.vincentcheung.ca/jsencryption/ A lot of ciphers have been ported to JavaScript now: http://code.google.com/p/crypto-js/ http://code.google.com/p/crypto-js/
- Ralith 15y agoAnd what benefit do you imagine that conferring?
- wavephorm 15y agoBy encrypting the data before turning into a URL neither the server, nor anyone who obtains that URL would be able to read the message without knowing the password.
- prurigro 15y agoKinda like how ezcrypt works? https://ezcrypt.it/ https://ezcrypt.it/
- lucaspiller 15y agoAs I understand it this is exactly how Zerobin works. The server stores the encrypted data, and the key is passed in the URL only.
- 15y ago
- replax 15y agoNice service, I like the idea very much. One problem I noticed with it though: It does not work correctly with Japanese text. I can input & "save" Japanese, but upon opening that link the text will not be displayed correctly.
- TazeTSchnitzel 15y agoJavaScript's stuck with UTF-16, so apps assuming bytes not shorts will mangle text.
- nigma 15y agoIn the same vein, http://hashify.me/ http://hashify.me/ stores markdown documents in URL and uses bitly for "persistence". Previous discussion here http://news.ycombinator.com/item?id=3407197/ http://news.ycombinator.com/item?id=3407197/
- johtso 15y agoSomeone made a service like this last year (http://hashify.me http://hashify.me). HN submission: http://news.ycombinator.com/item?id=2464213 http://news.ycombinator.com/item?id=2464213
- skeptical 15y agoNot the same thing, at all. There's no encryption in hashify.me. No hashing either, despite the name.
- est 15y agowhy not sending this directly? http://en.wikipedia.org/wiki/Data_URI_scheme http://en.wikipedia.org/wiki/Data_URI_scheme data:text/html;charset=utf-8,Hi HN
- deleted 15y ago[deleted]
- JoshTriplett 15y agohttp://caniuse.com/#feat=datauri http://caniuse.com/#feat=datauri
- lucaspiller 15y agodatauri encoded would be larger (this is deflated before being based64 encoded), and the formatting for the docuent needs to be encoded within the URL where as this doesn't. Plus it doesn't make a cool HN story :P
- vessenes 15y agoThis is cool! I think you should implement the hash-based encryption key support from Zerobin, though. That way you could send around the message or the message and the key, as you choose.
- lsiebert 15y agoHashify.me lets you store an entire webpage in a url. As I recall it links bitly addresses. This lets you store up to 22500 characters. Now you combine that with this in a bookmarklet / plugin. Add some obfuscation so bitly or whatever url shortener you use has a hard time detecting you and so the wrong anchor or no anchor shows an innocuous page. Now the host isn't aware of the existence of the data nor is the encryption being done using server side code. I am of course probably missing a huge flaw, so someone tell me why this won't work and how to fix it.
- SeoxyS 15y agoI'm being pedantic, but this is not a server-less pastebin. A server must still serve the HTML page and the javascript used to decode its content. A truly server-less pastebin would use the `data:` URL scheme to encode the html & js script boilerplate in addition to its content.
- TazeTSchnitzel 15y agoWell, the thing I thought of by "server-less" was P2P. A P2P pastebin would be very interesting.
- TeMPOraL 15y agoWell yes, and no. All paste data is stored in the URL, and the algorithm for encoding/decoding is known[1]. Github-hosted tool provides only the default implementation. You're right, data: would be more pure, but AFAIR it has some limitations. [1] - https://github.com/lucaspiller/shortly https://github.com/lucaspiller/shortly
- TazeTSchnitzel 15y agoWell that was disappointing. I was hoping for a distributed P2P object store.
- _quasimodo 15y agoso, basically you are abusing link shorteners for data storage :) i would like something like this for binary data, with the option to specify a filename, as that is something the data url scheme does not provide.
- NameNickHN 15y agoI'm running several URL shorteners and I don't mind.