Created
July 1, 2020 16:18
-
-
Save rantoniuk/0a8deb9f6524b61c57c40e2ecf0e430b to your computer and use it in GitHub Desktop.
Revisions
-
warden created this gist
Jul 1, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ require('cross-fetch/polyfill'); const fs = require('fs'); const { Api } = require('endomondo-api-handler'); const { DateTime } = require('luxon'); const api = new Api(); (async () => { await api.login(LOGIN, PASSWORD); await api.processWorkouts({ after: DateTime.fromISO('2020-01-01T00:00:00.000'), before: DateTime.fromISO('2020-07-01T23:59:59.999'), } , async (workout) => { console.log(workout.toString()); if (workout.hasGPSData()) { fs.writeFileSync(`tmp/${workout.getId()}.gpx`, await api.getWorkoutGpx(workout.getId()), 'utf8'); } }); })(); This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ { "name": "endomondo-strava", "version": "1.0.0", "description": "", "main": "index.js", "scripts": {}, "author": "", "license": "MIT", "dependencies": { "cross-fetch": "^3.0.5", "endomondo-api-handler": "^6.19.0", "luxon": "^1.24.1" } }