Skip to content

Instantly share code, notes, and snippets.

@thefloodshark
Created October 6, 2023 03:33
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 thefloodshark/48bfa1c9fbc7c8ff00ef6ad84b0848ad to your computer and use it in GitHub Desktop.
Save thefloodshark/48bfa1c9fbc7c8ff00ef6ad84b0848ad to your computer and use it in GitHub Desktop.
American Express Promo Accepter (Tampermonkey)
// ==UserScript==
// @name Amex Promo Offers Accepter
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Clicks on elements with class "offer-cta" one at a time with a delay
// @match https://global.americanexpress.com/offers/eligible
// @grant none
// ==/UserScript==
(function() {
'use strict';
setTimeout(function() {
const elements = document.querySelectorAll('.css-1mz64tl');
let index = 0;
function clickNextElement() {
if (index < elements.length) {
elements[index].click();
index++;
setTimeout(clickNextElement, 2000); // Delay of 1 second (1000 milliseconds)
}
}
clickNextElement();
}, 2000); // Delay of 1 second (1000 milliseconds)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment