close
The Wayback Machine - https://web.archive.org/web/20220307040149/https://github.com/CatsJuice/ssr-contributions-img
Skip to content
develop
Switch branches/tags
Code

SSR-Contribution-Svg

Image

A Nest.js API to render GitHub user's contributions to chart

Just pass Github username in route params, you will get the contribution wall render by svg. Support custom output format, color, quantity, size and so on

online example

Usage

Configuration

param type desc default
theme enum Preset themes, avaiable values:
  • green
  • red
  • purple
  • blue
green
chart enum Chart type, only calendar supported yet calendar
format enum Output formats:
  • html : return a html page
  • svg : return an svg file
  • xml : return an svg as xml
  • png : return a png file(transparent background)
  • jpeg : return a jpg file(white background)
html
quality number Image quality, supports numbers from 0.1 to 10. Only works when format is png or jpeg 1
widget_size enum Automatically calculate the number of weeks and size needed for the ios widget by specifying this property, avaiable values:
  • small
  • midiun
  • large
midium
weeks number Force specifying how many weeks to render, allow numbers from 1 to 50. This will override weeks calculated by widget_size undefined
colors string Hex colors value join with ,. This will override theme property undefined

Example

  • pin to notion notion

  • Use as ios widget with Scritable, example code:

      let url = "https://ssr-contributions-svg.vercel.app/_/CatsJuice?format=png&quality=2&theme=red&widget_size=midium"
    
      let w = await createWidget();
      Script.setWidget(w);
    
      async function createWidget() {
        let w = new ListWidget();
        let random = (Math.random()*100000000).toFixed(0);
        let data = await new Request(url + "&random=" + random).load();
        let image = Image.fromData(data);
        w.backgroundImage = image;
        return w;
      }

    Add scritable widget to home screen, and select script in widget configuration.

    iPhone 11 Pro