<commit_before>var http = require('http'),
    xml2js = require('xml2js');

exports.search = function(req, res) {

    var directoryOptions = {
      host: "directory.ucsf.edu",
      port: 80,
      path: "/mobile_people_result_set.jsp" + req.originalUrl.substr(req.path.length)
    };

    http.get(directoryOptions, function(resp){
        var xml = "";
        resp.on('data', function(chunk){
            xml += chunk;
        });
        resp.on('end', function() {
            var parser = new xml2js.Parser();
            parser.on('end', function(result) {
                res.send(result.results);
            });
            parser.on('error', function(err) {
                console.dir(err);
            });
            parser.parseString(xml);
        });
    }).on("error", function(e){
        console.log("Directory error: " + e.message);
        res.send({error: e.message});
    });
};

//TODO: Perhaps a small win would be to correctly capitalize the Chancellor's surname.
//TODO: Uh, make it robust so it doesn't go down. supervisor and all that.<commit_msg>rm TODO<commit_after>var http = require('http'),
    xml2js = require('xml2js');

exports.search = function(req, res) {

    var directoryOptions = {
      host: "directory.ucsf.edu",
      port: 80,
      path: "/mobile_people_result_set.jsp" + req.originalUrl.substr(req.path.length)
    };

    http.get(directoryOptions, function(resp){
        var xml = "";
        resp.on('data', function(chunk){
            xml += chunk;
        });
        resp.on('end', function() {
            var parser = new xml2js.Parser();
            parser.on('end', function(result) {
                res.send(result.results);
            });
            parser.on('error', function(err) {
                console.dir(err);
            });
            parser.parseString(xml);
        });
    }).on("error", function(e){
        console.log("Directory error: " + e.message);
        res.send({error: e.message});
    });
};

//TODO: Uh, make it robust so it doesn't go down. supervisor and all that.
{'fraction_non_alphanumeric': 0.15641646489104116, 'fraction_numerical': 0.004842615012106538, 'mean_word_length': 2.074404761904762, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '1407708', 'n_tokens_mistral': 619, 'n_tokens_neox': 596, 'n_words': 131}