Browse Source

feat: use proxy to query github api

master 1.8.6
OhYee 2 months ago
parent
commit
e86f94e9be
Signed by: OhYee
GPG Key ID: 5A9E1F63ED274FBB
  1. 2
      api/github.go
  2. 2
      api/pkg/avatar/main.go

2
api/github.go

@ -35,7 +35,7 @@ func githubRepo(username string, page int) (res []map[string]interface{}, err er @@ -35,7 +35,7 @@ func githubRepo(username string, page int) (res []map[string]interface{}, err er
client = http.DefaultClient
}
resp, err := client.Get(fmt.Sprintf("https://api.github.com/users/%s/repos?page=%d", username, page))
resp, err := client.Get(fmt.Sprintf("https://proxy.ohyee.cc/api.github.com/users/%s/repos?page=%d", username, page))
if err != nil {
return
}

2
api/pkg/avatar/main.go

@ -79,7 +79,7 @@ type githubUserInfo struct { @@ -79,7 +79,7 @@ type githubUserInfo struct {
// GetGithubAvatar get the github avatar of the email
func GetGithubAvatar(email string) (avatar string) {
rep, err := makeHTTPClient().Get(fmt.Sprintf("https://api.github.com/search/users?q=%s", email))
rep, err := makeHTTPClient().Get(fmt.Sprintf("https://proxy.ohyee.cc/api.github.com/search/users?q=%s", email))
if err != nil {
return
}

Loading…
Cancel
Save