we dont depend on repo api anymore other than for contents
このコミットが含まれているのは:
コミット
722dd813f1
|
@ -49,18 +49,6 @@ func HandleRepo(c *fiber.Ctx) error {
|
|||
})
|
||||
}
|
||||
// API
|
||||
repo := utils.GetRequest("https://api.github.com/repos/" + c.Params("user") + "/" + c.Params("repo"))
|
||||
repoFiles := utils.GetRequest("https://api.github.com/repos/" + c.Params("user") + "/" + c.Params("repo") + "/contents")
|
||||
bruh := repoFiles.Get("#.@pretty").Array()
|
||||
for _, item := range bruh {
|
||||
repoFilesArray = append(repoFilesArray, RepoFiles{
|
||||
Name: item.Get("path").String(),
|
||||
Path: item.Get("path").String(),
|
||||
Type: item.Get("type").String(),
|
||||
Fullname: repo.Get("full_name").String(),
|
||||
DefaultBranch: repo.Get("default_branch").String(),
|
||||
})
|
||||
}
|
||||
|
||||
// Scraping
|
||||
Scrape := Repo{}
|
||||
|
@ -98,6 +86,19 @@ func HandleRepo(c *fiber.Ctx) error {
|
|||
// Add scrape-based info to repoArray
|
||||
repoArray = append(repoArray, Scrape)
|
||||
|
||||
// API
|
||||
repoFiles := utils.GetRequest("https://api.github.com/repos/" + c.Params("user") + "/" + c.Params("repo") + "/contents")
|
||||
bruh := repoFiles.Get("#.@pretty").Array()
|
||||
for _, item := range bruh {
|
||||
repoFilesArray = append(repoFilesArray, RepoFiles{
|
||||
Name: item.Get("path").String(),
|
||||
Path: item.Get("path").String(),
|
||||
Type: item.Get("type").String(),
|
||||
Fullname: Scrape.Fullname,
|
||||
DefaultBranch: Scrape.DefaultBranch,
|
||||
})
|
||||
}
|
||||
|
||||
// README
|
||||
var readmee string
|
||||
err := requests.
|
||||
|
|
読み込み中…
新しいイシューから参照