I'm thinking an endpoint at
GET /libera/stats which returns either of the following based on the accept header:
application/json: A json payload with: currently receiving per month, received YTD
text/html: The same thing but as a cute little ifram friendly widget we can put on libera.chat without client JS
or do we do the latter with image/svg+xml maybe?
Most likely the thing to do here is:
- Retrieve the current balance of account
3993 from spiris using /v2/accountbalances/{accountNumber}/{date} which will tell you how much has been donated YTD
- Retrieve all currently active subscriptions from stripe tagged with the appropriate libera donations tag, and sum their amount per momth in SEK, likely using the preview stripe FX Quotes API to get the conversion rates, this gives a figure for money / month
- Can we receive the current sum from Liberapay? I don't think we can in a good way, but for the html version we might be able to use one of the widgets, like

- Cache these values in memory for 24 hours or something like that, also utilise HTTP cache headers to cache it upstream
- Add cors for the endpoint to allow getting the data via JS
I'm thinking an endpoint at
GET /libera/statswhich returns either of the following based on the accept header:application/json: A json payload with: currently receiving per month, received YTDtext/html: The same thing but as a cute little ifram friendly widget we can put on libera.chat without client JSor do we do the latter with
image/svg+xmlmaybe?Most likely the thing to do here is:
3993from spiris using /v2/accountbalances/{accountNumber}/{date} which will tell you how much has been donated YTD