Created
August 5, 2017 11:40
-
-
Save Aldaviva/319ca62d1013eab5f4a4f0fb84b3b98a to your computer and use it in GitHub Desktop.
YouTube playlist length calculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.map.call(document.querySelectorAll(".timestamp span"), function(span){ var minSecStrings = span.firstChild.nodeValue.split(":"); return parseInt(minSecStrings[0], 10)*60+parseInt(minSecStrings[1], 10); }).reduce(function(prev, curr){ return prev + curr; }, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment