Shortly: a Serverless Pastebin Service - All Data is Stored in the URL
stackednotion.com
stackednotion.com
I'm able to paste the URL in firefox, but Chrome doesn't allow it.
data:text/html;,<textarea id="txt" cols=80 rows=24>hello there</textarea><br><input value="get link" type=button onclick="(function(){document.location.href=(document.location.href.replace(/24\>.*<\/textarea>/,'24>'+document.getElementById('txt').value+'</textarea>')); }())">
data:text/html;base64,PHRleHRhcmVhIGlkPSJ0eHQiIGNvbHM9ODAgcm9 3cz0yND47byk8L3RleHRhcmVhPjxicj48aW5wdXQgdmFsdWU9ImdldCBsaW5r IiB0eXBlPWJ1dHRvbiBvbmNsaWNrPSIoZnVuY3Rpb24oKXtkb2N1bWVudC5sb 2NhdGlvbi5ocmVmPSdkYXRhOnRleHQvaHRtbDtiYXNlNjQsJysod2luZG93Lm J0b2Eod2luZG93LmF0b2IoZG9jdW1lbnQubG9jYXRpb24uaHJlZi5zdWJzdHI oMjIpKS5yZXBsYWNlKC8yNFw+Lio8XC90ZXh0YXJlYT4vLCcyND4nK2RvY3Vt ZW50LmdldEVsZW1lbnRCeUlkKCd0eHQnKS52YWx1ZSsnJmx0Oy90ZXh0YXJlY SZndDsnKSkpfSgpKSI+
Then again, you could just offload the work to bit.ly and get around that issue.
In other words, this is entirely useless, except as an amusement. Because it's funny how useless it is.
But it still seems a bit unreliable. Accidentally clip a character off the URL and you're basically screwed.
And/or throw the url to a hidden box on the screen that will automatically copy when I hit cmd/ctrl C. Fun trick otherwise.
I made the same observation re: just sending the message: https://github.com/alfg/jot/issues/1
The problem is of course not specifiy to javascript. It should be "fat client crypto does not work".
EDIT: Looks like another commenter has already developed a solution :)
cat data.txt | ruby -ne 'require "uri"; print URI.escape($_)' > encoded.txtYes, in fact, with the solution linked, it's an increase in space requirements! In my experience, even with a traditional pastebin, the problem isn't being able to get the data over the wire -- it's formatting it. Also, this service opens up the possibility of (ab)using link shorteners for storage.
Alternatively, you could just give someone a Shortly link and write a note next to it saying “If that link doesn’t work, just run that URL’s hash fragment through Base64-decode followed by INFLATE”, relying on the user to search for suitable software in that case. That would not help a user who is offline, unless their OS comes with utilities for those algorithms, but it would help if you’re just worried about Shortly going down.
The link is really just an encoded form of the text anyway.
EDIT: Not to shit on this project, it's just that pastebin's are typically used to reduce the amount of text that gets pasted in an IRC channel.
1) Pasting into an IRC channel as already noted by someone else and;
2) Pasting text where formatting is important (such as a code snippet) into an email
The latter is of particular importance when sending through things like "tags" (ie. javascript snippets) to be embedded in HTML pages for things like analytics, conversion tracking, Wufoo forms, Wistia embeds and the like. If the formatting is off on a lot of that stuff because people have been copying and pasting it in and out of emails then they can end up not working at all.
NOW ... the advantage for me over something like pastie.org or pastebin is that when I paste a snippet into a Basecamp todo list item, for example, I'm creating an external dependency on those services for some or all of the relevant data to the todo list item.
By having a service which embeds the data into a URL that can then be decoded into it's original format without error, using something that I can reimplement myself if the original service should disappear, I end up with a much more "future proof" and reliable storage of that format sensitive information.
This was originally covered here a year ago:
https://news.ycombinator.com/item?id=3834643
Any questions, reply to me or raise an issue on GitHub! Thanks!
For me the big benefit here is that when I'm communicating code snippets that are often "format sensitive" through channels such as IRC, email or project management tools (like basecamp) I will almost always use a paste service in order to ensure that no crap creeps in throughout the process. I most frequently either use sprunge.us or pastie.org and grab the "raw" URL before pasting it in.
This does, however, create an external dependency, and it has happened before that pastie.org was down and a bunch of tasks I had meticulously created couldn't be read by the person who was supposed to be doing them (it didn't last long but it was annoying).
Sprunge.us is actually open source so you can grab and host your own, but that takes a little time and effort and I've never ended up bothering ... THIS, on the other hand, provides a handy way for me to create these little "pastes" and share them with my team, secure in the knowledge that if things bum out I can, at a pinch, get an alternative service live to read the formatted data in.
Of course, this doesn't apply if the URL has been shortened ;)
Speaking of which, you could stick a URL shortener in pretty easily based on the one I did for CueYouTube[1]. I used this library http://www.myjqueryplugins.com/jquery-plugin/jly1 which has an API that works entirely on the client side.
Kudos!
Edit; From the README:
Different browsers have different limits of the total URL length, however around 2000 characters seems to be the recommended safe maximum. At the moment there is currently nothing to enforce the limit, however a checksum is added to check that we get all the data.
http://stackoverflow.com/questions/417142/what-is-the-maximu...
Edit: Actually, now that I think of it, I might do that as a project.
Uncaught ReferenceError: $ is not defined
Chromium Version 25.0.1364.160 Debian 7.0 (186726)uncaught ReferenceError: $ is not defined
Is it firing some code before it can load Jquery?
data:text/html, your notesy stuff
Edit: shawnz already mentioned this.