timdoug's tidbits
2021-06-14
Quickly and easily sum your Bandcamp purchases
This will give per-currency totals. Tested in Safari, Firefox, and Chrome.
- Log in to your Bandcamp account and visit the purchases page, i.e., https://bandcamp.com/[your username]/purchases
- Scroll to the bottom and click "view all NNN purchases"
- Keep scrolling down until all purchases have loaded
- Right-click on the page and select "Inspect" in Firefox/Chrome, or "Inspect Element" in Safari
- Click the "Console" tab in the inspector
- Firefox only: type allow pasting to enable execution of the following snippet
- Paste the following into the console and hit return:
totals = {}; $('div.purchases-item-total').each(function (){ res = $(this).text().match(/(\d+\.\d+) (\w+)/); if (!totals.hasOwnProperty(res[2])) { totals[res[2]] = 0 }; totals[res[2]] += parseFloat(res[1]); }); totals
It should look something like this (floating point math is quirky, elide tiny subcent portions if present):
[/music]
permanent link