Skip to content

Instantly share code, notes, and snippets.

@adil1214
Created September 30, 2018 23:09
Show Gist options
  • Select an option

  • Save adil1214/b3b6d0cccf42f1c5b50968e16536c932 to your computer and use it in GitHub Desktop.

Select an option

Save adil1214/b3b6d0cccf42f1c5b50968e16536c932 to your computer and use it in GitHub Desktop.
/*
// egghead playlist
// https://egghead.io/courses/advanced-react-component-patterns
*/
let a = 0;
[...document.getElementsByClassName('w-100 pa1 tl mv0 flex flex-row items-center no-underline dark-gray h2')]
.map((e) => e.innerText )
.forEach((d) =>
a+= (parseInt(d[0])*60 + parseInt(d[2])*10 + parseInt(d[3]) // all vids have less than 10min duration (m:ss) so...
));
console.log(`${parseInt(a/3600)}:${parseInt(a/60)}:${a%60}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment