JSON Proxy
Brett works on Google App Engine. As such, he persistently badgers me to build App Engine apps. This dates back to long before App Engine existed externally.
I've made a few, the simplest of which actually got popular.
Anyway, I recently put up another one: JSON Proxy
Cross-domain JSONP (or "JSON with callbacks") has long been an interest of mine. It's interesting that many sites are offering JSON as an output type for their web APIs. Flickr, Twitter, and GData APIs all do.
Having such APIs is great -- it allows client-side code to pull data as JavaScript object literals across domains, skirting the same origin policy of XMLHttpRequest (just make sure you never serve private user data with this method). For example, on this page, I'm using a URL formed with the Twitter API to fill the Tweets section in the sidebar (a callback called
Unfortunately, there no recourse if some web service lacks JSON as an output type. Some sort of proxy is required. The Google AJAX Feed API allows fetching of RSS and Atom feeds, which is very useful (the XML-to-JSON transformation is better defined in this case).
So, I wrote a proxy for an even more general case: any XML, and accepts a callback parameter, which allows you to fetch any GET-accessible XML resource as a JSON object. The App Engine app fetches the XML content, transforms it to JSON, and sends it out, wrapped in a callback if requested.

This allows some cool stuff. I came up with the example of all-client-side Amazon search through their Amazon Web Services API.
Anyway, I've written a better and more technical writeup, and have posted the source.
I would love it if somebody would come up with a really innovative application of the proxy.
Enjoy!
I've made a few, the simplest of which actually got popular.
Anyway, I recently put up another one: JSON Proxy
Cross-domain JSONP (or "JSON with callbacks") has long been an interest of mine. It's interesting that many sites are offering JSON as an output type for their web APIs. Flickr, Twitter, and GData APIs all do.
Having such APIs is great -- it allows client-side code to pull data as JavaScript object literals across domains, skirting the same origin policy of XMLHttpRequest (just make sure you never serve private user data with this method). For example, on this page, I'm using a URL formed with the Twitter API to fill the Tweets section in the sidebar (a callback called
twitterCallback is called with a JSON object of my tweets).Unfortunately, there no recourse if some web service lacks JSON as an output type. Some sort of proxy is required. The Google AJAX Feed API allows fetching of RSS and Atom feeds, which is very useful (the XML-to-JSON transformation is better defined in this case).
So, I wrote a proxy for an even more general case: any XML, and accepts a callback parameter, which allows you to fetch any GET-accessible XML resource as a JSON object. The App Engine app fetches the XML content, transforms it to JSON, and sends it out, wrapped in a callback if requested.

This allows some cool stuff. I came up with the example of all-client-side Amazon search through their Amazon Web Services API.
Anyway, I've written a better and more technical writeup, and have posted the source.
I would love it if somebody would come up with a really innovative application of the proxy.
Enjoy!