fishion / StravaImporter

script to import tcx files (as exported by Endomondo) into Strava
24 stars 8 forks source link

Prerequisites

Download an export of all your data from Endomondo

Install node etc and package dependencies

Get a Strava Client ID and Secret

  1. Follow instructions on "How to create and account" (https://developers.strava.com/docs/getting-started/#account). You just need to fill:
    1. Application name: FishionImporter
    2. Website: https://github.com/fishion/StravaImporter/
    3. Authorization Callback Domain: localhost
  2. Make a note of your Client ID and Client Secret - you'll be prompted for them later. If you prefer, you can export them as environment variables STRAVA_CLIENT_ID and STRAVA_CLIENT_SECRET

run the script

  1. run node index.js to start the upload script
  2. Follow the instructions of the script to give the script appropriate permissions
  3. Strava API is rate limited (100 API calls in any 15 min period, 1000 in a day) so depending on how many workouts you have to upload, it may take some time to complete. Script gives plenty of output to confirm when it is rate limited.
  4. As script runs, it moves successfully processed files to 'Workouts_Success'. Any failures will be moved to 'Workout_Failures'. This way, the script can be safely stopped part way through and restarted if necessary.

NOTE : Activity mapping

Run with docker

Build the image locally:

$ docker build . -t strava-importer

Run the image with your data and the Strava client credentials:

$ docker run \
  -it --rm \
  -v "$PWD/data":/usr/src/app/data \
  -e STRAVA_CLIENT_ID=$YOUR_APP_CLIENT_ID \
  -e STRAVA_CLIENT_SECRET=$YOUR_APP_CLIENT_SECRET \
  -w /usr/src/app \
  strava-importer \
  node index.js