mirror of
https://codeberg.org/gothub/gothub
synced 2024-12-06 19:16:24 +01:00
we dont depend on repo api anymore other than for contents
This commit is contained in:
+13
-12
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user