Created
November 22, 2022 05:14
-
-
Save danyim/7bd9dc5106db6725a3791f5d30ed976e to your computer and use it in GitHub Desktop.
Add All Amex Offers
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 = document.querySelectorAll('.offer-cta[title="Add to Card"]'); | |
const sz = offerButtons.length - 1 | |
const shouldContinue = confirm(`Found ${sz} available offers, continue?`) | |
if(shouldContinue === true) { | |
for (let i = 0; i < sz; ++i) { | |
console.log(`Accepting offer ${i + 1} of ${sz - 1}`); | |
offerButtons[i].click(); | |
await new Promise(r => setTimeout(r, 3000)); | |
} | |
alert("Done!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a bookmarklet with this code using https://mrcoles.com/bookmarklet/