Skip to content

Instantly share code, notes, and snippets.

@gregglind
Created June 19, 2017 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregglind/92b612ec9cd603f29a3397f9c1ff45c9 to your computer and use it in GitHub Desktop.
Save gregglind/92b612ec9cd603f29a3397f9c1ff45c9 to your computer and use it in GitHub Desktop.
Getting Lap Data out of Strava
window.NodeList.prototype.map = Array.prototype.map;
function floatTime (s) { f=s.split(':').map(Number); return f[0] + f[1]/60}
console.log(document.querySelectorAll('.mile-splits tbody tr').map(node=>node.querySelector('td:nth-child(2)').firstChild.data).map(floatTime).join("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment