Created
September 18, 2023 21:49
-
-
Save iamandrewluca/1e8eb485917832a76282508ee1e26ba5 to your computer and use it in GitHub Desktop.
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
$$('.runtimeLabel') | |
.map(e => e.textContent.trim().replace('Length: ','')) | |
.map(text => { | |
const hasHours = text.includes('and') | |
const [hText, mText] = hasHours | |
? text.split(' and ') | |
: ['0 hrs', text] | |
const h = Number.parseInt(hText) | |
const m = Number.parseInt(mText) | |
return h * 60 + m | |
}) | |
.reduce((a, b) => a + b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment