Created
October 31, 2020 13:10
-
-
Save burczyk/8800e4c193bd377cad568eb7563b22e2 to your computer and use it in GitHub Desktop.
endomondo-exporter
This file contains 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 characters
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("YOUR_ENDOMONDO_EMAIL", "YOUR_ENDOMONDO_PASSWORD"); | |
await api.processWorkouts({ | |
before: DateTime.fromObject({ | |
year: 2020, | |
month: 10, | |
day: 31, | |
})}, async (workout) => { | |
console.log(workout.toString()); | |
if (workout.hasGPSData()) { | |
fs.writeFileSync(`gpx/${workout.getId()}.gpx`, await api.getWorkoutGpx(workout.getId()), 'utf8'); | |
} | |
}); | |
})(); |
This file contains 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 characters
{ | |
"name": "endomondo-exporter", | |
"version": "1.0.0", | |
"description": "Exporter of Endomondo saved trainings", | |
"main": "exporter.js", | |
"scripts": { | |
"run": "node exporter.js" | |
}, | |
"keywords": [ | |
"endomondo", | |
"export", | |
"gpx" | |
], | |
"author": "Kamil Burczyk ([email protected])", | |
"license": "MIT", | |
"dependencies": { | |
"cross-fetch": "^3.0.6", | |
"endomondo-api-handler": "^7.3.25", | |
"luxon": "^1.25.0", | |
"request": "^2.88.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment