It also adds a timestamp, and allows for a callback. Perhaps it should be clarified that this relies on making a web call to their server (even if that is the only way this could possibly be done).
Re:Show HN: Rasta.js, anonymous domainless key-value store f...
by HoLyVieR on Sunday August 21, 2011 @02:54PM
(#2909889)
Unless there is something I don't understand, how can this even be slightly reliable or useful, when everyone can read any key and write or replace any key at any moment ?
Re:Show HN: Rasta.js, anonymous domainless key-value store f...
by Groxx on Sunday August 21, 2011 @04:35PM
(#2910215)
but then why would this be better than, say, localStorage, which is local? The only purpose to this is semi-persistent cross-domain information storage. It's crazy to use an external JSON-P service to store tweetable-sized messages, when you've got megabytes locally with precisely the same key/value setup. Or, if you're handling older browsers, cookies will get you several KB.
Re:Show HN: Rasta.js, anonymous domainless key-value store f...
by guptaneil on Sunday August 21, 2011 @05:49PM
(#2910402)
If you want to demonstrate some cross-browser communication app? I agree, this has a very limited application scope. I am more confused as to why the author made it when he doesn't seem to have a use case for it himself.
Re:Show HN: Rasta.js, anonymous domainless key-value store f...
by tchvil on Sunday August 21, 2011 @05:54PM
(#2910415)
You can make a cross domain POST with an IFRAME but would not get the response directly. Having to use parent.postMessage, the window.name hack or polling with JSONP depending on the browser. Possible then, but not so easy.
Re:Show HN: Rasta.js, anonymous domainless key-value store f...
by HoLyVieR on Sunday August 21, 2011 @06:13PM
(#2910464)
Those hacks don't work on all platform (iframe for mobile is a good example) and often require you to have very particular setting on both sites. The only way for JSONP to work well on everything is to use script tag injection which only allows you to do GET request.
Re:Show HN: Rasta.js, anonymous domainless key-value store f...
by Udo on Sunday August 21, 2011 @07:02PM
(#2910596)
It's a javascript library that essentially consists of two functions (get and set) to retrieve and store some arbitrary content identified by a key string. That content is stored on the author's server though you can override the domain name and put in your own.
I think this combination of a lightweight library and free online storage could be useful for people who would like to have a static website with no functionality or storage whatsoever on their server. It could also be used in scenarios where JS code is used as glue between one or more websites and the user (for example in browser plugins).
Re:Show HN: Rasta.js, anonymous domainless key-value store f...
by jchrisa on Sunday August 21, 2011 @11:57PM
(#2911237)
you might be able to replace the server with just CouchDB configured to allow JSONP... Then users can just sign up at something like http://iriscouch.com to install a copy of your library on an independent server.
Re:Show HN: Rasta.js, anonymous domainless key-value store f...
by moonlighter on Sunday August 21, 2011 @03:40PM
(#2910039)
It would be a heck of a lot more useful if it were namespaced, like S3's buckets. Let folks put into those buckets whatever they want, but make the buckets in your datastore unique, based on the domain, referer, etc.
Re:Show HN: Rasta.js, anonymous domainless key-value store f...
by iamtherockstar on Sunday August 21, 2011 @10:57PM
(#2911108)
I think there's a pretty limited use for this, but it's definitely an interesting experiment if nothing else. I found it so cute that I decided I'd implement a really simple server endpoint for this.
It sets a key using:
http://rastajs.errorjs.com/set/yourkey/yourvalue
And retrieves it using:
http://rastajs.errorjs.com/get/yourkey
It also adds a timestamp, and allows for a callback. Perhaps it should be clarified that this relies on making a web call to their server (even if that is the only way this could possibly be done).
The api is defined under WHY? tab, btw.
(HN discussion: http://news.ycombinator.com/item?id=1846088)
Nor is it meant to be secure. It's a direct connection to a data store.
Still, neat idea.
I am putting it on GitHub right now.
Can someone explain, in simple English, what this is about and why it's good?
I think this combination of a lightweight library and free online storage could be useful for people who would like to have a static website with no functionality or storage whatsoever on their server. It could also be used in scenarios where JS code is used as glue between one or more websites and the user (for example in browser plugins).
My implementation is on GitHub at https://github.com/errorjs/Rasta.js
https://github.com/rockstar/selassie
It's not backed by anything but memory, but that's why I said "simple".
https://github.com/errorjs/Rasta.js/blob/master/web.js