Add total-cost.handyflash
This commit is contained in:
parent
ddd2b9d6f2
commit
06826c149d
32
total-cost.handyflash.user.js
Normal file
32
total-cost.handyflash.user.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name Gesamtkosten Handyflash
|
||||||
|
// @namespace http://tampermonkey.net/
|
||||||
|
// @version 0.2
|
||||||
|
// @description Berechnet die Gesamtkosten der Verträge auf handyflash.de
|
||||||
|
// @author Jan Bader <jan@javil.eu>
|
||||||
|
// @match https?://www.handyflash.de/handys/*
|
||||||
|
// @updateUrl https://git.javil.eu/jacob1123/userscripts/raw/master/total-cost.handyflash.user.js
|
||||||
|
// @grant none
|
||||||
|
// ==/UserScript==
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
jQuery("article").each(
|
||||||
|
function(i, tarif) {
|
||||||
|
var grundgebuehr_text = jQuery(tarif).find(".tariff_price").text();
|
||||||
|
var grundgebuehr = parseFloat(grundgebuehr_text.split("€")[0].replace(',', '.'));
|
||||||
|
grundgebuehr = Math.round(grundgebuehr, 2);
|
||||||
|
|
||||||
|
var anzahlung_text = jQuery(tarif).find(".tariff_payout").text();
|
||||||
|
var anzahlung = parseFloat(anzahlung_text.split("€")[0].replace(',', '.'));
|
||||||
|
anzahlung = Math.round(anzahlung, 2);
|
||||||
|
var gesamt = grundgebuehr * 24 + anzahlung;
|
||||||
|
|
||||||
|
var details = jQuery(tarif).find(".tariff_links");
|
||||||
|
var header = jQuery(tarif).find(".tarife_box_header").text().replace(/^\s+|\s+$/g, '');
|
||||||
|
var info = (grundgebuehr * 24) + " + " + anzahlung + " = " + gesamt;
|
||||||
|
details.append("<p>"+info+"</p>");
|
||||||
|
console.log(header + ": " + info);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
})();
|
Loading…
x
Reference in New Issue
Block a user