index.js
function parseMatchplan(team, callback) {
	/** @type {String[]} */
	var matchPlanArr = [],
	/** @type {Matchplan} */
			matchPlan,
    /** @type {String[]} */
            matchDetails = [],
    /** @type {Encounter[]} */
            encounters = [];


	jsdom.env({
	  url: team,
	  scripts: ["http://code.jquery.com/jquery.js"],
	  done: function (err, window) {
	    var $ = window.$;

	    $("tr.row-headline").each(function() {
	        matchPlanArr.push(parseMatchTime($(this).text()));
	    });

	    $(".club-name").each(function(index) {
            if ((index + 1) % 2 === 0) {
                encounters[encounters.length - 1].setVisitingTeam($(this).text());
            } else {
                encounters.push(new Encounter($(this).text()));
            }
	    });

        $("td.column-detail a").each(function(index, element) {
            matchDetails.push(new URL(element.href));
        });

	    matchPlan = createMatchplan(matchPlanArr, encounters, matchDetails);
		matchPlan.output();
		callback(matchPlan);
	  }
	});
}
function parseMatchplan(team, callback) {
	/** @type {String[]} */
	var matchPlanArr = [],
	/** @type {Matchplan} */
			matchPlan,
    /** @type {String[]} */
            matchDetails = [],
    /** @type {Encounter[]} */
            encounters = [];


	jsdom.env({
	  url: team,
	  scripts: ["http://code.jquery.com/jquery.js"],
	  done: function (err, window) {
	    var $ = window.$;

	    $("tr.row-headline").each(function() {
	        matchPlanArr.push(parseMatchTime($(this).text()));
	    });

	    $(".club-name").each(function(index) {
            if ((index + 1) % 2 === 0) {
                encounters[encounters.length - 1].setVisitingTeam($(this).text());
            } else {
                encounters.push(new Encounter($(this).text()));
            }
	    });

        $("td.column-detail a").each(function(index, element) {
            matchDetails.push(new URL(element.href));
        });

	    matchPlan = createMatchplan(matchPlanArr, encounters, matchDetails);
		matchPlan.output();
		callback(matchPlan);
	  }
	});
}
function parseMatchplan ( team , callback ) { /** @type {String[]} */ var matchPlanArr = [ ] , /** @type {Matchplan} */ matchPlan , /** @type {String[]} */ matchDetails = [ ] , /** @type {Encounter[]} */ encounters = [ ] ; jsdom . env ( { url : team , scripts : [ "http://code.jquery.com/jquery.js" ] , done : function ( err , window ) { var $ = window . $ ; $ ( "tr.row-headline" ) . each ( function ( ) { matchPlanArr . push ( parseMatchTime ( $ ( this ) . text ( ) ) ) ; } ) ; $ ( ".club-name" ) . each ( function ( index ) { if ( ( index + 1 ) % 2 === 0 ) { encounters [ encounters . length - 1 ] . setVisitingTeam ( $ ( this ) . text ( ) ) ; } else { encounters . push ( new Encounter ( $ ( this ) . text ( ) ) ) ; } } ) ; $ ( "td.column-detail a" ) . each ( function ( index , element ) { matchDetails . push ( new URL ( element . href ) ) ; } ) ; matchPlan = createMatchplan ( matchPlanArr , encounters , matchDetails ) ; matchPlan . output ( ) ; callback ( matchPlan ) ; } } ) ; }
Parse the match plan.

@param {String} team - The next matches team URL.
@param {function} callback - The function to call back with the match plan.
Parse the match plan .