Created
October 14, 2023 02:47
-
-
Save peckjon/6531c97344fe336166c51af913c2c6d1 to your computer and use it in GitHub Desktop.
Add all AMEX offers to card
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
// 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