Skip to content

TobseF/thingiverse-badge

Repository files navigation

🎫 Thingiverse Badge

This is a Thingiverse-Badge SVG graphic which user designs and makes. The counter gets automatically updated by a GitHub CI workflow.

thingiverse-designs thingiverse-makes

⭐ Features

⭐ Customizable
⭐ SVG graphic
⭐ Always up to date
⭐ Image hosted by GitHub
⭐ Git based stats history
⭐ No API key is needed

📖 How it works

This update-badge-script.js Node.js script reads the Thingiverse API and writes the game stats into an SVG template file (thingiverse-makes-template.svg). If the generated badge is newer then the file in the repository, it commits the new generated thingiverse-makes.svg to this GIT repository. The pipeline gets triggered by a cron job, which automatically updates the image every midnight.

You can link the generated file by:
https://raw.githubusercontent.com/{userName}/thingiverse-badge/master/thingiverse-makes.svg

🛠 Config

The script can be configured to generate a badge for any user:

  • userName: Your username on BoardGameGeek.
    Example url: https://www.thingiverse.com/topsee/ userName = topsee
  • accessToken: OAuth2 access token.
    Check out the Getting Started Guide to learn how to generate the token.
    Set the THINGI_ACCESS_TOKEN in your project environments settings.
  • cron: You can change the update time interval in the .github/workflows/main.yml:
    On Line 6:
    - cron: '0 0 * * *' (every day at midnight). Uses the cron-job syntax.