Skip to content

Instantly share code, notes, and snippets.

View cjaSource's full-sized avatar

César Afonso cjaSource

  • OutSystems
View GitHub Profile
@cjaSource
cjaSource / sports-tracker-download.js
Last active August 18, 2023 11:21 — forked from bilan/sports-tracker-download.js
Download all workouts from sports-tracker
const key = "sessionkey=";
const valueStartIndex = document.cookie.indexOf(key) + key.length;
const token = document.cookie.substring(valueStartIndex, document.cookie.indexOf(';', valueStartIndex));
const activities = {0:"walk",1:"run",2:"ride",11:"hike",13:"alpineski",14:"rowing",15:"rowing"};
function downloadOne(item) {
var item = items[iGlobal];
const href = item.href;
const id = href.substr(href.lastIndexOf('/') + 1, 24);
const url = 'https://api.sports-tracker.com/apiserver/v1/workout/exportGpx/' + id + '?token=' + token;
@cjaSource
cjaSource / sports-tracker-download.js
Created August 18, 2023 10:42 — forked from anonymous/sports-tracker-download.js
Download all workouts from sports-tracker
// based entirely on this blog post:
// http://druss.co/2016/04/export-all-workouts-from-sports-tracker/
// unfortunately the original script no longer works, moslty because jQuery is
// no longer available on sports-tracker pages.
//
// I've compiled the changes proposed in the comments in the script below.
// to use the script, login to your sports-tracker account
// change URL to http://www.sports-tracker.com/diary/workout-list
// open browser console (Cmd-Shift-I)