Skip to content

Instantly share code, notes, and snippets.

@jlewin
Created August 27, 2022 20:24
Show Gist options
  • Save jlewin/14dc2ece33040bf8c9a3f43ba7d34223 to your computer and use it in GitHub Desktop.
Save jlewin/14dc2ece33040bf8c9a3f43ba7d34223 to your computer and use it in GitHub Desktop.
Filter OfferUp results
// Drop undesired items
var removeList = ['Nespresso', 'Vertuo', 'Delonghi', 'De’Longhi', "De'longhi", 'Gevi', 'Calphalon', 'Ascaso', 'Mr ', 'Mr.', 'Krups', 'Keurig','Chefman','Conqueco', 'CBTL', 'Mattina', 'Terra', 'Smeg', 'EspressoWorks', 'Arlime', 'Bambino'];
// Remove matching results (and ads)
var links = Array.from(document.querySelectorAll('a'));
links.filter(l => l.href.includes('bing.com') ||
(l.href.includes('/item/detail') &&
removeList.some(r => l.title.toLowerCase().includes(r.toLowerCase()))))
.forEach(e => e.parentElement.removeChild(e));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment