Skip to content

Instantly share code, notes, and snippets.

@dhruska
Last active August 13, 2025 21:42
Show Gist options
  • Select an option

  • Save dhruska/057c4050f141c4ea5b14a155274f298f to your computer and use it in GitHub Desktop.

Select an option

Save dhruska/057c4050f141c4ea5b14a155274f298f to your computer and use it in GitHub Desktop.
Script to automatically add all American Express offers
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function clickAllOffers () {
const offerButtons = Array.from(document.getElementsByClassName("offer-cta")).filter(btn => btn.title === "Add to Card" || btn.title === "Activate Offer");
for (const offerButton of offerButtons) {
console.log("Clicking offer button");
offerButton.click();
await sleep(2000);
};
}
clickAllOffers();
@synox
Copy link
Copy Markdown

synox commented Feb 26, 2023

perfect, thank you!

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