Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Commit f90832b

Browse files
authored
Merge pull request #1 from zmh-program/golang-alpha
Golang release
2 parents c91068d + 27d6d46 commit f90832b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2850
-1413
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.idea
2-
node_modules
1+
*.exe
2+
.idea

.replit

Lines changed: 0 additions & 77 deletions
This file was deleted.

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 91 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,114 @@
11
<div align="center">
22

3-
[<img src="public/favicon.png" alt="Code Statistic" width="64" height="64" style="transform: translateY(50px);">](https://stats.deeptrain.net)
3+
[<img src="docs/icon.png" alt="Code Statistic" width="64" height="64" style="transform: translateY(50px);">](https://stats.deeptrain.net)
44
# [Code Statistic](https://stats.deeptrain.net)
55

6-
#### Dynamically analysis the code for each language in the repository/user and generate the results for your GitHub account and repo README.
7-
#### 动态生成GitHub用户/仓库中的语言统计,可以作为图片装饰在个人首页和仓库README中
6+
#### ⚡ Dynamically generate your github statistic card!
87

9-
### [| 👀 |](https://stats.deeptrain.net)
8+
![License](https://img.shields.io/github/license/zmh-program/code-statistic?style=flat-square)
9+
![GitHub release](https://img.shields.io/github/v/release/zmh-program/code-statistic?style=flat-square)
10+
![GitHub stars](https://img.shields.io/github/stars/zmh-program/code-statistic?style=flat-square)
1011
<br>
1112
</div>
1213

13-
## 🍏 Quickstart | 快速开始
14+
## 🍊 User Card
15+
Hey, want to generate quickly? Have a look at our [website](https://stats.deeptrain.net/)!
1416

15-
### 🍊 Repo | 仓库
16-
*/repo/**username**/**repo**/*
17-
```markdown
18-
[![zmh-program's Github Stats](https://stats.deeptrain.net/repo/zmh-program/Zh-Website/)](https://github.com/zmh-program/code-statistic)
19-
```
20-
[![zmh-program's Github Stats](https://stats.deeptrain.net/repo/zmh-program/Zh-Website/)](https://github.com/zmh-program/code-statistic)
21-
22-
### 🍉 User | 用户
23-
*/user/**username**/*
17+
Use in your Github homepage! use it in your website! use it anywhere you want!
2418
```markdown
2519
[![zmh-program's Github Stats](https://stats.deeptrain.net/user/zmh-program/)](https://github.com/zmh-program/code-statistic)
2620
```
2721
[![zmh-program's Github Stats](https://stats.deeptrain.net/user/zmh-program/)](https://github.com/zmh-program/code-statistic)
2822

29-
### 🥝 Dark Theme | 暗系主题
30-
*.../**?theme=dark***
31-
```markdown
32-
[![zmh-program's Github Stats](https://stats.deeptrain.net/repo/zmh-program/Zh-Website/?theme=dark)](https://github.com/zmh-program/code-statistic)
33-
```
34-
[![zmh-program's Github Stats](https://stats.deeptrain.net/repo/zmh-program/Zh-Website/?theme=dark)](https://github.com/zmh-program/code-statistic)
23+
> **Note**
24+
> currently only your own repositories as statistics, do not support the repositories **contributed** to others, do not support **private** repositories, excluding **fork** repositories.
25+
>
26+
> We will count all repository data such as stars, forks, open issues and output the statistic.
3527
36-
### Ref as HTML | 作为HTML引用
37-
```html
38-
<a href="https://github.com/zmh-program/code-statistic">
39-
<img src="https://stats.deeptrain.net/repo/zmh-program/Zh-Website/?theme=dark" alt="zmh-program's Github Stats">
40-
</a>
41-
```
4228

43-
### API
44-
/api/user/*username*/
45-
/api/repo/*username*/*repo*/
29+
## 🍉 Repository Card
30+
Use in repository introduction! use in pull request! use in issue! use it anywhere you want to introduce the project!
4631

47-
### 🍎 Build Your Own Server | 搭建自己的服务器
48-
#### 🍒 Initialization | 初始化
49-
```shell
50-
pnpm install
32+
```markdown
33+
[![Deeptrain's Github Stats](https://stats.deeptrain.net/repo/zmh-program/Deeptrain)](https://github.com/zmh-program/code-statistic)
5134
```
35+
[![Deeptrain's Github Stats](https://stats.deeptrain.net/repo/zmh-program/Deeptrain)](https://github.com/zmh-program/code-statistic)
5236

53-
#### 🍬 Configuration | 配置
54-
https://github.com/zmh-program/code-statistic/blob/a3841c2eefcda8484f94f56724d8d6c2c015cd7c/config.ts#L1-L4
37+
> **Warning**
38+
> by default, we can't get the data of private repo, please use your own [token](https://github.com/settings/tokens/new) to deploy. Don't forget to check the box to access your private repositories!
5539
56-
#### 🎄 Environment Variable | 环境变量
40+
## 🥝 Dark Theme
41+
Very easy, just add `?theme=dark` after it in any kind of card!
42+
```markdown
43+
[![web-chatgpt-qq-bot's Github Stats](https://stats.deeptrain.net/repo/zmh-program/web-chatgpt-qq-bot/?theme=dark)](https://github.com/zmh-program/code-statistic)
44+
```
45+
[![web-chatgpt-qq-bot's Github Stats](https://stats.deeptrain.net/repo/zmh-program/web-chatgpt-qq-bot/?theme=dark)](https://github.com/zmh-program/code-statistic)
5746

58-
| `TOKEN` | GitHub Access Token |
59-
|---------|---------------------|
6047

48+
## 👨‍💻 API
49+
1. `GET` `https://stats.deeptrain.net/api/user/{user}`
6150

62-
#### 🍇 Deployment | 部署
63-
```shell
64-
ts-node index
65-
```
51+
> Example response:
52+
> ```json
53+
> {
54+
> "username": "zmh-program",
55+
> "org": false,
56+
> "location": "Shandong, China",
57+
> "repos": 24,
58+
> "stars": "0.3k",
59+
> "watchers": "0.3k",
60+
> "followers": "45",
61+
> "forks": "10",
62+
> "issues": "2",
63+
> "languages": [
64+
> {
65+
> "color": "#3572A5",
66+
> "lang": "Python",
67+
> "percent": 35.30345154490841,
68+
> "text": "Python 35% (525.1k)",
69+
> "value": 525070
70+
> },
71+
> ...
72+
> ]
73+
> }
74+
> ```
75+
> Error response:
76+
> ```json
77+
> {
78+
> "message": "user not found"
79+
> }
80+
> ```
81+
<br>
82+
83+
2. `GET` `https://stats.deeptrain.net/api/repo/{user}/{repo}`
84+
85+
> Example response:
86+
> ```json
87+
> {
88+
> "username": "zmh-program",
89+
> "license": "MIT",
90+
> "repo": "code-statistic",
91+
> "stars": "26",
92+
> "watchers": "26",
93+
> "color": "#a91e50",
94+
> "forks": "1",
95+
> "issues": "0",
96+
> "size": "1.0 MiB",
97+
> "languages": [
98+
> {
99+
> "color": "#3178c6",
100+
> "lang": "TypeScript",
101+
> "percent": 42.76333789329686,
102+
> "text": "TypeScript 43% (21.9k)",
103+
> "value": 21882
104+
> },
105+
> ...
106+
> ]
107+
> }
108+
> ```
109+
> Error response:
110+
> ```json
111+
> {
112+
> "message": "repo not found"
113+
> }
114+
> ```

0 commit comments

Comments
 (0)