Skip to content

HTTP REST API for retrieving a collection of GitHub followers recursively for a given user. Uses GitHub v3 REST API.

Notifications You must be signed in to change notification settings

TGibsonn/github-follower-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Follower API

Overview

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/

Table of Contents

Setup

Installation

To download this project, either clone the repository or run:

go get github.com/TGibsonn/github-follower-api

Dependencies

Retrieve dependencies for this project by running:

go get -d -t ./...

-t for test dependencies.

Configuration

See the /config/config.go constants.

There you can configure:

DefaultPort
MaxFollowerCount
MaxFollowerDepth

Building and Running

go build
./github-follower-api

or

./github-follower-api 3000

to run on a different port.

The DefaultPort is 8080.

Tests

Running Tests

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.

Structure

All unit tests are located next to their respective production code. I.e., api_test.go is next to api.go.

Constraints

Rate Limits

Due to rate limit constraints I recommend lowering the max follower count.

Authentication is not currently supported.

Endpoints

Followers

GET /followers/{username}

Returns a map of followers for a given user to the configured follower max count and max depth.

About

HTTP REST API for retrieving a collection of GitHub followers recursively for a given user. Uses GitHub v3 REST API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages