Skip to content

Instantly share code, notes, and snippets.

@danyim
Created November 22, 2022 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danyim/7bd9dc5106db6725a3791f5d30ed976e to your computer and use it in GitHub Desktop.
Save danyim/7bd9dc5106db6725a3791f5d30ed976e to your computer and use it in GitHub Desktop.
Add All Amex Offers
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!")
}
@danyim
Copy link
Author

danyim commented Nov 22, 2022

Create a bookmarklet with this code using https://mrcoles.com/bookmarklet/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment