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 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
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) |
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>
.
I wrote my own script for this recently. Go to https://connect.garmin.com/modern/courses
then paste this into your console:
(() => {
// Every 1 second, click the little trash can icon next to a course
setInterval(() => {
document.querySelector("button[aria-label='Delete']").click();
// Wait 500ms for the modal to open, then click the delete button
setTimeout(() => {
// This delete button doesn't have a good class name, so find all the
// buttons, then find one with the text "Delete"
const buttons = document.querySelectorAll("button");
const deleteButton = Array.from(buttons).find((button) =>
button.textContent.includes("Delete"),
);
deleteButton.click();
}, 500);
}, 1000);
})();
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extremely helpful, thanks!
If I add new activities will the code keep executing forever? If so, how can I stop it?