Compare commits

..

5 Commits

Author SHA1 Message Date
eb4e1af399 Update mealiecompute.js 2025-12-02 14:40:12 +01:00
66a0b25e39 Add mealiecompute.js 2025-12-02 14:18:34 +01:00
9b687b7fc4 Update 'blokada_blacklist' 2020-05-16 11:24:11 +02:00
92363c9ead more more more 2020-02-07 13:59:29 +01:00
b9b98133d8 wildcards galore 2020-02-07 13:47:57 +01:00
2 changed files with 80 additions and 10 deletions

View File

@@ -1,11 +1,25 @@
*facebook.com
fb.me
facebook.net
fbcdn.com
fbsbx.com
fbcdn.net
fb.com
messenger.com
*.messenger.com
m.me
tfbnw.net
*facebook.net
*facebook.de
*facebook.nl
*facebook.fr
*fb.me
*fbcdn.com
*fbsbx.com
*fbcdn.net
*fb.com
*messenger.com
*m.me
*tfbnw.net
*instagram.com
*whatsapp.com
*whatsapp.net
*crashlytics.com
*crashlytics.net
*appboy.com
*flurry.com
firebaseremoteconfig.googleapis.com
*appcenter.ms
*dsec.net
*giphy.com
*instagram.com

56
mealiecompute.js Normal file
View File

@@ -0,0 +1,56 @@
// ==UserScript==
// @name Mealie compute
// @namespace https://mealie.ilnee.com/
// @include https://mealie.ilnee.com/
// @version 2025-12-02
// @description accumulate the weight of ingredients on mealie.ilnee.com
// @author me
// @match https://*.ilnee.com/*
// @require https://code.jquery.com/jquery-3.7.1.slim.min.js
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant none
// ==/UserScript==
window.onload = function() {
if (window.jQuery) {
console.log("jQuery loaded");
}
}
var sum;
function summyshizzle() {
sum = 0;
var h2 = $('h2:contains("Ingredients"):first');
var items = h2.parent().parent().find('div.v-list-item-title > div.ingredient-item > div.d-inline > p');
//var items = $('div.text-subtitle-1.dense-markdown.ingredient-item > div.d-inline > p');
var match;
var firstNumber = 0;
items.each(function(i, obj) {
//console.log(i);
//console.log(obj.innerHTML);
match = obj.innerHTML.match(/\d+/);
firstNumber = match ? parseInt(match[0], 10) : null;
//console.log(firstNumber);
sum += firstNumber;
console.log(sum);
});
return sum;
}
$(document)
.ready(function() {
$('body').on('click', 'button[large="false"][type="button"]', (function(e) {
sum = 0;
sum = summyshizzle();
// console.log('sum: ' + sum);
$('div.ilneesum').remove();
$(this).parent().parent().parent().parent().parent().after('<div class="ilneesum">' + sum + '</div>');
}));
});