Github API is annoying to work with for a basic task like repo search you wont need to request a tokens.
This library allows you to save time, and quickly start. No tokens needed. No restrictions. Extremely fast.
go get -u github.com/DipandaAser/github-scraper
Let's start with a trivial example
package main
import (
"fmt"
githubscraper "github.com/DipandaAser/github-scraper"
)
func main() {
s := githubscraper.New()
for repo := range s.SearchRepositories(githubscraper.DefaultSortOption, "go", 20) {
fmt.Println(repo.Name)
}
}
SortOptions:
githubscraper.DefaultSortOption
githubscraper.RepositoryMostStars
githubscraper.RepositoryFewestStars
githubscraper.RepositoryMostForks
githubscraper.RepositoryFewestForks
githubscraper.RepositoryRecentlyUpdated
SortOptions:
githubscraper.DefaultSortOption
githubscraper.UserMostFollowers
githubscraper.UserFewestFollowers
githubscraper.UserMostRecentlyJoined
githubscraper.UserLeastRecentlyJoined
githubscraper.UserMostRepositories
githubscraper.UserFewestRepositories
SortOptions:
githubscraper.DefaultSortOption
githubscraper.CommitRecentlyCommitted
githubscraper.CommitLeastRecentlyCommitted
githubscraper.CommitRecentlyAuthored
githubscraper.CommitLeastRecentlyAuthored
SortOptions:
githubscraper.DefaultSortOption
githubscraper.IssuesMostCommented
githubscraper.IssuesNewest
githubscraper.IssuesOldest
githubscraper.IssuesRecentlyUpdated
githubscraper.IssuesLeastRecentlyUpdated
In simple cases, you can use the default scraper without creating an object instance
package main
import (
"fmt"
githubscraper "github.com/DipandaAser/github-scraper"
)
func main() {
for repo := range githubscraper.SearchRepositories(githubscraper.DefaultSortOption, "go", 20) {
fmt.Println(repo.Name)
}
}