https://github.com/kawarimidoll/deno-github-contributions-api
The unofficial get api of GitHub contributions with Deno 🦕
https://github.com/kawarimidoll/deno-github-contributions-api
contribution-graph contributions curl deno deno-deploy github github-api typescript
Last synced: 4 months ago
JSON representation
The unofficial get api of GitHub contributions with Deno 🦕
- Host: GitHub
- URL: https://github.com/kawarimidoll/deno-github-contributions-api
- Owner: kawarimidoll
- License: mit
- Created: 2021-06-30T07:34:57.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-16T00:50:13.000Z (over 1 year ago)
- Last Synced: 2024-12-08T11:41:08.917Z (5 months ago)
- Topics: contribution-graph, contributions, curl, deno, deno-deploy, github, github-api, typescript
- Language: TypeScript
- Homepage: https://github-contributions-api.deno.dev/
- Size: 591 KB
- Stars: 159
- Watchers: 2
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deno-github-contributions-api
[](.github/workflows/ci.yml)
[](https://github-contributions-api.deno.dev)
[](https://deno.land)
[](https://velociraptor.run)
[](LICENSE)Get your GitHub contributions data powered by Deno!

## 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:
```ts
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](https://github.com/kawarimidoll/deno-github-contributions-api/blob/main/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](https://github.com/cli/cli), you can call this API
from [gh-graph](https://github.com/kawarimidoll/gh-graph).---
```ts
if (this.repo.isAwesome || this.repo.isHelpful) {
star(this.repo);
}
```