项目作者: x3388638

项目描述 :
Get GitHub contribution calendar graph & data
高级语言: JavaScript
项目地址: git://github.com/x3388638/github-calendar-graph.git
创建时间: 2018-07-17T09:27:03Z
项目社区:https://github.com/x3388638/github-calendar-graph

开源协议:MIT License

下载


github-calendar-graph npm version MIT Licence Open Source Love

Get the GitHub contributon calendar graph.
calendar-graph

Demo

Append the calendar graph as you see at GitHub to everywhere you want.
demo

Install

  1. $ npm install github-calendar-graph --save

Usage

  1. const CalendarGraph = require("github-calendar-graph");
  2. // get contribution graph
  3. CalendarGraph.fetch("GITHUB ACCOUNT").then(data => {
  4. console.log(data); // => string of HTML DOM
  5. });
  6. // get contribution count
  7. CalendarGraph.fetch("GITHUB ACCOUNT", true).then(data => {
  8. console.log(data); // => { 'DATE': 'CONTRIBUTION COUNT' }
  9. /*
  10. {
  11. '2018-07-01': 3,
  12. '2018-07-02': 1,
  13. '2018-07-03': 9,
  14. ...
  15. }
  16. */
  17. });
  18. // get contribution data including count and color
  19. CalendarGraph.fetch("GITHUB ACCOUNT", true, true).then(data => {
  20. console.log(data); // => { 'DATE': { count: 'CONTRIBUTION COUNT', color: 'COLOR FILLED' } }
  21. /*
  22. {
  23. '2018-07-01': {
  24. count: 3,
  25. color: '#196127'
  26. },
  27. '2018-07-02': {
  28. count: 0,
  29. color: '#ebedf0'
  30. },
  31. ...
  32. }
  33. */
  34. });