Skip to content

Instantly share code, notes, and snippets.

@FTAndy
Created September 29, 2023 02:37
Show Gist options
  • Save FTAndy/ec3e547566bf73e52eada9276b2c7ba9 to your computer and use it in GitHub Desktop.
Save FTAndy/ec3e547566bf73e52eada9276b2c7ba9 to your computer and use it in GitHub Desktop.
Steam total game hours caculation
const elements = Array.from(document.querySelectorAll('.gameslistitems_Hours_26nl3'))
const hours = s.map(d => d.innerText).filter(c => c.include('hours')).map(o => parseInt(/(?!\n)(.+) hours/.exec(o)[1].replace(',', '')) ).reduce((a, b) => a + b ,0)
console.log(hours)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment