Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to specify which github stats should be called #88

Open
cansavvy opened this issue Sep 30, 2024 · 0 comments
Open

Add ability to specify which github stats should be called #88

cansavvy opened this issue Sep 30, 2024 · 0 comments
Assignees

Comments

@cansavvy
Copy link
Collaborator

Right now these are the API calls run:

What we'll wanna do besides add more documentation about all of these is to allow users to specify which ones they want. This would allow people to remove stats from the list if for some reason they don't have persmissions or its not applicable.

I think an argument like called github_stats would be added to this argument as well as the others that call it.

get_github_metrics <- function(repo, token = NULL, count = 100000, data_format = "dataframe", time_course = FALSE) {

By default it would be all where all is recoded into the full respective list. But otherwise someone could specify which they want and then we'd subset api_calls to what is specified. This would require each of these to be well documented.

https://github.com/fhdsl/metricminer/blob/main/R/github.R#L175

 if (time_course) {
    api_calls <- list(
      clones = "GET /repos/{owner}/{repo}/traffic/clones",
      views = "GET /repos/{owner}/{repo}/traffic/views"
    )
  } else {
    api_calls <- list(
      repo_activity = "GET /repos/{owner}/{repo}/activity",
      stars = "GET /repos/{owner}/{repo}/stargazers",
      forks = "GET /repos/{owner}/{repo}/forks",
      contributors = "GET /repos/{owner}/{repo}/contributors",
      community = "GET /repos/{owner}/{repo}/community/profile"
    )
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants