this post was submitted on 11 Dec 2023
47 points (92.7% liked)

Asklemmy

49232 readers
591 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 6 years ago
MODERATORS
 

This progress bar is on the bottom of https://join-lemmy.org Does it automatically update when people donate to either the Liberapay, Patreon, or Open Collective? Is this progress bar open source so lemmy servers can implement it to show their donation\costs amounts?

top 11 comments
sorted by: hot top controversial new old
[โ€“] d3Xt3r@lemmy.nz 28 points 2 years ago (1 children)

It's just a static image. At the end of every month, a guy logs into all the donation sites, punches the numbers into a calculator, calculates how many more pixels needs to be added, then fires up MS Paint and paints the progress bar and uploads it to the website. ^(/s)

[โ€“] Asudox@lemmy.world 1 points 2 years ago

The only way.

[โ€“] Clearwater@lemmy.world 17 points 2 years ago (1 children)
[โ€“] nix@merv.news 6 points 2 years ago (3 children)

Oh, so is the progress bar just an image or is it code that can update the progress based on the manually inputted values?

Seems like something that could be automated using SVGs

[โ€“] porksoda@lemmy.world 8 points 2 years ago

Seems like something a donation could fund.

[โ€“] CannotSleep420@lemmygrad.ml 4 points 2 years ago

IIRC @dessalines@lemmy.ml decided against updating the donation progress automatically because it would involve juggling multiple donation platform APIs, which seemed more of a pain in the ass than it's worth.

[โ€“] Clearwater@lemmy.world 2 points 2 years ago* (last edited 2 years ago)

The main donate block of items is here: https://github.com/LemmyNet/joinlemmy-site/blob/main/src/shared/components/common.tsx#L129

Follow the chain and you'll see it's just using the progress html element.

[โ€“] auf@lemmy.ml 5 points 2 years ago* (last edited 2 years ago) (1 children)

https://github.com/LemmyNet/joinlemmy-site/blob/main/src/shared/donation_stats.ts

And here's the code to update the stats

https://github.com/LemmyNet/joinlemmy-site/blob/main/update_donations.mjs

Does it automatically update when people donate to either the Liberapay, Patreon, or Open Collective?

It seems not. It's updated each time the website owner ~~rebuilds the front page~~ runs npm run update_donations.

[โ€“] dessalines@lemmy.ml 0 points 2 years ago

Its run and updated in a cronjob every hour.

[โ€“] dessalines@lemmy.ml 2 points 2 years ago (1 children)

Yes, it automatically updates every hour. Its just an html progress bar based on a coded goal, and the current donation amounts from given platforms.

[โ€“] nix@merv.news 4 points 2 years ago

Thats awesome! it would be great if you could make a post about it so instance admins would be aware of it and know they can implement it on their homepage so users can ensure their instance is sustainably funded