Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var all = document.getElementsByClassName("badge-shape-wiz__text");var total={};var totalS=0;
- for(var i = 0; i < all.length; i++) {var el = all[i].innerHTML.split(':');var name=all[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.children[2].children[1].children[0].innerText;total[name]=el[0]*60 + el[1]*1;}
- for(var x in total){if(total.hasOwnProperty(x)) {totalS += total[x];}}
- var totalM = Math.floor(totalS/60);totalS -= totalM * 60;var totalH = Math.floor(totalM/60);totalM -= totalH * 60;
- var dd = function(x) {return x <= 9 ? "0"+x : ""+x;}
- console.log(dd(totalH)+":"+dd(totalM)+":"+dd(totalS));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement