Skip to content

Instantly share code, notes, and snippets.

@thiagomgd
Created December 19, 2021 16:57
Show Gist options
  • Save thiagomgd/b1c7331cdc04e02ec1b17e9a2c6eb14f to your computer and use it in GitHub Desktop.
Save thiagomgd/b1c7331cdc04e02ec1b17e9a2c6eb14f to your computer and use it in GitHub Desktop.
Bookmarklet: Filter Kindle Unlimited books on Amazon Wishlist

Only works on wishlists that only contains Kindle ebooks.

Simple filter by removing '1 click buy', as kindle unlimited available show 'Other buy optionss' button.

Just click the bookmarklet and wait for the "finished" alert

javascript:(function()%7Bfunction removeThings()%7Bconsole.log('running')%3Bconst buyButtons %3D document.querySelectorAll('.wl-info-buy-with-one-click-image')%3Bif (buyButtons.length %3D%3D%3D 0) %7Balert('finished')%3Bwindow.scrollTo(0%2C0)%3Breturn%3B%7DbuyButtons.forEach(btn %3D> btn.closest('li').remove())%3Bwindow.scrollTo(0%2C0)%3Bwindow.scrollTo(0%2Cdocument.body.scrollHeight)%3BsetTimeout(()%3D> removeThings()%2C 3000)%3B%7DremoveThings()%7D)()
function removeThings(){
console.log('running');
const buyButtons = document.querySelectorAll('.wl-info-buy-with-one-click-image');
if (buyButtons.length === 0) {
console.log('finished');
window.scrollTo(0,0);
return;
}
buyButtons.forEach(btn => btn.closest('li').remove());
window.scrollTo(0,0);
window.scrollTo(0,document.body.scrollHeight);
setTimeout(()=> removeThings(), 3000);
}
removeThings();
@thiagomgd
Copy link
Author

Any improvements to script are welcome and I'll happily update the script and bookmarklet codes

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