Embed Github contributions graph in website

前端 未结 5 451
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 13:53

Is there a way to embed the Github contributions graph in HTML5?

5条回答
  •  不思量自难忘°
    2021-01-30 14:43

    I was able to achieve this with Angular 4 by doing the following:

    1. Make a HTTP GET request to the url mentioned by @jianweichuah https://github.com/users//contributions.

    2. You'll need a proxy to get past the CORS issue just as the github-calendar library does. proxy-url/https://github.com/users//contributions

    3. Then present it back in the template.

    Sadly you don't get all the information easily, but it is in the SVG details.

    I have a write-up of my exact steps here: https://www.chiangs.ninja/blog/ And an example of it on the main site under the GitHub tab. I also grabbed my user information from the GitHub API and populated it around the chart.

提交回复
热议问题