merged functions.go
This commit is contained in:
commit
b08bed3618
@ -46,7 +46,6 @@ func (config *Config) GetConfig() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
githubconfig.StarsPages = githubsection.Key("stars_pages").String()
|
|
||||||
githubconfig.PageNum, err = githubsection.Key("page_num").Int()
|
githubconfig.PageNum, err = githubsection.Key("page_num").Int()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -86,7 +85,8 @@ func GetReposFromGitHub(config *Config) ([]GitHubRepo, error) {
|
|||||||
|
|
||||||
fmt.Println("Getting GitHub starred repos")
|
fmt.Println("Getting GitHub starred repos")
|
||||||
for num := 1; num <= config.githubconfig.PageNum; num++ {
|
for num := 1; num <= config.githubconfig.PageNum; num++ {
|
||||||
url := fmt.Sprintf(config.githubconfig.StarsPages, config.githubconfig.AuthUsername, config.githubconfig.MaxPerPage, num)
|
url := fmt.Sprintf("https://api.github.com/users/%s/starred?per_page=%d&page=%d", config.githubconfig.AuthUsername, config.githubconfig.MaxPerPage, num)
|
||||||
|
fmt.Println(url)
|
||||||
|
|
||||||
resp, err := InvokeGitHub(config, url)
|
resp, err := InvokeGitHub(config, url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
1
types.go
1
types.go
@ -38,7 +38,6 @@ type GlobalConfig struct {
|
|||||||
|
|
||||||
// GitHubConfig is the GitHub config
|
// GitHubConfig is the GitHub config
|
||||||
type GitHubConfig struct {
|
type GitHubConfig struct {
|
||||||
StarsPages string
|
|
||||||
MaxPerPage int
|
MaxPerPage int
|
||||||
PageNum int
|
PageNum int
|
||||||
AuthUsername string
|
AuthUsername string
|
||||||
|
Loading…
Reference in New Issue
Block a user