Skip to content

Instantly share code, notes, and snippets.

@thefloodshark
Created October 6, 2023 05:34
Show Gist options
  • Save thefloodshark/48bda527504fee713c24b16fef7ca4ae to your computer and use it in GitHub Desktop.
Save thefloodshark/48bda527504fee713c24b16fef7ca4ae to your computer and use it in GitHub Desktop.
Wells Fargo Promo Activation (Tampermonkey)
// ==UserScript==
// @name Wells Fargo Promo Activation
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Clicks on elements with alternating classes
// @match https://web.secure.wellsfargo.com/auth/deals-portal
// @grant none
// ==/UserScript==
(function() {
'use strict';
setTimeout(function() {
const elements = document.querySelectorAll('.AvailableDealTile2__activation-status___jsguf');
let index = 0;
function clickNextElement() {
if (index < elements.length) {
elements[index].click();
setTimeout(function() {
const popupElements = document.querySelectorAll('.AvailableDeal__termsCloseButton___SbPJv');
if (popupElements.length > 0) {
popupElements[popupElements.length - 1].click(); // Click on the last element in the popup
}
index++;
setTimeout(clickNextElement, 2000); // Delay of 2 seconds (2000 milliseconds)
}, 2000); // Delay of 2 seconds (2000 milliseconds)
}
}
clickNextElement();
}, 2000); // Delay of 2 seconds (2000 milliseconds)
})();
// Wells Fargo changes class names. Use dev tools to find class names and replace them if needed. Also play around with delay timing
// also can copy and paste into console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment