Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Old ver on Reddit didn't work so made a new one for those interested.
- // Go to
- // https://just-eat.co.uk/order-history
- // Log in and go to 'My Orders'
- // Click 'Load More' until the button disappears.
- // Right click BG and Inspect Element
- // Open console and paste below script, click enter, feel like crying.
- function getPrice(summary) {
- let start = summary.indexOf("£")
- let priceText = summary.substr(start + 1, 6);
- let price = parseFloat(priceText);
- console.log(price);
- return price;
- }
- let sum = 0;
- for (let result of document.getElementsByClassName("c-order-summary")) {
- let summary = result.innerText;
- let price = getPrice(summary);
- sum += price;
- }
- let totalString = new Intl.NumberFormat("en-gb", { style: "currency", currency: "GBP" }).format(sum);
- console.log(`Total: ${totalString}`);
- // credit to Zq-hx for script.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement