I'm using Node.js for my project and I'm wondering is there any difference between what Yahoo finance sends to the server machine and "regular" machine.
var http = require('http');
var link = "http://download.finance.yahoo.com/d/quotes?s=" + fromCurrency + toCurrency + "%3DX&f=l1n";
http.request(link,
function (response)
{
var str = '';
response.on('data', function (chunk) {
str += chunk;});
response.on('end', function () {
var rate = parseRate(str);
console.log(rate);
callback(sender, convert(howMuch, rate, fromCurrency, toCurrency));
});
}).end();
This is my code. When I run this on my laptop, it returns right rates. But the interesting thing is that when I run this on the server, it sends wrong data for some currencies. For example if you try CAD to USD, it will say that 1 cad equals 95.88 USD. Aggrr!
I'm wondering - maybe I've missed something? Can you help?