Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badge Request: PSGallery profile total downloads #10593

Open
NorskNoobing opened this issue Oct 9, 2024 · 1 comment
Open

Badge Request: PSGallery profile total downloads #10593

NorskNoobing opened this issue Oct 9, 2024 · 1 comment
Labels
service-badge New or updated service badge

Comments

@NorskNoobing
Copy link

📋 Description

This badge would dynamically get the "Total downloads of packages", which is displayed on a PSGallery profile. I'd want it to look something like this static badge mockup, together with a link to the profile when you press the badge:

You can see the total downloads value on any PSGallery profile, but here's a link to mine for reference:
https://www.powershellgallery.com/profiles/NorskNoobing

🔗 Data

There's already another badge called PowerShell Gallery Downloads, but it seems to be limited to only a single package, and therefore can't fetch the downloads of all your packages combined. It seems to be using the following API:
https://www.powershellgallery.com/api/v2

Alternatively you could also scrape the profile website i.e. my profile on the following XPaths:

//*[@id="skippedToContent"]/section/section/aside/div/div[2]/h2/text()

or

/html/body/div[2]/section/section/aside/div/div[2]/h2/text()

🎤 Motivation

I'd want this to display the total downloads across all my PSGallery modules/packages on my GitHub profile README.

@NorskNoobing NorskNoobing added the service-badge New or updated service badge label Oct 9, 2024
@chris48s
Copy link
Member

Hi. Happy to look at a PR for this the information is available via the API.

We don't take new badges that rely on scraping. Keeping them working is too high-maintenance. From https://github.com/badges/shields/blob/master/CONTRIBUTING.md#badge-guidelines

Badges should not obtain data by scraping web pages - these are likely to break frequently. Whereas API publishers are incentivised to maintain a stable platform for their users, authors of web pages have no such incentive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests

4 participants
@chris48s @NorskNoobing and others