githubinfocard

Experimental Go library which fetches summaries of GitHub repositories

  • Owner: tsdtsdtsd/githubinfocard
  • Platform:
  • License:: The Unlicense
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

github-infocard

Experimental Go library which fetches summaries of GitHub repositories

Godoc
Build Status
Go Report Card

CLI example

Idea

I wanted to create an element on my blog, which displays a summary for a given GitHub repository. It could show visitors information like:

  • the repository owners name
  • amount of stars, forks and open issues
  • date of last commit
  • maybe even the language details (the narrow colored bar above the branch button)

Searching for ways to fetch this kind of data I found the GitHub API and specificaly it's GraphQL API.
As I never messed with GraphQL, I thought that this is the perfect opportunity to learn some new things.

My current idea is to develop a library that helps fetching the data.
As an example and testing application, I want to add a CLI client, which just shows the desired data in an extraordinarily unspectacular manner.

GitHub API

You need a Personal access token for the API, which you can generate here (you need to be signed in first).

Usage

go get github.com/tsdtsdtsd/githubinfocard 

There is an example CLI client in example/cli/. It needs two things from you:

  • Environment variable named GITHUB_TOKEN, containing your personal access token
  • Parameter --url to indicate a repository

The following commands assume that you are in $GO_PATH/github.com/tsdtsdtsd/githubinfocard:

Windows

cmd /V /C "set GITHUB_TOKEN=##TOKEN## && go run example\cli\cli.go --url https://github.com/torvalds/linux"

Linux

GITHUB_TOKEN=##TOKEN## bash -c 'go run example/cli/cli.go --url https://github.com/torvalds/linux

Main metrics

Overview
Name With Ownertsdtsdtsd/githubinfocard
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:The Unlicense
所有者活动
Created At2019-01-28 17:30:54
Pushed At2019-02-16 22:57:24
Last Commit At2019-02-16 23:53:01
Release Count1
Last Release Name0.1 (Posted on )
First Release Name0.1 (Posted on )
用户参与
Stargazers Count13
Watchers Count2
Fork Count0
Commits Count14
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count0
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private