<commit_before>'use strict';


const Xray = require('x-ray');


const internals = {};


module.exports = internals.Probables = {};


internals.Probables.get = function (day, callback) {

    const url = `http://mlb.mlb.com/news/probable_pitchers/index.jsp?c_id=mlb&date=${day}`;
    const scope = 'div#mc';
    const selector = {
        pitchers: ['div.pitcher@pid'],
        teams: ['div.pitcher@tid'],
        games: ['div.pitcher@gid']
    };

    const x = Xray();
    x(url, scope, selector)((err, result) => {

        if (err) {
            return callback(err);
        }

        const matchups = internals.convertResult(result);
        return callback(null, matchups);
    });
};


internals.convertResult = function (result) {

    const matchups = [];

    const pitchers = result.pitchers;
    const teams = result.teams;
    const games = result.games;

    for (let i = 0; i < pitchers.length; i += 2) {
        const j = i + 1;
        const matchup = {
            id: games[i],
            teams: {
                away: teams[i],
                home: teams[j]
            },
            pitchers: {
                away: pitchers[i],
                home: pitchers[j]
            }
        };

        matchups.push(matchup);
    }

    return matchups;
};<commit_msg>include start time data<commit_after>'use strict';


const Xray = require('x-ray');


const internals = {};


module.exports = internals.Probables = {};


internals.Probables.get = function (day, callback) {

    const url = `http://mlb.mlb.com/news/probable_pitchers/index.jsp?c_id=mlb&date=${day}`;
    const scope = 'div#mc';
    const selector = {
        pitchers: ['div.pitcher@pid'],
        teams: ['div.pitcher@tid'],
        games: ['div.pitcher@gid'],
        startTimes: ['div.pitcher@local_time'],
        easternTimes: ['div.pitcher@eastern_time'],
        timezones: ['div.pitcher@local_time_zone']
    };

    const x = Xray();
    x(url, scope, selector)((err, result) => {

        if (err) {
            return callback(err);
        }

        const matchups = internals.convertResult(result);
        return callback(null, matchups);
    });
};


internals.convertResult = function (result) {

    const matchups = [];

    const pitchers = result.pitchers;
    const teams = result.teams;

    for (let i = 0; i < pitchers.length; i += 2) {
        const j = i + 1;
        const matchup = {
            id: result.games[i],
            startTime: result.startTimes[i],
            easternTime: result.easternTimes[i],
            timezone: result.timezones[i],
            teams: {
                away: teams[i],
                home: teams[j]
            },
            pitchers: {
                away: pitchers[i],
                home: pitchers[j]
            }
        };

        matchups.push(matchup);
    }

    return matchups;
};
{'fraction_non_alphanumeric': 0.1440084092501752, 'fraction_numerical': 0.002102312543798178, 'mean_word_length': 1.9252049180327868, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3029619', 'n_tokens_mistral': 939, 'n_tokens_neox': 877, 'n_words': 186}