Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 3 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 (about 2 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
[![ci](https://github.com/kawarimidoll/deno-github-contributions-api/workflows/ci/badge.svg)](.github/workflows/ci.yml)
[![deno deploy](https://img.shields.io/badge/deno-deploy-blue?logo=deno)](https://github-contributions-api.deno.dev)
[![deno.land](https://img.shields.io/badge/deno-%5E1.13.0-green?logo=deno)](https://deno.land)
[![vr scripts](https://badges.velociraptor.run/flat.svg)](https://velociraptor.run)
[![LICENSE](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)Get your GitHub contributions data powered by Deno!
![gif](resources/t-rec.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:
```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);
}
```