Last active
January 6, 2017 19:52
Revisions
-
timbru31 revised this gist
Jan 6, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name Spigot Price Calculator // @namespace http://dustplanet.de // @version 0.1.2 // @description Calculates the total amount you have earned with your premium plugin. // @author xGhOsTkiLLeRx // @match https://www.spigotmc.org/resources/*/buyers @@ -28,6 +28,6 @@ let div = document.querySelector('.innerContent div'); let content = document.createElement('div'); let text = document.createElement('h3'); text.style.fontSize = '16pt'; text.textContent = `Total buyers: ${prices.length}, so far earned: €${price}, PayPal took €${fees}€, total: €${total}€`; content.appendChild(text); div.insertBefore(content, div.childNodes[2]); -
timbru31 renamed this gist
Oct 9, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
timbru31 revised this gist
Dec 12, 2015 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name Spigot Price Calculator // @namespace http://dustplanet.de // @version 0.1.1 // @description Calculates the total amount you have earned with your premium plugin. // @author xGhOsTkiLLeRx // @match https://www.spigotmc.org/resources/*/buyers @@ -20,12 +20,14 @@ for (let _price of prices) { let clean = text.replace( /^\D+/g, '').replace(/ EUR/, ''); price += +clean; } price = price.toFixed(2); let fees = (prices.length * 0.35 + price / 100 * 1.9).toFixed(2); let total = (price - fees).toFixed(2); let div = document.querySelector('.innerContent div'); let content = document.createElement('div'); let text = document.createElement('h3'); text.style.fontSize = '16pt'; text.textContent = `Total buyers: ${prices.length}, so far earned: ${price}€, PayPal took ${fees}€, total: ${total}€`; content.appendChild(text); div.insertBefore(content, div.childNodes[2]); -
timbru31 created this gist
Dec 12, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ // ==UserScript== // @name Spigot Price Calculator // @namespace http://dustplanet.de // @version 0.1 // @description Calculates the total amount you have earned with your premium plugin. // @author xGhOsTkiLLeRx // @match https://www.spigotmc.org/resources/*/buyers // @grant none // ==/UserScript== /* jshint -W097 */ 'use strict'; let prices = Array.from(document.querySelectorAll('.memberListItem .extra div.muted')); let price = 0; // iterate through buyers for (let _price of prices) { let text = _price.textContent.trim(); let clean = text.replace( /^\D+/g, '').replace(/ EUR/, ''); price += +clean; } price = Math.round(price * 100) / 100; let div = document.querySelector('.innerContent div'); let content = document.createElement('div'); let text = document.createElement('h3'); text.style.fontSize = '16pt'; text.textContent = `Total buyers: ${prices.length}, so far earned: ${price} EUR`; content.appendChild(text); div.insertBefore(content, div.childNodes[2]);