Skip to content

Instantly share code, notes, and snippets.

@dhruska
Last active March 17, 2023 06:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dhruska/057c4050f141c4ea5b14a155274f298f to your computer and use it in GitHub Desktop.
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

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