Skip to content

Instantly share code, notes, and snippets.

@burczyk
Created October 31, 2020 13:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burczyk/8800e4c193bd377cad568eb7563b22e2 to your computer and use it in GitHub Desktop.
Save burczyk/8800e4c193bd377cad568eb7563b22e2 to your computer and use it in GitHub Desktop.
endomondo-exporter
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');
}
});
})();
{
"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 (kamil.burczyk@gmail.com)",
"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