Created
November 29, 2017 08:10
-
-
Save willjobs/e6f267e1af5abadcdec1b9292e95bddc to your computer and use it in GitHub Desktop.
JS code to summarize the amount of video content on the Magoosh GRE site (https://gre.magoosh.com/lessons)
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
overall_sum = 0; | |
$('.thin.list-unstyled.lesson-list-condensed').each(function(idx, el) { | |
sum = 0; | |
$(el).find('.lesson-item').each( | |
function(idx2, inner_el) { | |
time = $(inner_el).find('.lesson-item-subtitle').text(); | |
time = time.split(':'); | |
if(time.length > 1) { | |
sum += parseInt(time[0]) + parseInt(time[1])/60; | |
} | |
} | |
); | |
console.log('index: ' + (idx+1) + ', sum=' + sum.toFixed(2) + ' minutes'); | |
overall_sum += sum; | |
} | |
); | |
console.log('overall sum: ' + overall_sum.toFixed(2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment