Skip to content

Instantly share code, notes, and snippets.

@jxm262
Created January 26, 2015 15:15
Show Gist options
  • Save jxm262/c32cf5ede3c1d5e4bfd6 to your computer and use it in GitHub Desktop.
Save jxm262/c32cf5ede3c1d5e4bfd6 to your computer and use it in GitHub Desktop.
using request library directly, works fine
var request = require("request");
var apis = {bitfinex: "https://api.bitfinex.com/v1/pubticker/btcusd",
bitstamp: "https://www.bitstamp.net/api/ticker/"};
async.map([ "bitfinex", "bitstamp"],
function(item, callback) {
request(apis[item], function(err,resp, body) {
return callback(err, body);
});
}, function(err, results) {
console.log(results);
});
['{"mid":"281.65",
"bid":"281.64",
"ask":"281.66",
"last_price":"281.66",
"low":"246.59",
"high":"315.0",
"volume":"167070.1841004",
"timestamp":"1422285023.994555452"}',
'{"high": "309.90",
"last": "278.84",
"timestamp": "1422285014",
"bid": "278.84",
"vwap": "280.37",
"volume": "49768.45795621",
"low": "246.00",
"ask": "279.55"}']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment