server/sports/sports-parsing.js
// Iterates through every result row and attempts to grab the correct data.
Iterates through every result row and attempts to grab the correct data.
Iterates through every result row and attempts to grab the correct data .
function createArrayOfResultDictionaries(rows, schoolYears) {
    var resultDictArray = [];
    for (var i = 0; i < rows.length; i++) {
        var itemsInRow = rows[i].querySelectorAll('td'); 
        if (itemsInRow.length == 6) {
            var resultDict = parseNormalResultRow(itemsInRow, schoolYears);
            if (resultDict) {
                resultDictArray.push(resultDict);
            }
        } else if (itemsInRow.length == 5) {
            var resultDict = parseShortResultRow(itemsInRow, schoolYears);
            if (resultDict) {
                resultDictArray.push(resultDict);
            }
            i++; 
        }
    }
    return resultDictArray;
}
function createArrayOfResultDictionaries ( rows , schoolYears ) { var resultDictArray = [ ] ; for ( var i = 0 ; i < rows . length ; i ++ ) { var itemsInRow = rows [ i ] . querySelectorAll ( 'td' ) ; if ( itemsInRow . length == 6 ) { var resultDict = parseNormalResultRow ( itemsInRow , schoolYears ) ; if ( resultDict ) { resultDictArray . push ( resultDict ) ; } } else if ( itemsInRow . length == 5 ) { var resultDict = parseShortResultRow ( itemsInRow , schoolYears ) ; if ( resultDict ) { resultDictArray . push ( resultDict ) ; } i ++ ; } } return resultDictArray ; }
Iterates through every result row and attempts to grab the correct data.
Iterates through every result row and attempts to grab the correct data .
//grabs the columns from the row //force skip the next row bc it is related to this row but too hard to parse.