Created
June 10, 2015 20:23
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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