jsonptunnel

for when you want to POST across domains

jsonptunnel is a CGI or FastCGI program written in C that lets you POST to remote web services from your client-side Javascript application and receive JSONP data.

You might use it to send data to a Sinatra-based web service across domains.

example

Calculator web service URL:
jsonptunnel.cgi URL:

First number:
Second number:

explanation

calc.php is a script on an off-site domain that takes three POST variables: num1, num2, and the name of a callback function to wrap the result in. It then returns the sum of num1 and num2 wrapped with the specified callback.

In order to POST to an off site web service, a GET URL is formatted and fetched that looks like this: ?extURL=http://dipert.org/alan/calc.php&num1=10....

This tells the CGI to fetch the specified URL using the specified HTTP verb and pass the specified variables.

The example uses mootools with a jsonp extension.

applications

There are a lot of web services out there with RESTful, JSON-producing, HTTP-based APIs. You might use jsonptunnel to make a frontend to the tumblr api that let you post new items.

There are a few restrictions though:

more info

For more information check out jsonptunnel at github or e-mail me directly at alan@thinkminimo.com