From 7c09b7cf61001775dc9afd0ff435ddcb9bbfea9b Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Thu, 9 Jun 2022 22:00:38 +0200 Subject: [PATCH] web-services/bandcamp: Add snippet for total purchase value --- docs/web-services.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/web-services.md b/docs/web-services.md index fbef1ee..3d05d06 100644 --- a/docs/web-services.md +++ b/docs/web-services.md @@ -27,6 +27,14 @@ :::js [...document.querySelectorAll('#track_table .track_row_view')].map(el => `${el.querySelector('.track_number').innerText} ${el.querySelector('.track-title').innerText} (${el.querySelector('.time').innerText})`).join("\n") +### Show total purchase value + +Works on https://bandcamp.com/USERNAME/purchases +The result needs to be feeded into an intelligent calculator like qalc. + + :::js + Array.from(document.querySelectorAll(".col.purchases-item-total div")).map(el => {const raw = el.children[1].innerText.replace("\n", " ").replace(",", ""); return raw.substr(1, raw.len)}).join(" + ") + ## Ototoy ### Get title listing (for MusicBrainz)