Skip to content

Instantly share code, notes, and snippets.

@Jonathan-Mckenzie
Last active May 28, 2025 12:25
Show Gist options
  • Select an option

  • Save Jonathan-Mckenzie/5d9a585f9d9a22ad115d14fa60a019e7 to your computer and use it in GitHub Desktop.

Select an option

Save Jonathan-Mckenzie/5d9a585f9d9a22ad115d14fa60a019e7 to your computer and use it in GitHub Desktop.
Give everyone in your strava feed a kudos

Give kudos to every event in your feed

  1. Navigate to the main feed page of Strava in a web browser:
    https://www.strava.com/dashboard?num_entries=100
  2. Replace the "100" in the above URL with whatever number of activities you wish to give kudos to
  3. Open Developer Tools in your web browser and navigate to the console
  4. Paste the script below into the console and press enter:
setInterval(() => {
    document.querySelectorAll('button[title="Give kudos"]').forEach(node => {
        node.click();
    });
    window.scrollBy(0,1024); 
},2000);
  1. Every activity in view should be given Kudos.

Future Enhancements

  • Script that automatically fetches your activity feed and gives kudos
@ArneS
Copy link

ArneS commented Jan 29, 2025

A bit of UI

const maxButtons = 100; // Its weird going too far back
let delay = 25; // ms delay between clicks 

var buttonsToBeClicked = 0; 
const poppy = function() {
    const popup = document.createElement("div");
    popup.innerHTML = `
        <div style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center;">
          <div style="background: white; padding: 20px; border-radius: 5px; text-align: center;">
            <h2 style="margin: 0 0 10px;">The Kudoz Machina</h2>
            <p id="km"></p>
            <p id="km2"></p>
            <button onclick="this.parentElement.parentElement.remove()">oki!</button>
          </div>
        </div>
      `;
    document.body.appendChild(popup);
}
const wr = function(t, id) {
    document.getElementById(id).innerHTML = t
}

poppy()
setTimeout(() => {
    let allButtons = document.querySelectorAll('button:where([data-testid="kudos_button"])');    
    if (allButtons.length > 0) {
    
    wr(`Yay - found ${allButtons.length} buttons`, 'km');
    
    let buttons = Array.from(allButtons).slice(0, maxButtons);    
    buttons = buttons.filter(button =>
        ['Be the first to give kudos!', 'Give kudos'].includes(button.title)
    );

    if (buttons.length == 0) {
        wr(`No buttons to lick`, 'km2');
        console.log('ds')
    } else {
    
    buttons.forEach((node, i) => {    
        buttonsToBeClicked++;
        setTimeout(() => {
            wr(`Kudozing item ${i + 1} of ${buttonsToBeClicked}`, 'km2');
            node.click();
            if (i + 1 == buttonsToBeClicked) {
                wr(`Its dono`, 'km2');
            }
        }, delay * (i + 1));
    });
    wr(`Giving ${buttonsToBeClicked} kudoz for you`, 'km');
        }
} else {
        wr("No buttons found")
}
    
    }, 200)

Bookmarklet
A bookmarklet is javascript code converted to an URL and added as a bookmark. To create a bookmarklet with this code, just right-click the bookmarks bar and add a new one. Choose a name and then copy and paste this into the location of your new bookmark:

How to make a bookmarklet of the script:
https://gist.github.com/caseywatts/c0cec1f89ccdb8b469b1

@Jonathan-Mckenzie
Copy link
Author

@ArneS Great addition! TIL Bookmarklets.

Also, I'd prefer if we don't share somewhat-obfuscated (url encoded) javascript to promote blind execution of the script.

@ArneS
Copy link

ArneS commented Jan 29, 2025

Good point re sharing obfuscated code. TL;DR - this tool helps create bookmarklets (at own risk😸)

@ArneS
Copy link

ArneS commented May 28, 2025

I created a separate gist to maintain the bookmarklet version of this excellent script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment