Skip to content

Instantly share code, notes, and snippets.

@scpurcell
Created August 7, 2019 20:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scpurcell/8d2dc96f1a6ce7fb55829adf0424a14d to your computer and use it in GitHub Desktop.
Save scpurcell/8d2dc96f1a6ce7fb55829adf0424a14d to your computer and use it in GitHub Desktop.
JS function to tell amazon not to use items for recommendation
/* Paste this in the JS console on the amazon "improve your recommendations" page.
It finds all the "don't use this item" checkboxes, and clicks them if they are not checked.
Finally it waits a few seconds for the XHR to complete, then loads the next page.
Of course this will all break when Amazon changes their page layout, but it shouldn't be too hard to fix.
*/
(function() {
var cb = document.querySelectorAll('[type=checkbox]');
for (var i = 0 ; i < cb.length ; i++) {
if (cb[i].parentElement.parentElement.id.startsWith("cb_isExcluded")) {
if (cb[i].checked === false) {
console.log(i + ":" + cb[i].parentElement.parentElement.id );
cb[i].click();
} else {
console.log(i + ":" + cb[i].parentElement.parentElement.id + ": skipped");
}
}
}
setTimeout((function() {
var next = document.getElementById("iyrNext");
if (next) next.click();
}), 3000);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment