GitHub Follower API utilizes the followers endpoint of the GitHub v3 REST API in order to return a collection of usernames that follow a given user, as well as the followers of their followers.
Important: The JSON data returned will only contain the usernames of the top 100 followers up to 4 layers deep. This is configurable. See Configuration
Read more about the follower endpoint of the Github v3 REST API here: https://developer.github.com/v3/users/followers/
To download this project, either clone the repository or run:
go get github.com/TGibsonn/github-follower-apiRetrieve dependencies for this project by running:
go get -d -t ./...-t for test dependencies.
See the /config/config.go constants.
There you can configure:
DefaultPort
MaxFollowerCount
MaxFollowerDepthgo build
./github-follower-apior
./github-follower-api 3000to run on a different port.
The DefaultPort is 8080.
In order to run the tests recursively for this project:
go test ./...Tests are organized into subtests. You can pass -v to go test to see their labels and table-driven test details.
All unit tests are located next to their respective production code. I.e., api_test.go is next to api.go.
Due to rate limit constraints I recommend lowering the max follower count.
Authentication is not currently supported.
GET /followers/{username}
Returns a map of followers for a given user to the configured follower max count and max depth.