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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?