Skip to content

Instantly share code, notes, and snippets.

@bigloser
Last active October 26, 2016 16:51
Show Gist options
  • Select an option

  • Save bigloser/435a367b2f2c0be8bedaa5a89b11598b to your computer and use it in GitHub Desktop.

Select an option

Save bigloser/435a367b2f2c0be8bedaa5a89b11598b to your computer and use it in GitHub Desktop.
greasemonkey script to only show veggie options
// ==UserScript==
// @name Eat Club Veggies
// @namespace sshah
// @include https://www.eatclub.com/*
// @require https://gist.githubusercontent.com/raw/2625891/waitForKeyElements.js
// @version 1
// @grant none
// ==/UserScript==
window.addEventListener('load', function () {
waitForKeyElements('.ec-menu-item', function () {
$('div.ec-menu-item').each(function () {
var imgs = $(this).find('img');
var foundVeggie = false;
if (imgs.length) {
for (var index = 0; index < imgs.length; ++index) {
var img = imgs[index];
if (img.src.endsWith('vegan.svg') || img.src.endsWith('vegetarian.svg')) {
foundVeggie = true;
}
}
if (!foundVeggie) {
$(this).remove();
}
}
});
})
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment