Skip to content

Instantly share code, notes, and snippets.

@dmoruzzi
Created April 7, 2024 17:19
Show Gist options
  • Save dmoruzzi/75ba24afc6433a8b6461d28550fd2d3e to your computer and use it in GitHub Desktop.
Save dmoruzzi/75ba24afc6433a8b6461d28550fd2d3e to your computer and use it in GitHub Desktop.
Click the Meijer MPerk Coupons

About

This code is a JavaScript snippet that automates the clicking of Meijer MPerk "Clip It" buttons with a specified delay between clicks. It's particularly useful when you have a list of buttons that you want to click one after another with a delay in between.

Warning

Please be advised that this JavaScript snippet provided is offered without any warranty, whether implied or express. The use of this code is at your own risk. The author shall not be held responsible for any damages or issues that may arise from its use.

It is essential to ensure that your use of this code complies with the Terms of Service (TOS) of the platforms or services involved. Any misuse or violation of TOS is solely the responsibility of the user.

Use this code responsibly and ethically.

const buttons = document.querySelectorAll('.coupon-tile__button--clip');
function clipCoupons(buttons, minDelay, maxDelay) {
let index = 0;
function clickButton() {
if (index < buttons.length) {
buttons[index].click();
index++;
const delay = Math.floor(Math.random() * (maxDelay - minDelay + 1)) + minDelay; // Random delay between minDelay and maxDelay
setTimeout(clickButton, delay);
}
}
clickButton();
}
clipCoupons(buttons, 350, 750);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment