Skip to content

Instantly share code, notes, and snippets.

@webdevwilson
Last active September 1, 2020 15:41
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 webdevwilson/9611760a563fb125cabadc247c1761d1 to your computer and use it in GitHub Desktop.
Save webdevwilson/9611760a563fb125cabadc247c1761d1 to your computer and use it in GitHub Desktop.
function getZones(id) {
var url = 'https://app.homefitnessbuddy.com/peloton/powerzone/details/' + id;
var html = UrlFetchApp.fetch(url).getContentText();
var doc = XmlService.parse(html);
var html = doc.getRootElement();
var script = getElementsByClassName(html, 'body script:nth-child(1)')[0].innerText;
var s = eval(script);
return s.intervals;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment