News for hackers. Stuff that matters.
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by lars on Sunday August 21, 2011 @02:25PM (#2909800)
I looked at the code, and what this does is to make calls to a web api on the errorjs.com domain.

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).

Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pitra on Sunday August 21, 2011 @02:30PM (#2909824)
Thanks. I should be more clear about that.

The api is defined under WHY? tab, btw.

Re:Show HN: Rasta.js, anonymous domainless key-value store f... by bouncingsoul on Sunday August 21, 2011 @03:33PM (#2910019)
You might want to look at http://openkeyval.org if you weren't aware of it. Exact same idea.

(HN discussion: http://news.ycombinator.com/item?id=1846088)

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 guptaneil on Sunday August 21, 2011 @03:32PM (#2910009)
I guess I could see some usefulness in a quick weekend prototyping to get a persistent app up and running.
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 pitra on Sunday August 21, 2011 @03:17PM (#2909961)
It's not meant to be reliable.

Nor is it meant to be secure. It's a direct connection to a data store.

Re:Show HN: Rasta.js, anonymous domainless key-value store f... by NHQ on Sunday August 21, 2011 @04:03PM (#2910130)
And also replace a value with normal, arbitrary javascript...

Still, neat idea.

Re:Show HN: Rasta.js, anonymous domainless key-value store f... by hamrickdavid on Sunday August 21, 2011 @03:59PM (#2910121)
Good use of Twitter's new Bootstrap framework http://twitter.github.com/bootstrap/
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by amasad on Sunday August 21, 2011 @08:09PM (#2910707)
There is a typo on the "FOR DUMMIES" section, "This is a key-value date store"
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pbreit on Sunday August 21, 2011 @04:30PM (#2910206)
Would it make sense for "set" to be a POST? Or does that compromise "easy"?
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by HoLyVieR on Sunday August 21, 2011 @04:52PM (#2910260)
It would make sense in theory, but in practice you can't make POST request to a JSONP API. So that's why you have to stick to GET request.
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 tchvil on Monday August 22, 2011 @03:50AM (#2911744)
This works well on iPhone and Android mobiles. And has the same level of particular settings as JSONP.
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by catshirt on Sunday August 21, 2011 @03:37PM (#2910028)
awesome! like someone else said, this is a great tool for prototyping, and likely other projects. tinydb is pretty cool as well. http://tinydb.org/
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by lyime on Sunday August 21, 2011 @02:07PM (#2909752)
Is this OSS? If so, where is the un-minified version and repository?
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pitra on Sunday August 21, 2011 @02:09PM (#2909762)
Unminified JS: http://rastajs.errorjs.com/rasta.js

I am putting it on GitHub right now.

Re:Show HN: Rasta.js, anonymous domainless key-value store f... by marcamillion on Sunday August 21, 2011 @06:48PM (#2910561)
I guess I am not geek enough, but the description for this is SOOO opaque. I have no idea what this does - and I am a web developer!

Can someone explain, in simple English, what this is about and why it's good?

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 maroufle on Sunday August 21, 2011 @01:47PM (#2909705)
how does it work ?
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pitra on Sunday August 21, 2011 @01:50PM (#2909709)
you just include a <script> tag, and then use the API.
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by josscrowcroft on Sunday August 21, 2011 @02:10PM (#2909763)
I think he meant - physically, HOW does this work. As in, where is the data stored and how?
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pitra on Sunday August 21, 2011 @02:27PM (#2909810)
oh, my bad. Well, the API doesn't specify anything beyond that.

My implementation is on GitHub at https://github.com/errorjs/Rasta.js

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 Raphael on Sunday August 21, 2011 @04:40PM (#2910232)
Ah, redis. Good man.
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pkulak on Sunday August 21, 2011 @02:39PM (#2909855)
Do keys need to be globally unique?
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pitra on Sunday August 21, 2011 @02:43PM (#2909864)
Everything is in the same namespace.
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 david927 on Sunday August 21, 2011 @01:37PM (#2909681)
Fantastic! I needed that.
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pitra on Sunday August 21, 2011 @01:40PM (#2909686)
me too, that's why I made it
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by netlemurde on Sunday August 21, 2011 @01:55PM (#2909726)
what are you using it for? still don't really get it...
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pitra on Sunday August 21, 2011 @02:02PM (#2909745)
nothing yet, I just wrote it. But basically, the idea is, you no longer need a backend to store some simple data.
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by pitra on Sunday August 21, 2011 @02:29PM (#2909817)
I provide the backend. Well, actually Heroku does
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by strags on Sunday August 21, 2011 @02:28PM (#2909815)
Oh... I get it. It uses your server.
Re:Show HN: Rasta.js, anonymous domainless key-value store f... by strags on Sunday August 21, 2011 @02:27PM (#2909806)
Wait - doesn't this just do JSONP GET requests for getting/setting values? How is this not needing a backend?
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.

https://github.com/rockstar/selassie

It's not backed by anything but memory, but that's why I said "simple".

Re:Show HN: Rasta.js, anonymous domainless key-value store f... by nikcub on Monday August 22, 2011 @04:18AM (#2911790)
He has his own backend, written in js and also backed by redis within the package:

https://github.com/errorjs/Rasta.js/blob/master/web.js