私信  •  关注

awesomemaker3000

awesomemaker3000 最近创建的主题
awesomemaker3000 最近回复了
3 年前
回复了 awesomemaker3000 创建的主题 » 有没有办法在Javascript中获取GitHub概要文件的贡献数?

我建议使用非官方的 Github Contributions API 位于 this site

下面是一个例子

async function getContributions(username) {
  var data = await (await fetch(`https://corsanywhere.herokuapp.com/https://github-contributions-api.deno.dev/${username}.json`)).json();
  console.log(data.totalContributions)
}
getContributions("octocat") // Returns 0, as Octocat has zero contributions