billboard-top-100.js
function getPeakPositionFromChartItem(chartItem) {
	var peakPosition;
	try {
		if (chartItem.children[3].children.length > 5) {
			peakPosition = chartItem.children[3].children[5].children[5].children[3].children[0].data;
		} else {
			peakPosition = chartItem.children[3].children[3].children[3].children[3].children[0].data;
		}
	} catch (e) {
		peakPosition = chartItem.attribs['data-rank'];
	}
	return parseInt(peakPosition);
}
function getPeakPositionFromChartItem(chartItem) {
	var peakPosition;
	try {
		if (chartItem.children[3].children.length > 5) {
			peakPosition = chartItem.children[3].children[5].children[5].children[3].children[0].data;
		} else {
			peakPosition = chartItem.children[3].children[3].children[3].children[3].children[0].data;
		}
	} catch (e) {
		peakPosition = chartItem.attribs['data-rank'];
	}
	return parseInt(peakPosition);
}
function getPeakPositionFromChartItem ( chartItem ) { var peakPosition ; try { if ( chartItem . children [ 3 ] . children . length > 5 ) { peakPosition = chartItem . children [ 3 ] . children [ 5 ] . children [ 5 ] . children [ 3 ] . children [ 0 ] . data ; } else { peakPosition = chartItem . children [ 3 ] . children [ 3 ] . children [ 3 ] . children [ 3 ] . children [ 0 ] . data ; } } catch ( e ) { peakPosition = chartItem . attribs [ 'data-rank' ] ; } return parseInt ( peakPosition ) ; }
Gets the peak position from the specified chart item

@param {HTMLElement} chartItem - The chart item
@return {number} The peak position

@example

getPeakPositionFromChartItem(<div class="chart-list-item">...</div>) // 4
Gets the peak position from the specified chart item