Created
April 2, 2022 20:34
-
-
Save charlottetan/e9b182fe1559e42c582ea3f95d4dc274 to your computer and use it in GitHub Desktop.
Add all Amex offers to credit card
This file contains 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
const offerButtons = Array.from(document.getElementsByClassName("btn btn-sm btn-fluid offer-cta btn-secondary")) | |
.filter(btn => btn.title == "Add to Card"); | |
const offerMerchants = Array.from(document.getElementsByClassName("offer-info offer-column margin-b-md-down col-md-5")) | |
.map((offerInfo) => offerInfo.lastChild.innerHTML); | |
for (let index = 0; index < offerButtons.length; ++index) { | |
setTimeout(() => { | |
console.log(`Clicking offer button for ${offerMerchants[index]}`); | |
offerButtons[index].click() | |
}, Math.floor(Math.random() * 3000) + 2000 * index, index); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment