With RunKit Endpoint Badge

https://badgen.net/runkit/amio/cal-badge/Asia/Shanghai
                          ──┬─ ────┬──── ──┬──────────
                            │      │       └─ path-args (optional)
                            │  notebook
                            │
                          owner

RunKit Endpoint

https://runkit.com/home#endpoint

If you are not familiar with RunKit endpoint, this guide would help.

Use Badgen with RunKit Endpoint

  1. Create a RunKit notebook (e.g. https://runkit.com/amio/cal-badge), which gives you an endpoint:

    https://runkit.io/amio/cal-badge/branches/master
    

    it returns a JSON like:

    {
      "subject": "2019",
      "status": "6-1",
      "color": "blue"
    }
    
  2. Construct badgen url using owner and notebook params:

    https://badgen.net/runkit/amio/cal-badge
    

    That's it:

Furthermore, you can append arbitrary path args (e.g. /Asia/Shanghai) to the end of badgen url, Badgen will request RunKit endpoint with that. This badge:

https://badgen.net/runkit/amio/cal-badge/Asia/Shanghai

represents data from:

https://runkit.io/amio/cal-badge/branches/master/Asia/Shanghai

Examples

/runkit/:owner/:notebook/:path*