Skip to content

Commit

Permalink
test(network): fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
rydesun committed Jul 25, 2020
1 parent 48b9df0 commit 72fd3b6
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 2 deletions.
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Awesome GitHub

![Build](https://github.com/rydesun/awesome-github/workflows/Build/badge.svg)
![Unit-Tests](https://github.com/rydesun/awesome-github/workflows/Unit-Tests/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/rydesun/awesome-github/badge.svg?branch=master)](https://coveralls.io/github/rydesun/awesome-github?branch=master)
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)

通过命令行工具 awg,探索你钟爱的 Awesome GitHub 仓库!

## 什么是 Awesome Lists

比如大名鼎鼎的 [awesome-go](https://github.com/avelino/awesome-go)
我们可以从中快速找到自己需要的库。

以及寻找更多的 [Awesome Lists](https://github.com/topics/awesome)

## 什么是 awg

当前,Awesome List 中的 GitHub 仓库信息,不包含 star 数、缺少仓库更新时间 (最后一次 commit 时间) 之类的信息。
很多时候,我们需要这些信息作为参考,不得不手动查看这些仓库的链接。

命令行工具 awg,帮助我们进一步挖掘 Awesome List 中所有仓库的惊人信息。

awg 将一次性获取指定 Awesome List 中的仓库信息,并以 JSON 数据格式输出和存储。稍后你可以使用
喜欢的数据处理工具进行分析,比如 jq 和 python。

## 安装

获取命令行工具 awg

```bash
go get github.com/rydesun/awesome-github/cmd/awg
```

## 使用

### GitHub Personal Access Token

从 GitHub API 获取仓库信息是有速率上限的。为了拓宽上限,需要提供 Personal Access Token,

注意!awg 只需要 Personal Access Token 有……的权限。不要再提供其他权限。

更多信息请参考 GitHub API RateLimit

### 配置

需要准备一个配置文件。可以参考目录`configs`中的
[配置文件模板](https://github.com/rydesun/awesome-github/blob/master/configs/config.yaml)

awg 会优先从环境变量`GITHUB_ACCESS_TOKEN`中读取 GitHub Personal Access Token,所以可以不用将该值储存在配置文件中。

### 运行

获取 JSON 数据文件

```bash
awg fetch --config path/to/config.yaml
```

(推荐) 从环境变量中指定 GitHub Personal Access Token 的形式运行

```bash
GITHUB_ACCESS_TOKEN=<Your Token> awg fetch --config path/to/config.yaml
```

## 简单分析

在获得数据文件`awg.json`后,通过使用 jq,你可以:

查看`Command Line`一节的内容,并按照仓库的 star 数进行排序

```bash
cat awg.json | jq '.data | ."Command Line" | sort_by(.star)'
```

## 注意事项

当前仅测试 awesome-go 的列表,其他 awesome list 的结果待检验。
4 changes: 2 additions & 2 deletions lib/cohttp/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func init() {
}
if req.URL.Path == "/text/wrong_path" {
rw.WriteHeader(400)
rw.Write([]byte("permisson denied"))
rw.Write([]byte("permission denied"))
}
if req.URL.Path == "/json" {
rw.Write([]byte(`{"foo": "bar"}`))
Expand Down Expand Up @@ -54,7 +54,7 @@ func TestClient_Text(t *testing.T) {
},
{
in: "/text/wrong_path",
out: "permisson denied",
out: "permission denied",
hasErr: true,
},
{
Expand Down

0 comments on commit 72fd3b6

Please sign in to comment.