<commit_before>var Crawler = require("crawler");
var url = require('url');

// Babel ES6/JSX Compiler
require('babel-register');

var path = require('path');
var express = require('express');
var bodyParser = require('body-parser');
var compression = require('compression');
var favicon = require('serve-favicon');
var logger = require('morgan');
var async = require('async');
var colors = require('colors');
var mongoose = require('mongoose');
var request = require('request');
var React = require('react');
var ReactDOM = require('react-dom/server');
var Router = require('react-router');
var swig  = require('swig');
var xml2js = require('xml2js');
var _ = require('underscore');
var util = require('util');
var cheerio = require('cheerio');

var config = require('./config');
var routes = require('./app/routes');
var Athlete = require('./models/athlete');

var app = express();

mongoose.connect(config.database);
mongoose.connection.on('error', function() {
  console.info('Error: Could not connect to MongoDB. Did you forget to run `mongod`?'.red);
});

app.set('port', process.env.PORT || 3000);
app.use(compression());
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(favicon(path.join(__dirname, 'public', 'favicon.png')));
app.use(express.static(path.join(__dirname, 'public')));

app.post('/api/characters', function(req, res, next) {
  var gender = req.body.gender;
  var number = req.body.name;
  var athleteIdLookupUrl = 'http://www.iwrp.net/?view=contestant&id_zawodnik=' + number;
  //var athleteIdLookupUrl = 'http://olystats.com/individual_profile.php?AID=' + number;


  request.get(athleteIdLookupUrl, function(err, request, html) {
    if (err) return next(err);
    
    var $ = cheerio.load(html);
    var name = $('.nazwa_pogrubiona').text();
    var gender = 

    console.log(name);

    /*
    var nationality =
    var federation = 
    var club = 
    var birthdate = 
    var age = */
<commit_msg>trivial change, waiting for JSON import rather than manually scraping sites<commit_after>var Crawler = require("crawler");
var url = require('url');

// Babel ES6/JSX Compiler
require('babel-register');

var path = require('path');
var express = require('express');
var bodyParser = require('body-parser');
var compression = require('compression');
var favicon = require('serve-favicon');
var logger = require('morgan');
var async = require('async');
var colors = require('colors');
var mongoose = require('mongoose');
var request = require('request');
var React = require('react');
var ReactDOM = require('react-dom/server');
var Router = require('react-router');
var swig  = require('swig');
var xml2js = require('xml2js');
var _ = require('underscore');
var util = require('util');
var cheerio = require('cheerio');

var config = require('./config');
var routes = require('./app/routes');
var Athlete = require('./models/athlete');

var app = express();

mongoose.connect(config.database);
mongoose.connection.on('error', function() {
  console.info('Error: Could not connect to MongoDB. Did you forget to run `mongod`?'.red);
});

app.set('port', process.env.PORT || 3000);
app.use(compression());
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(favicon(path.join(__dirname, 'public', 'favicon.png')));
app.use(express.static(path.join(__dirname, 'public')));

app.post('/api/characters', function(req, res, next) {
  var gender = req.body.gender;
  var number = req.body.name;
  var athleteIdLookupUrl = 'http://www.iwrp.net/?view=contestant&id_zawodnik=' + number;
  //var athleteIdLookupUrl = 'http://olystats.com/individual_profile.php?AID=' + number;


  request.get(athleteIdLookupUrl, function(err, request, html) {
    if (err) return next(err);
    
    var $ = cheerio.load(html);
    var name = $('.nazwa_pogrubiona').text();
    //var gender = 

    console.log(name);

    /*
    var nationality =
    var federation = 
    var club = 
    var birthdate = 
    var age = */

{'fraction_non_alphanumeric': 0.17910079051383399, 'fraction_numerical': 0.003458498023715415, 'mean_word_length': 4.859623733719247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '1712686', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1280, 'n_words': 306}