https://github.com/andygrunwald/go-trending
Go library for accessing trending repositories and developers at Github.
https://github.com/andygrunwald/go-trending
hacktoberfest
Last synced: 5 months ago
JSON representation
Go library for accessing trending repositories and developers at Github.
- Host: GitHub
- URL: https://github.com/andygrunwald/go-trending
- Owner: andygrunwald
- License: mit
- Created: 2015-07-04T08:06:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T09:37:06.000Z (over 1 year ago)
- Last Synced: 2024-10-25T05:25:18.204Z (about 1 year ago)
- Topics: hacktoberfest
- Language: Go
- Homepage: http://godoc.org/github.com/andygrunwald/go-trending
- Size: 526 KB
- Stars: 141
- Watchers: 8
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- my-awesome - andygrunwald/go-trending - 10 star:0.1k fork:0.0k Go library for accessing trending repositories and developers at Github. (Go)
- awesome-go-plus - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github.  (Third-party APIs / Utility/Miscellaneous)
- fucking-awesome-go - :octocat: go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. :star: 72 :fork_and_knife: 2 (Third-party APIs / Advanced Console UIs)
- awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (Third-party APIs / Utility/Miscellaneous)
- awesome-go-cn - go-trending - trending) (第三方api / 实用程序/Miscellaneous)
- awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. - :arrow_down:4 - :star:74 (Third-party APIs / HTTP Clients)
- awesome-go - go-trending - Go library for accessing trending repositories and developers at Github. - ★ 95 (Third-party APIs)
- awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (Third-party APIs / Advanced Console UIs)
- awesome-go - go-trending - | - | - | (Third-party APIs / HTTP Clients)
- awesome-go-zh - go-trending
- awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (Third-party APIs / Utility/Miscellaneous)
- awesome-go-cn - go-trending
- awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (Third-party APIs / Utility/Miscellaneous)
- awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (Third-party APIs / Utility/Miscellaneous)
- fucking-awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and <b><code> ?⭐</code></b> <b><code> ?🍴</code></b> [developers](https://github.com/trending/developers)) at Github. (Third-party APIs / Utility/Miscellaneous)
- awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (Third-party APIs / HTTP Clients)
- awesome-go-cn - go-trending
- awesome-go-extra - go-trending - 07-04T08:06:48Z|2022-08-22T18:38:47Z| (Third-party APIs / Fail injection)
- awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (<span id="第三方api-third-party-apis">第三方API Third-party APIs</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go-with-stars - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (Third-party APIs / Utility/Miscellaneous)
- awesome-go - andygrunwald/go-trending
- awesome-go - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (Third-party APIs / Utility/Miscellaneous)
- awesome-Char - go-trending - Go library for accessing [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) at Github. (Third-party APIs / HTTP Clients)
- awesome-go-cn - go-trending - trending) [![godoc][D]](https://godoc.org/github.com/andygrunwald/go-trending) (第三方api / 实用程序/Miscellaneous)
README
# go-trending
[](https://godoc.org/github.com/andygrunwald/go-trending)
[](https://goreportcard.com/report/github.com/andygrunwald/go-trending)
A package to retrieve [trending repositories](https://github.com/trending) and [developers](https://github.com/trending/developers) from Github written in [Go](https://go.dev/).
[](https://raw.githubusercontent.com/andygrunwald/go-trending/master/img/go-trending-shrinked.png)
## Features
* Get trending repositories
* Get trending developers
* Get all programming languages known by GitHub
* Filtering by time and (programming) language
* Support for [GitHub Enterprise](https://enterprise.github.com/)
## Installation
It is go gettable
$ go get github.com/andygrunwald/go-trending
or using/updating to the latest master
$ go get -u github.com/andygrunwald/go-trending@master
## API
Please have a look at the [package documentation](https://pkg.go.dev/github.com/andygrunwald/go-trending) for a detailed API description.
## Examples
A few examples how the API can be used.
More examples are available in the [GoDoc examples section](https://pkg.go.dev/github.com/andygrunwald/go-trending#readme-examples).
### List trending repositories of today for all languages
```go
package main
import (
"fmt"
"github.com/andygrunwald/go-trending"
)
func main() {
trend := trending.NewTrending()
// Show projects of today
projects, err := trend.GetProjects(trending.TimeToday, "")
if err != nil {
panic(err)
}
for index, project := range projects {
i := index + 1
if len(project.Language) > 0 {
fmt.Printf("%d: %s (written in %s with %d ★ )\n", i, project.Name, project.Language, project.Stars)
} else {
fmt.Printf("%d: %s (with %d ★ )\n", i, project.Name, project.Stars)
}
}
}
```
### List trending repositories of this week for Go
```go
package main
import (
"fmt"
"github.com/andygrunwald/go-trending"
)
func main() {
trend := trending.NewTrending()
// Show projects of today
projects, err := trend.GetProjects(trending.TimeWeek, "go")
if err != nil {
panic(err)
}
for index, project := range projects {
i := index + 1
if len(project.Language) > 0 {
fmt.Printf("%d: %s (written in %s with %d ★ )\n", i, project.Name, project.Language, project.Stars)
} else {
fmt.Printf("%d: %s (with %d ★ )\n", i, project.Name, project.Stars)
}
}
}
```
### List trending developers of this month for Swift
```go
package main
import (
"fmt"
"github.com/andygrunwald/go-trending"
)
func main() {
trend := trending.NewTrending()
developers, err := trend.GetDevelopers(trending.TimeMonth, "swift")
if err != nil {
panic(err)
}
for index, developer := range developers {
i := index + 1
fmt.Printf("%d: %s (%s)\n", i, developer.DisplayName, developer.FullName)
}
}
```
### List available languages
```go
package main
import (
"fmt"
"github.com/andygrunwald/go-trending"
)
func main() {
trend := trending.NewTrending()
// Show languages
languages, err := trend.GetLanguages()
if err != nil {
panic(err)
}
for index, language := range languages {
i := index + 1
fmt.Printf("%d: %s (%s)\n", i, language.Name, language.URLName)
}
}
```
## Inspired by
* [rochefort/git-trend](https://github.com/rochefort/git-trend) (Ruby)
* [sheharyarn/github-trending](https://github.com/sheharyarn/github-trending) (Ruby)
## License
This project is released under the terms of the [MIT license](http://en.wikipedia.org/wiki/MIT_License).