Code Monkey home page Code Monkey logo

Comments (3)

JiaxiangBU avatar JiaxiangBU commented on August 22, 2024

I spend sometimes to GitHub API.
Maybe the reason is the default state for the issue API is open?

curl -H "Authorization: token {private_token}" https://api.github.com/repos/JiaxiangBU/tutoring/issues?state=open -s
curl -H "Authorization: token {private_token}" https://api.github.com/repos/JiaxiangBU/tutoring/issues?state=closed -s

from projmgr.

emilyriederer avatar emilyriederer commented on August 22, 2024

Hi @JiaxiangBU - that's right! I didn't override any of the API's defaults for a consistent experience for anyone accessing the GitHub API through multiple tools.

To get closed issues, you can pass any of the API query parameters through the ...s in the get_ functions. For example, in this case, we can do:

library(projmgr)
library(magrittr)
repo <- create_repo_ref("JiaxiangBU", "tutoring")
#> Requests will authenticate with GITHUB_PAT
issue_list <- get_issues(repo, state = "all") %>% parse_issues()
nrow(issue_list)
#> [1] 61

To know what query parameters are available, you can also use the help_{function name} family of functions for the names of the query parameters for each endpoint. For example:

help_get_issues()
#> [1] "milestone" "state"     "assignee"  "creator"   "mentioned" "labels"    "sort"      "direction" "since"  

And for more details what each of these means, you can use the browse_docs family to open up the correct page of GitHub API documentation. For example, browse_docs(action = "get", object= "issue") should open this

Please let me know if that answers the question, and thanks for filing the issue! I will think about how I can highlight this better in the documentation.

from projmgr.

JiaxiangBU avatar JiaxiangBU commented on August 22, 2024

@emilyriederer thanks for your reply, I think it works for me with your reproducible example.

reproducible example works

library(projmgr)
library(magrittr)
repo <- create_repo_ref("JiaxiangBU", "tutoring")
#> Requests will authenticate with GITHUB_PAT
issue_list <- get_issues(repo, state = "all") %>% parse_issues()
nrow(issue_list)
#> [1] 61

Created on 2019-07-07 by the reprex package (v0.2.1)

further information is helpful

And for more details what each of these means, you can use the browse_docs family to open up the correct page of GitHub API documentation. For example, browse_docs(action = "get", object= "issue") should open this

projmgr::help_get_issues()
#> [1] "milestone" "state"     "assignee"  "creator"   "mentioned" "labels"   
#> [7] "sort"      "direction" "since"

Created on 2019-07-07 by the reprex package (v0.2.1)

projmgr::browse_docs(action = "get", object = "issue")
#> Open URL https://developer.github.com/v3/issues/#list-issues-for-a-repository

Created on 2019-07-07 by the reprex package (v0.2.1)

I see the arg description at this URL.

Name Type Description
state string Indicates the state of the issues to return. Can be either open, closed, or all. Default: open

good to beginners

Please let me know if that answers the question, and thanks for filing the issue! I will think about how I can highlight this better in the documentation.

I agree with you, maybe other beginners of this package face a similar question.

Thanks a lot.

from projmgr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.