Firefox Scratchpad that parse metrics from manning's dashboard:
function getElementsCount(attributeName) {
return document.querySelectorAll(`#productTable > tbody > tr[${attributeName}=true]`).length;
}
var labelsMap = new Map([
['is-book', 'books'],
['is-meap', 'meaps'],
['is-video', 'videos']
]);
var result = [...labelsMap.keys()].reduce((counters, attribute) => {
counters[labelsMap.get(attribute)] = getElementsCount(attribute);
return counters;
}, {
books: 0,
videos: 0,
meaps: 0
});
console.log(result);