Created
December 22, 2012 06:38
-
-
Save davidwparker/4357789 to your computer and use it in GitHub Desktop.
Run this in console of youtube history page (after expanding out history) to get count of video time
This file contains 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
var data=document.getElementsByClassName('video-time'); | |
var re = /^([2][0-3]|[0-1]?[0-9])([.:][0-5]?[0-9])?$/; | |
var total=0; | |
for(var i=0;i<data.length;i++){ | |
var j=data.item(i).innerText; | |
var match=re.exec(j); | |
if (match != null) { | |
total += parseInt(match[1]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment