Skip to content

Instantly share code, notes, and snippets.

@LukasKalbertodt
Last active March 13, 2023 17:05
Show Gist options
  • Save LukasKalbertodt/ce850139047f578f3392fc2b885384a2 to your computer and use it in GitHub Desktop.
Save LukasKalbertodt/ce850139047f578f3392fc2b885384a2 to your computer and use it in GitHub Desktop.
Veggie filter for Lieferando

I cannot believe how Lieferando still has no filter for this. So here is my hacky "filter". It sets the background color of non veggie meals to red (or unsets it if it's already red). I just test for a list of German words. You probably want to adjust that.

Be aware, this is a shitty filter. Probably has lots of false positives and false negatives.

The best way to apply this is to create a new bookmark in your browser and copy the code into the target/URL field. This makes it a bookmarklet.

Licensed under CC-0.

javascript:(function() {
document.getElementsByClassName("meal-container").forEach(c => {
const bad = /salami|schinken|thunfisch|meeresfr|kapern|sardellen|gyros|Hähnchen|Scampi|wurst|krabben|hackfleisch/i;
const good = /vegetarisch|vegan|veggie|vegetaria/i;
if (bad.test(c.innerText) && !good.test(c.innerText)) {
if (c.style.backgroundColor === "red") {
c.style.backgroundColor = null;
} else {
c.style.backgroundColor = "red";
}
}
})
})()
@apriljunge
Copy link

There's a Firefox and Chrome plugin now, based on this code [Github Project]

@LukasKalbertodt
Copy link
Author

Hui, thanks for letting me know :)

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