Skip to content

Instantly share code, notes, and snippets.

@bsiver
Created June 10, 2015 20:23
Show Gist options
  • Save bsiver/2bf2d9d467cce3532339 to your computer and use it in GitHub Desktop.
Save bsiver/2bf2d9d467cce3532339 to your computer and use it in GitHub Desktop.
naive script for retrieving garmin activities from their service, only currently runnable from the classic activities page
activityServiceUrl = "https://connect.garmin.com/proxy/activity-service-1.1/tcx/activity"
activityIds = $('.activityNameLink').map(function() {
return this.href.substr(this.href.lastIndexOf('/') + 1)
});
urls = activityIds.map(function() {
return activityServiceUrl + this + ".tcx";
});
urls.map(function() { downloadURI(this); } )
function downloadURI(uri, name)
{
var link = document.createElement("a");
link.download = name;
link.href = uri;
link.click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment