Last active
March 9, 2018 07:58
-
-
Save nicolov/5874ac9d64b24e6ae5a668228dfc056d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/vendor | |
/github-scraper | |
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. | |
[[projects]] | |
name = "github.com/google/go-github" | |
packages = ["github"] | |
revision = "e48060a28fac52d0f1cb758bc8b87c07bac4a87d" | |
version = "v15.0.0" | |
[[projects]] | |
branch = "master" | |
name = "github.com/google/go-querystring" | |
packages = ["query"] | |
revision = "53e6ce116135b80d037921a7fdd5138cf32d7a8a" | |
[solve-meta] | |
analyzer-name = "dep" | |
analyzer-version = 1 | |
inputs-digest = "612ff440a3db11b9c342f872ba4003534667bf6f910548e1e85c258ce224db01" | |
solver-name = "gps-cdcl" | |
solver-version = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gopkg.toml example | |
# | |
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | |
# for detailed Gopkg.toml documentation. | |
# | |
# required = ["github.com/user/thing/cmd/thing"] | |
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | |
# | |
# [[constraint]] | |
# name = "github.com/user/project" | |
# version = "1.0.0" | |
# | |
# [[constraint]] | |
# name = "github.com/user/project2" | |
# branch = "dev" | |
# source = "github.com/myfork/project2" | |
# | |
# [[override]] | |
# name = "github.com/x/y" | |
# version = "2.4.0" | |
[[constraint]] | |
name = "github.com/google/go-github" | |
version = "15.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/google/go-github/github" | |
"context" | |
"log" | |
) | |
func main() { | |
fmt.Println("Hello") | |
client := github.NewClient(nil) | |
ctx := context.Background() | |
opt := &github.PullRequestListOptions{ | |
ListOptions: github.ListOptions{PerPage: 50}, | |
Direction: "asc", | |
State: "closed", | |
} | |
var allPrs []*github.PullRequest | |
for { | |
prs, resp, err := client.PullRequests.List( | |
ctx, "tensorflow", "tensorflow", opt) | |
if err != nil { | |
log.Fatal(err) | |
} | |
allPrs = append(allPrs, prs...) | |
if resp.NextPage == 0 { | |
break | |
} | |
opt.Page = resp.NextPage | |
fmt.Println("page", resp.NextPage) | |
} | |
for _, pr := range(allPrs) { | |
fmt.Println(*pr.Number) | |
fmt.Println(pr.CreatedAt) | |
fmt.Println("") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment