Skip to content

Add MakerWorld download count badges to README and Resources page - #39

Merged
DrewFerg11 merged 8 commits into
mainfrom
makerworld-download-badges
Aug 8, 2026
Merged

Add MakerWorld download count badges to README and Resources page#39
DrewFerg11 merged 8 commits into
mainfrom
makerworld-download-badges

Conversation

@drewferg11-hermes-bot

@drewferg11-hermes-bot drewferg11-hermes-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

What

Adds live MakerWorld download counts in two places:

  1. README badge — A shields.io dynamic badge showing total MakerWorld downloads across all your models, alongside the existing release/CI/stars/issues/Discord badges.

  2. Resources page badges — Pill-style badges (Downloads / Makes / Likes) below each MakerWorld link in the 3D Printed Designs & Mods table on the docs site.

Files changed

  • README.md — Added a MakerWorld Downloads badge using shields.io's dynamic JSON badge. It fetches the total downloadCount from your MakerWorld user profile API (/api/v1/user-service/user/profile/2542847618) server-side (no CORS proxy needed for shields.io) and links to https://makerworld.com/@DMFerg.
  • docs/javascripts/makerworld-badges.js — Self-contained script that auto-discovers MakerWorld links, extracts model IDs, fetches live stats via proxy.cors.sh (CORS proxy), and injects pill-style badges. Works with MkDocs Material SPA navigation.
  • docs/stylesheets/mw-badges.css — Badge styles with loading/error states. Uses Material CSS variables for light/dark theme support.
  • mkdocs.yml — Registers the new JS and CSS via extra_javascript and extra_css.

How the README badge works

shields.io has a dynamic JSON badge that fetches a JSON URL server-side and extracts a value via JSONPath. The MakerWorld user profile API returns a total downloadCount across all your models:

https://img.shields.io/badge/dynamic/json?url=https://makerworld.com/api/v1/user-service/user/profile/2542847618&query=$.downloadCount&label=MakerWorld%20Downloads&color=blue&logo=bambulab

No CORS proxy needed here because shields.io fetches from its own servers, not from the browser. The badge auto-updates with a cache period of ~30s to 5min (shields.io handles caching).

How the Resources page badges work

Same MakerWorld API, different delivery: the docs site needs client-side JS, so requests go through proxy.cors.sh (the MW API doesn't send CORS headers). If the proxy ever goes down, swapping to another proxy is a one-line change to the CORS_PROXY constant.

Verified

  • README badge: confirmed rendering on GitHub with live count (524)
  • Resources page: tested in-browser — all 8 MakerWorld models fetched successfully with live counts:
Model Downloads Makes Likes
Original display 1,721 596 970
Extended charset (48 flaps) 430 195 146
Flap customiser 204 57 46
Metal dowel mod 102 39 24
Blank spacer 20 7 17
Square enclosure 57 14 22
Character drum tools 14 8 5
Dual display 37 8 37

No changes to resources.md were needed — the script auto-discovers MakerWorld links.

@drewferg11-hermes-bot drewferg11-hermes-bot Bot changed the title Add MakerWorld download/make/like count badges to Resources page Add MakerWorld download count badges to README and Resources page Aug 8, 2026
…loadCount

The top-level downloadCount (524) includes instance/print-profile downloads
and other aggregated sources. MWCount.myDesignDownloadCount (193) is the
clean metric: downloads of Drew's own designs only.
@DrewFerg11
DrewFerg11 merged commit 795c23a into main Aug 8, 2026
11 checks passed
@DrewFerg11
DrewFerg11 deleted the makerworld-download-badges branch August 8, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant