<commit_before>var request = require('request');
var _und = require('underscore');

/* Get orders listing. */
exports.list = function(req, res){
    var results = {
        orders: [],
        bitStampOrders: [],
        btceOrders: []
    };

    request('https://www.bitstamp.net/api/transactions/', function(error, response, body){
        if(!error && response.statusCode == 200) {
            results.bitStampOrders = body;
        }

        request('https://btc-e.com/api/2/btc_usd/trades', function(error, response, body) {
            if(!error && response.statusCode == 200) {
                results.btceOrders = body;
            }

            console.log(results);
            res.send(results);
        });
    });
};<commit_msg>broke the page on final combination, but I am out of time.<commit_after>var request = require('request');
var _und = require('underscore');

/* Get orders listing. */
exports.list = function(req, res){
    var results = {
        orders: [],
        bitStampOrders: [],
        btceOrders: []
    };

    request('https://www.bitstamp.net/api/transactions/', function(error, response, body){
        if(!error && response.statusCode == 200) {
            results.bitStampOrders = JSON.parse(body);
        }

        request('https://btc-e.com/api/2/btc_usd/trades', function(error, response, body) {
            if(!error && response.statusCode == 200) {
                results.btceOrders = JSON.parse(body);
            }
            
            var combinedOrders = _und.map(results.bitStampOrders, function(order){
                return { 
                    time: order.date, 
                    quantity: order.amount, 
                    price: order.price,
                    exchange: 'bitstamp.net'
                };
            }) + _und.map(results.btceOrders, function(order){
                return {
                    time: order.date,
                    quantity: order.amount,
                    price: order.price,
                    exchange: 'btc-e.com'
                };
            });
            console.log(combinedOrders[0].time);
            var sortedCombinedOrders = _und.sortBy(combinedOrders, function(order){ return -1 * order.date; });
            results.orders = _und.first(sortedCombinedOrders, 10);
            //console.log(results);
            res.send(results);
        });
    });
};
{'fraction_non_alphanumeric': 0.1376416281997482, 'fraction_numerical': 0.007553503986571549, 'mean_word_length': 1.7370838117106773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1149730', 'n_tokens_mistral': 701, 'n_tokens_neox': 662, 'n_words': 120}