GithubHelp home page GithubHelp logo

stevencohn / catalogtcx Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 83 KB

Organizes Garmin Track .tcx files into a catalog of folders; also how to download from Strava!

License: MIT License

C# 100.00%
strava tcx dotnet-core

catalogtcx's Introduction

Catalog TCX

Organizes Garmin Track .tcx files into a catalog of folders.

  • Files are renamed according to their internal activity date and time to comply with the format yyyymmdd_hhmm.tcx, making them easy to sort and find.
  • The timestamp on the file is set to reflect the activity date and time.
  • Files are stored in yearly folders (\2020, \2019, \2018, etc.) so they can be easily Zipped and archived.

Discovers Track files from:

  1. The current folder
  2. A connected Garmin device (USB)
  3. Your Zwift user folder (MyDocuments\Zwift\Activities)
MyDocuments
  \2018
  \2019
     20191201_0813.tcx
     20191202_0504.tcx
     20191203_0522.tcx
     20191204_0617.tcx
  \2020
     20200101_1154.tcx
     20200102_1656.tcx
     20200104_1645.tcx

How to run

Download the latest release and copy to the folder of your choice and run the executable.

Or, download the source, compile with Visual Studio, VSCode, or the dotnet command line.

Download Individual Strava Activity as TCX File

Strava lets you download any activity as a .tcx simply by appending /export_tcx to the activity URL.

For example, given the activity URL:

https://www.strava.com/activities/2590236689

Append /export_tcx to this to download its .tcx file:

https://www.strava.com/activities/2590236689/export_tcx

Bulk Download Strava Activities as TCX Files

If you're tech-savvy (or just adventerous) then it is possible to download up to 20 activities at a time from the Strava activities page using the Microsoft Edge or Google Chrome Web browser.

First, you'll need to create a new code Snippet in your browser.

  1. Open your browser and press F12. This will display the developer tools pannel.
  2. Click the Sources tab
  3. Click the Snippets tab
  4. Click + New Snippet
  5. Name the snippet "Strava activities downloader"
  6. Paste the following code into the source code panel and press Ctrl-S to save it
var links =  jQuery("a[data-field-name='name']");
for (var i=0; i < links.length; i++) {
  if (links[i].href.indexOf('export_tcx') < 0) {
    links[i].href = links[i].href + '/export_tcx';
  }
  links[i].download = "activity" + i + ".tcx";
  window.setTimeout(function(link) {
    console.log('downloading', link.href, link.download);
    link.click();
  }, 1000 * i, links[i]);
}

Navigate to your activities page. Enter any desired filters to find the data you want. Note that only 20 activities are displayed at a time so you need to run this multiple times if you want more data.

Press Ctrl-Enter (or click the >Ctrl+Enter link at the bottom of the source panel) to execute the snippet.

Each file will be downloaded, one per second so wait for them all to finish before moving on.

Move to the next page of activities and re-run script, repeat as necessary.

catalogtcx's People

Contributors

stevencohn avatar stevenmcohn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.