JSONP turns a bit of JSON into a bit of JavaScript. ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
I want a node.js module that does that. A web app that takes two params, the URL of a JSON file and the name of a callback. Example: ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
http://hello.com/world?url=http://oy.org/random.json&callback=myLocalSubroutine ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
What it would return is this: ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
myLocalSubroutine (["Oregon", "Pizza", "Wheat"]) ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
Assuming random.json contains a list: ["Oregon", "Pizza", "Wheat"]. ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
Then Step 2 would simplify it to: ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
http://oy.org/random.json?callback=myLocalSubroutine ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
This, as I understand it, is what works best for JavaScript programmers working in the browser. ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
I wanted to provide this functionality in Frontier, but my guys are polling this thing ever 5 seconds (which is BS, they shouldn't do that, but WTF) and that would cost me $90 per month and it wouldn't run very well as soon as their stuff got a few hundred users, which is what we hope happens. A lose-lose-lose. ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
What we need is a bare-bones machine language thing that does this. Node.js would be ideal. ![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)
Caveat: Of course, I'm sure something like this already exists!
![permalink](http://scripting.com/images/2001/09/20/sharpPermaLink3.gif)