如何使用 github api 计算每周增加的行数?

how to count weekly additions of lines using github api?

参考:https://developer.github.com/v3/repos/statistics/#get-the-number-of-additions-and-deletions-per-week

我试过了:https://api.github.com/repos/Md-Mudassir/cruiser/stats/code_frequency

Response:
[
  [
    1571529600,
    59258,
    -59151
  ],
  [
    1572134400,
    30660,
    -18359
  ],
  [
    1572739200,
    1688,
    -1731
  ],
  [
    1573344000,
    9087,
    -9371
  ],
  [
    1573948800,
    0,
    0
  ]
]

但是我不明白响应,我该如何转换它以便它可读?

这包括:

  • a Unix timestamp 表示接下来两个数字的一​​周开始时间
  • 添加的行数
  • 删除的行数。

您必须 convert the Epoch number 才能得出星期。