Created
August 27, 2022 20:24
-
-
Save jlewin/14dc2ece33040bf8c9a3f43ba7d34223 to your computer and use it in GitHub Desktop.
Filter OfferUp results
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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