https://github.com/darjun/ghtrending
API to fetch github trending
https://github.com/darjun/ghtrending
Last synced: 12 months ago
JSON representation
API to fetch github trending
- Host: GitHub
- URL: https://github.com/darjun/ghtrending
- Owner: darjun
- License: gpl-3.0
- Created: 2021-06-15T23:38:32.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-17T14:22:08.000Z (about 5 years ago)
- Last Synced: 2025-04-04T22:11:17.017Z (about 1 year ago)
- Language: Go
- Size: 19.5 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## ghtrending
API to fetch github trending
## Usage
install package:
```cmd
$ go get -u github.com/darjun/ghtrending
```
fetch trending repositories:
```golang
import "github.com/darjun/ghtrending"
t := ghtrending.New()
repos, err := t.FetchRepos()
```
fetch trending developers:
```golang
t := ghtrending.New()
developers, err := t.FetchDevelopers()
```
use options:
```golang
// Go weekly trending
t := ghtrending.New(ghtrending.WithWeekly(), ghtrending.WithLanguage("Go"))
// C++ monthly trending
t := ghtrending.New(ghtrending.WithMonthly(), ghtrending.WithLanguage("C++"))
// 中文
t := ghtrending.New(ghtrending.WithSpokenLanguageCode("cn"))
```
you don't need to create object:
```golang
repos := ghtrending.TrendingRepositories()
developers := ghtrending.TrendingDevelopers()
```