Created
March 28, 2018 06:03
-
-
Save shrayasr/8ba2f9f740dfdceb31834a0eb35cb4c2 to your computer and use it in GitHub Desktop.
Bulk delete activities in Garmin Connect
This file contains 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
function foo() { | |
console.log("foo - start") | |
$("button.search-button").click() | |
setTimeout(function() { | |
var li = $(".list-item")[0] | |
var delButton = $(li).find("button.js-activity-delete") | |
var confirmDelButton = $(li).find("button.delete-yes") | |
console.log(delButton, confirmDelButton) | |
$(delButton).click() | |
setTimeout(function() { | |
$(confirmDelButton).click() | |
console.log("foo - end") | |
}, 100) | |
}, 2000) | |
} | |
setInterval(foo, 3000) |
Extremely helpful, thanks!
If I add new activities will the code keep executing forever? If so, how can I stop it?
No it'll run only on the page.
If you refresh the page it'll stop.
…On Thu, 28 Dec 2023, 15:10 lizcue, ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Extremely helpful, thanks!
If I add new activities will the code keep executing forever? If so, how
can I stop it?
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/shrayasr/8ba2f9f740dfdceb31834a0eb35cb4c2#gistcomment-4810127>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABF65YPQLK6KFBL5Q7O5LELYLWDXLBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVA4DQNRVGA2TEOFHORZGSZ3HMVZKMY3SMVQXIZI>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the following code to delete courses. If automaticly importing from Strava there can be a lot of old courses/routes.
//go to courses page first. click search as the activity list gets low.
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load
jQuery.noConflict();
function foo() {
console.log("foo - start")
$("button.search-button").click()
setTimeout(function() {
var list = $(".quick-action")
console.log("List length:", list.length)
if (list.length > 2) {
var li = $(list)[list.length - 1]
var delButton = $(li).find("a.icon-trash")[0]
}, 100)
}
setInterval(foo, 2500)