dersimn / Flaschenpost.de Bestpreis Sortierer

// ==UserScript==
// @name            Flaschenpost.de Bestpreis Sortierer
// @description     Sortiert Angeboote auf flaschenpost.de nach Bestpreis pro Liter.
// @namespace       https://www.flaschenpost.de
// @version         0.2
// @license         MIT
// @match           https://www.flaschenpost.de/*
// @require         https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js
// ==/UserScript==

$(function() {
    $('#fp-productList > div').sort(function(a, b) {
        function extract_price(e) {
            var htmlText = $(e).find('.fp-productList_price small').text();
            var price = htmlText.match(/\(([0-9\,]+) €\/Liter\)/)[1];
            return price;
        }

        return extract_price(a) > extract_price(b);
    }).appendTo('#fp-productList');
});