Skip to content

Instantly share code, notes, and snippets.

@eviltester
Last active December 6, 2018 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eviltester/dd242b5fed697cf3fe91a86a25fd5ab9 to your computer and use it in GitHub Desktop.
Save eviltester/dd242b5fed697cf3fe91a86a25fd5ab9 to your computer and use it in GitHub Desktop.
How long is a course on zenler?
var times = document.getElementsByClassName("curr-time");
var totaltime= 0;
for (var i = 0, len = times.length; i < len; i++) {
time = document.getElementsByClassName("curr-time")[i].innerText.trim();
if(time.length>0){
var b = time.split(':');
console.log(b);
seconds = (Number(b[0])*60) + (Number(b[1]));
totaltime+=seconds;
}
}
console.log(" - " + totaltime + " seconds : " + totaltime / (60*60) + " hours" )
@eviltester
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment