Skip to content

Instantly share code, notes, and snippets.

@ento
Created January 21, 2014 15:16
Show Gist options
  • Save ento/8541939 to your computer and use it in GitHub Desktop.
Save ento/8541939 to your computer and use it in GitHub Desktop.
var totalTime = $(".lesson-header")
.filter(function(i, each) {
return $(each).find(".pro-badge").length == 0;
})
.toArray()
.map(function(each) {
return $(each).find('.text-muted').text().match(/(\d+):(\d+)/);
})
.reduce(function(prev, curr) {
prev.minutes += parseInt(curr[1]);
prev.seconds += parseInt(curr[2]);
return prev;
},
{minutes: 0, seconds: 0}
);
var playbackSpeed = 1.5;
(t.seconds / 60 + t.minutes) / 60 / playbackSpeed;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment