Skip to content

Instantly share code, notes, and snippets.

@peckjon
Created October 14, 2023 02:47
Show Gist options
  • Save peckjon/6531c97344fe336166c51af913c2c6d1 to your computer and use it in GitHub Desktop.
Save peckjon/6531c97344fe336166c51af913c2c6d1 to your computer and use it in GitHub Desktop.
Add all AMEX offers to card
// run this in browser console at https://global.americanexpress.com/offers/eligible (or use Tampermonkey)
var amexOfferButtons = []
var amexOfferClicker = function(index) {
if(index < amexOfferButtons.length) {
console.log("Clicking offer button "+index+" of "+amexOfferButtons.length);
amexOfferButtons[index].click();
setTimeout(function(){ amexOfferClicker(index+1) }, 500);
}
}
var amexOfferKickoff = function() {
amexOfferButtons = Array.from(document.getElementsByClassName("offer-cta")).filter(btn => btn.title == "Add to Card" || btn.title == "Activate Offer");
console.log("Found "+amexOfferButtons.length+" AMEX offer buttons");
if(amexOfferButtons.length > 0) {
amexOfferClicker(0);
} else {
setTimeout(amexOfferKickoff, 3000);
}
}
setTimeout(amexOfferKickoff, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment