githubinfocard

Experimental Go library which fetches summaries of GitHub repositories

  • 所有者: tsdtsdtsd/githubinfocard
  • 平台:
  • 许可证: The Unlicense
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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

主要指标

概览
名称与所有者tsdtsdtsd/githubinfocard
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证The Unlicense
所有者活动
创建于2019-01-28 17:30:54
推送于2019-02-16 22:57:24
最后一次提交2019-02-16 23:53:01
发布数1
最新版本名称0.1 (发布于 )
第一版名称0.1 (发布于 )
用户参与
星数13
关注者数2
派生数0
提交数14
已启用问题?
问题数0
打开的问题数0
拉请求数0
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?