Google API here does not return valid JSONP (missing " in response keys) and it does not like CORS. Leaves you with either 'code your own proxy' or use somebody else's:
{lhs: "100 British pounds",rhs: "115.538154 Euros",error: "",icc: true}
The correct response would be:
{"lhs": "100 British pounds", "rhs": "115.538154 Euros", "error": "","icc": true}
This alternative works fine:
Request.exchange = new Class({
Extends: Request.JSONP,
options: {
url: 'http://rate-exchange.appspot.com/currency?from={from}&to={to}&q={amount}',
amount: 1
},
initialize: function(options){
this.setOptions(options);
this.options.url = this.options.url.substitute(this.options);
this.parent();
}
});
new Request.exchange({
from: 'GBP',
to: 'JPY',
amount: '100',
onSuccess: function(response) {
console.log(response, response.rate, response.v);
}
}).send();
subclassing MooTools-more's Request.JSONP to add from/to/amount and use http://rate-exchange.appspot.com api to google, which fixes their json (same data).
The above in action on jsfiddle (look at console): http://jsfiddle.net/bBHsW/
You can also use http://finance.yahoo.com/ and get csv etc.