https://github.com/uetchy/go-qiita
Go binding for Qiita API v2
https://github.com/uetchy/go-qiita
Last synced: about 1 year ago
JSON representation
Go binding for Qiita API v2
- Host: GitHub
- URL: https://github.com/uetchy/go-qiita
- Owner: uetchy
- License: mit
- Created: 2015-09-06T07:28:17.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-06-20T07:12:31.000Z (almost 7 years ago)
- Last Synced: 2025-03-29T11:34:42.602Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# go-qiita [](https://travis-ci.com/uetchy/go-qiita)
Go binding for Qiita API.
## Usage
This is simple example of go-qiita using OAuth2 Personal Access Token.
```go
import (
"github.com/uetchy/go-qiita/qiita"
"golang.org/x/oauth2"
"fmt"
)
func main() {
// Create OAuth2 client
ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: "personal access token"})
tc := oauth2.NewClient(oauth2.NoContext, ts)
// Create Qiita client using OAuth2 adapter
client := qiita.NewClient(tc)
// Fetch articles and print them
items, _, _ := client.Items.List(&qiita.ItemsListOptions{Query: "Alfred"})
fmt.Println(items)
}
```
## Document
See [godoc](http://godoc.org/github.com/uetchy/go-qiita) for further information and instructions.
## Build
```
$ go get github.com/uetchy/go-qiita
$ cd $GOPATH/github.com/uetchy/go-qiita
$ go install
```