Skip to content

kawarimidoll/deno-github-contributions-api

Repository files navigation

deno-github-contributions-api

ci deno deploy deno.land vr scripts LICENSE

Get your GitHub contributions data powered by Deno!

gif

Usage

as API

In your terminal:

$ curl https://github-contributions-api.deno.dev
# Then follow the messages...

Of course, you can access the endpoint from the web browser: https://github-contributions-api.deno.dev

as deno module

In your deno script file:

import { getContributions } from "https://github.com/kawarimidoll/deno-github-contributions-api/raw/main/mod.ts";

const username = "your-github-username";
const token = "xxxxxxxxxxxxxxxxxxxxxxx";

const contributions = await getContributions(username, token);

console.log(contributions.toTerm({ scheme: "random" }));

You can see an example in main.ts

The personal access token which has a "read:user" scope is required.

Generate your token from this page: https://github.com/settings/tokens/new

Extra

If you are using GitHub CLI, you can call this API from gh-graph.

Acknowledgements tweet

if (this.repo.isAwesome || this.repo.isHelpful) {
  star(this.repo);
}