Skip to content

Instantly share code, notes, and snippets.

@nerg4l
Created October 26, 2021 11:37
Show Gist options
  • Save nerg4l/bb42308281ed85090d48330d5984e382 to your computer and use it in GitHub Desktop.
Save nerg4l/bb42308281ed85090d48330d5984e382 to your computer and use it in GitHub Desktop.
LinkedIn Learning progress
([...document.querySelectorAll('.lls-card-detail-card__main')].filter(c => c.innerHTML.match(/COURSE/) && c.innerHTML.match(/Completed.*?\/2021/))
.map(c => c.querySelector('.lls-card-thumbnail-label'))
.map(l => l.innerHTML.trim()).map((str) => {
var m = 0;
var hours = str.match(/(\d+)\s*h/);
var minutes = str.match(/(\d+)\s*m/);
if (hours) { m += parseInt(hours[1])*60; }
if (minutes) { m += parseInt(minutes[1]); }
return m;
}).reduce((a, b) => a + b) / 60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment