There are 2 previous versions of this script.
// ==UserScript==
// @name Preistrend Versandaddierer 0.1.2
// @namespace sc8
// @include http://www.preistrend.de/Preisvergleich_*.html
// @include http://www.preistrend.de/preisvergleich.php?*
// ==/UserScript==
var preise = document.evaluate("/html/body/table[2]/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[*]/td[3]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var versande = document.evaluate("/html/body/table[2]/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[*]/td[4]/a", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
if (versande.snapshotLength == 0) {
preise = document.evaluate("/html/body/table[2]/tbody/tr[2]/td[2]/div/table[3]/tbody/tr[*]/td[3]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
versande = document.evaluate("/html/body/table[2]/tbody/tr[2]/td[2]/div/table[3]/tbody/tr[*]/td[4]/a", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
}
var alertText = "";
var preis = 0;
var versand = 0;
for (var i = preise.snapshotLength - 1; i >= 0; --i) {
preis = parseFloat(preise.snapshotItem(i).firstChild.data.replace(/^(.*) (EUR|Euro)$/,"$1"))
versand = versande.snapshotItem(i).firstChild.data
if (versand == "siehe Shop") {
preise.snapshotItem(i).firstChild.data = versand
} else if (versand == "frei!") {
// Versand muss nicht hinzuaddiert werden.
preise.snapshotItem(i).firstChild.data = preis + " €"
} else {
versand = parseFloat(versand.replace(/^ab (.*) (EUR|Euro)$/,"$1"))
preise.snapshotItem(i).firstChild.data = ((preis + versand).toFixed(2)) + " €"
}
versande.snapshotItem(i).firstChild.data = "(inkl.)"
}