github: github API

GitHub APIのラッパーパッケージ

> library(github)

バージョン: 0.9.7


関数名 概略
add.emails Add emails to the account
add.issue.labels Add labels to an issue
add.member.to.team add member to team
add.repository.collaborator add a user to the list of collaborators of a repo
add.repository.to.team add repository to team
am.following.user Test whether current user is following given user
conceal.member.of.organization conceal user membership in an organization
create.blob create a blob
create.commit create a commit
create.commit.comment create a comment for a given commit in a repository
create.fork create a fork under the current user
create.gist create a new gist
create.gist.comment Create gist comment
create.github.context Create a github context object.
create.hook create a new hook for repo
create.issue Create issue
create.issue.comment Create issue comment
create.key Add a public key with some id
create.milestone Create milestone
create.organization.repository create rpository under given organization
create.pull.request create a pull request
create.pull.request.comment Create a comment on a pull request
create.reference create a reference
create.repository create repository
create.repository.key create a repository key
create.repository.label create a label for a repository
create.repository.status create status for a ref in a repo
create.tag create a tag
create.team create a team in an organization
create.tree get a tree
delete.all.issue.labels Delete all issue labels
delete.commit.comment delete a single commit comment
delete.emails Delete emails from the account
delete.gist delete a gist
delete.gist.comment Delete gist comment
delete.hook delete a hook.
delete.issue.comment Delete issue comment
delete.issue.label Delete an issue from a label
delete.key Delete a public key with some id
delete.member.from.organization delete user from an organization
delete.member.from.team remove member from team
delete.milestone Delete milestone
delete.pull.request.comment Delete a comment on a pull request
delete.reference delete a reference
delete.repository delete repository
delete.repository.collaborator delete a user from the list of collaborators of a repo
delete.repository.download delete specific download for a repository
delete.repository.from.team remove repository from team
delete.repository.key delete a repository key
delete.repository.label delete a label from a repository
delete.team delete a team in an organization
follow.user Start following a given user
fork.gist fork a gist
get.all.my.issues get all issues across all the authenticated user's visible repositories including owned repositories, member repositories, and organization repositories
get.all.references get all references (or subreferences)
get.all.repositories get list of all repositories
get.all.repository.issues.comments Get list of comments for an issue
get.assignees Get list of assignees for a repo
get.blob get a blob
get.commit get a commit
get.commit.comment get a single commit comment
get.gist get a specific gist
get.gist.comment Get specific comment
get.gist.comments Get comments for a gist
get.github.context returns the most recently created github context, or creates one if none has been so far created
get.issue.comment Get specific comment
get.issue.comments Get list of comments for an issue
get.issue.events List events for an issue
get.issue.labels List all labels for an issue
get.key Get a public key with some id
get.milestone Get specific milestone from a repository
get.milestone.labels Get labels for every issue in a milestone
get.milestones List milestones for a repository
get.my.emails Get the list of emails of the current user
get.my.followers Get the list of followers for the current user
get.my.following List who is following the current user
get.my.gists list the current user's gists
get.my.issues List all issues across owned and member repositories for the authenticated user:
get.my.keys Get public keys for the current user
get.my.notifications list the current user's notifications
get.my.organization.events list events from the authenticated user organization
get.my.organizations List all organizations for the current user.
get.my.repositories Get list of repositories of current user
get.my.repository.notifications list the current user's notifications for a given repo
get.myself Get information on the current user
get.network.public.events list events for a network of repositories
get.organization Get an organization
get.organization.issues List all issues across an organization of the authenticated user:
get.organization.members list all members from an organization. List all users who are members of an organization. A member is a user that belongs to at least 1 team in the organization. If the authenticated user is also an owner of this organization then both concealed and public members will be returned. If the requester is not an owner of the organization the query will be redirected to the public members list.
get.organization.public.events list public events for an organization
get.organization.public.members list public members of organization
get.organization.repositories get list of repositories of given organization
get.organization.teams list teams from an organization
get.public.events list public events
get.pull.request get a specific pull request
get.pull.request.comments List comments on a pull request
get.pull.request.commits list commits for a pull request
get.pull.request.files list files for a pull request
get.pull.requests list all pull requests
get.pull.requests.comment Get specific comment for a pull request
get.pull.requests.comments List comments on all pull requests for a repo
get.reference get a git reference
get.repositories.starred.by.me list repos starred by current user
get.repositories.starred.by.user list repos starred by user
get.repositories.watched.by.me list repos watched by current user
get.repositories.watched.by.user list repos watched by users
get.repository get repository
get.repository.archive Get the archive of a repo
get.repository.branch get specific repository branch
get.repository.branches get list of repository branches
get.repository.collaborators get list of collaborators of a repo
get.repository.comments get all commit comments for a repository
get.repository.commit get a specific commit from a repo
get.repository.commit.comments get all commit comments for a given commit in a repository
get.repository.commits get commits from a repo
get.repository.contributors get list of repository contributors
get.repository.contributors.stats get stats on repository contributors
get.repository.diff return a diff between two commits
get.repository.download get specific download for a repository
get.repository.downloads list downloads for a repository
get.repository.events list events for a given repo
get.repository.forks list forks
get.repository.hook get specific hook of repository
get.repository.hooks list hooks of repository
get.repository.issue.event List a single event for a repository issue
get.repository.issue.events list issue events for a given repo
get.repository.issues List all issues for a repo
get.repository.key get a specific repository key
get.repository.keys list all repository keys
get.repository.label get a specific label for a repository
get.repository.labels List all labels for a repository
get.repository.languages get list of languages used in the repository, as estimated by github
get.repository.path Get the contents of a file
get.repository.readme Get the README for a repo
get.repository.statuses get statuses for a ref in a repo
get.repository.subscription get repository subscription info
get.repository.tags get list of repository tags
get.repository.teams get list of teams participating in the repository
get.stargazers list people who starred a repo
get.tag get a tag
get.team get team information
get.team.members list team members
get.team.repositories list repositories of a team
get.thread.notifications get single thread notifications
get.thread.notifications.subscription checks to see if the current user is subscribed to a thread.
get.tree get a tree
get.user Get information on some user
get.user.followers Get the list of followers for a given user
get.user.following List who a user is following
get.user.gists list the gists of a given user
get.user.keys Get public keys for a given user
get.user.organizations List all public organizations for an unauthenticated user. Lists private and public organizations for authenticated users.
get.user.performed.events list events that a user has performed
get.user.public.performed.events list public events that a user has performed
get.user.public.received.events list public events that a user has received
get.user.received.events list events that a user has received
get.user.repositories Get list of repositories of given user
get.users Get all github users
get.watchers list repo watchers
github github-package: use the Github API from R interactive.login Obtain a github context interactively
is.assignee Test if user is assignee in a repo
is.member.in.team test if user is a member of team
is.member.of.organization test if user is a member of an organization
is.public.member.of.organization test if user is a public member of organization
is.pull.request.merged test if pull request has been merged
is.repository.collaborator test if a given user is a collaborator of a repo
is.repository.starred.by.me check if repository is starred by current user
is.starred test if gist is starred
mark.my.notifications mark my notifications as read
mark.my.repository.notifications mark my notifications as read for a given repo
mark.thread.notifications mark a single thread as read.
modify.commit.comment update a single commit comment
modify.gist Edit a gist
modify.gist.comment Edit gist comment
modify.hook modify an exisitng hook for repo
modify.issue Modify issue
modify.issue.comment Modify issue comment
modify.key Update a public key with some id
modify.milestone Edit milestone
modify.myself Change information about the current user
modify.organization modify an organization
modify.pull.request edit pull request
modify.pull.request.comment Modify a comment on a pull request
modify.reference edit a reference
modify.repository modify repository
modify.repository.key update a repository key
modify.repository.label edit a specific label for a repository
modify.team edit a team in an organization
perform.merge.pull.request merge a pull request
perform.repository.merge perform a merge.
publicize.member.of.organization publicize user membership in an organization
replace.issue.labels Replace all issue labels
search.code Search the Github API.
search.issues Search the Github API.
search.repositories Search the Github API.
search.users Search the Github API.
set.repository.subscription set repository subscription info
set.thread.notifications.subscription subscribes current user to a thread, or ignore thread. Subscribing to a thread is unnecessary if the user is already subscribed to the repository. Ignoring a thread will mute all future notifications (until you comment or get
star.gist star a gist
star.repository star a repository
test.hook test a push hook. This will force github to trigger the given hook.
unfollow.user Stop following a given user
unset.repository.subscription clear repository subscription info
unset.thread.notifications.subscription deletes subscription info from thread.
unstar.gist unstar a gist
unstar.repository unstar a repository

create.issue

Arguments

  • owner
  • repo
  • content
  • ctx
> create.issue(owner, repo, content, ctx = get.github.context())
> # create.issue(owner = "uribo", repo = "cucumber_flesh",
> #                      content = list(title = "Create issue from {github} package", 
> #      body = ":package: {github}パッケージを使ってGithub issuesの作成\n改行はどうなるか :smile_cat:"))

create.repository

リポジトリの作成

Arguments

  • ...
  • ctx
> create.repository(name, description, private)

get.github.context

> get.github.context()
> # $api_url
> # [1] "https://api.github.com"
> # 
> # $client_secret
> # NULL
> # 
> # $personal_token
> # [1] ""
> # 
> # $token
> # NULL
> # 
> # $client_id
> # NULL
> # 
> # $max_etags
> # [1] 10000
> # 
> # $etags
> # <environment: 0x10dfda748>
> # 
> # $authenticated
> # [1] FALSE
> # 
> # $verbose
> # [1] FALSE
> # 
> # $user
> # $user$login
> # [1] "uribo"
> # 
> # $user$id
> # [1] 228649
> # 
> # $user$avatar_url
> # [1] "https://avatars.githubusercontent.com/u/228649?v=3"
> # 
> # $user$gravatar_id
> # [1] ""
> # 
> # $user$url
> # [1] "https://api.github.com/users/uribo"
> # 
> # $user$html_url
> # [1] "https://github.com/uribo"
> # 
> # $user$followers_url
> # [1] "https://api.github.com/users/uribo/followers"
> # 
> # $user$following_url
> # [1] "https://api.github.com/users/uribo/following{/other_user}"
> # 
> # $user$gists_url
> # [1] "https://api.github.com/users/uribo/gists{/gist_id}"
> # 
> # $user$starred_url
> # [1] "https://api.github.com/users/uribo/starred{/owner}{/repo}"
> # 
> # $user$subscriptions_url
> # [1] "https://api.github.com/users/uribo/subscriptions"
> # 
> # $user$organizations_url
> # [1] "https://api.github.com/users/uribo/orgs"
> # 
> # $user$repos_url
> # [1] "https://api.github.com/users/uribo/repos"
> # 
> # $user$events_url
> # [1] "https://api.github.com/users/uribo/events{/privacy}"
> # 
> # $user$received_events_url
> # [1] "https://api.github.com/users/uribo/received_events"
> # 
> # $user$type
> # [1] "User"
> # 
> # $user$site_admin
> # [1] FALSE
> # 
> # $user$name
> # [1] "Shinya Uryu"
> # 
> # $user$company
> # NULL
> # 
> # $user$blog
> # [1] "http://urush.postach.io"
> # 
> # $user$location
> # [1] "Yokohama, Japan"
> # 
> # $user$email
> # NULL
> # 
> # $user$hireable
> # [1] TRUE
> # 
> # $user$bio
> # NULL
> # 
> # $user$public_repos
> # [1] 68
> # 
> # $user$public_gists
> # [1] 38
> # 
> # $user$followers
> # [1] 37
> # 
> # $user$following
> # [1] 153
> # 
> # $user$created_at
> # [1] "2010-03-23T12:40:51Z"
> # 
> # $user$updated_at
> # [1] "2016-01-13T09:55:07Z"
> # 
> # $user$private_gists
> # [1] 6
> # 
> # $user$total_private_repos
> # [1] 5
> # 
> # $user$owned_private_repos
> # [1] 4
> # 
> # $user$disk_usage
> # [1] 154304
> # 
> # $user$collaborators
> # [1] 0
> # 
> # $user$plan
> # $user$plan$name
> # [1] "small"
> # 
> # $user$plan$space
> # [1] 976562499
> # 
> # $user$plan$collaborators
> # [1] 0
> # 
> # $user$plan$private_repos
> # [1] 10
> # 
> # 
> # 
> # $oath_scopes
> # [1] "gist, repo, user"
> # 
> # attr(,"class")
> # [1] "githubcontext"

get.repository

> get.repository(owner = "uribo", repo = "rpkg_showcase")
$ok
[1] TRUE

$content
$content$id
[1] 35421452

$content$name
[1] "rpkg_showcase"

$content$full_name
[1] "uribo/rpkg_showcase"

$content$owner
$content$owner$login
[1] "uribo"

$content$owner$id
[1] 228649

$content$owner$avatar_url
[1] "https://avatars.githubusercontent.com/u/228649?v=3"

$content$owner$gravatar_id
[1] ""

$content$owner$url
[1] "https://api.github.com/users/uribo"

$content$owner$html_url
[1] "https://github.com/uribo"

$content$owner$followers_url
[1] "https://api.github.com/users/uribo/followers"

$content$owner$following_url
[1] "https://api.github.com/users/uribo/following{/other_user}"

$content$owner$gists_url
[1] "https://api.github.com/users/uribo/gists{/gist_id}"

$content$owner$starred_url
[1] "https://api.github.com/users/uribo/starred{/owner}{/repo}"

$content$owner$subscriptions_url
[1] "https://api.github.com/users/uribo/subscriptions"

$content$owner$organizations_url
[1] "https://api.github.com/users/uribo/orgs"

$content$owner$repos_url
[1] "https://api.github.com/users/uribo/repos"

$content$owner$events_url
[1] "https://api.github.com/users/uribo/events{/privacy}"

$content$owner$received_events_url
[1] "https://api.github.com/users/uribo/received_events"

$content$owner$type
[1] "User"

$content$owner$site_admin
[1] FALSE


$content$private
[1] FALSE

$content$html_url
[1] "https://github.com/uribo/rpkg_showcase"

$content$description
[1] ":gift: Note that R packages demo and usage"

$content$fork
[1] FALSE

$content$url
[1] "https://api.github.com/repos/uribo/rpkg_showcase"

$content$forks_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/forks"

$content$keys_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/keys{/key_id}"

$content$collaborators_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/collaborators{/collaborator}"

$content$teams_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/teams"

$content$hooks_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/hooks"

$content$issue_events_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/issues/events{/number}"

$content$events_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/events"

$content$assignees_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/assignees{/user}"

$content$branches_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/branches{/branch}"

$content$tags_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/tags"

$content$blobs_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/git/blobs{/sha}"

$content$git_tags_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/git/tags{/sha}"

$content$git_refs_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/git/refs{/sha}"

$content$trees_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/git/trees{/sha}"

$content$statuses_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/statuses/{sha}"

$content$languages_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/languages"

$content$stargazers_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/stargazers"

$content$contributors_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/contributors"

$content$subscribers_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/subscribers"

$content$subscription_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/subscription"

$content$commits_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/commits{/sha}"

$content$git_commits_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/git/commits{/sha}"

$content$comments_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/comments{/number}"

$content$issue_comment_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/issues/comments{/number}"

$content$contents_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/contents/{+path}"

$content$compare_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/compare/{base}...{head}"

$content$merges_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/merges"

$content$archive_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/{archive_format}{/ref}"

$content$downloads_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/downloads"

$content$issues_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/issues{/number}"

$content$pulls_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/pulls{/number}"

$content$milestones_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/milestones{/number}"

$content$notifications_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/notifications{?since,all,participating}"

$content$labels_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/labels{/name}"

$content$releases_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/releases{/id}"

$content$deployments_url
[1] "https://api.github.com/repos/uribo/rpkg_showcase/deployments"

$content$created_at
[1] "2015-05-11T12:07:17Z"

$content$updated_at
[1] "2016-01-12T09:44:14Z"

$content$pushed_at
[1] "2016-02-27T14:51:21Z"

$content$git_url
[1] "git://github.com/uribo/rpkg_showcase.git"

$content$ssh_url
[1] "git@github.com:uribo/rpkg_showcase.git"

$content$clone_url
[1] "https://github.com/uribo/rpkg_showcase.git"

$content$svn_url
[1] "https://github.com/uribo/rpkg_showcase"

$content$homepage
[1] "uribo.github.io/rpkg_showcase"

$content$size
[1] 26692

$content$stargazers_count
[1] 1

$content$watchers_count
[1] 1

$content$language
[1] "HTML"

$content$has_issues
[1] TRUE

$content$has_downloads
[1] TRUE

$content$has_wiki
[1] TRUE

$content$has_pages
[1] TRUE

$content$forks_count
[1] 0

$content$mirror_url
NULL

$content$open_issues_count
[1] 0

$content$forks
[1] 0

$content$open_issues
[1] 0

$content$watchers
[1] 1

$content$default_branch
[1] "gh-pages"

$content$master_branch
[1] "gh-pages"

$content$permissions
$content$permissions$admin
[1] TRUE

$content$permissions$push
[1] TRUE

$content$permissions$pull
[1] TRUE


$content$network_count
[1] 0

$content$subscribers_count
[1] 1


$headers
$server
[1] "GitHub.com"

$date
[1] "Mon, 07 Mar 2016 14:54:40 GMT"

$`content-type`
[1] "application/json; charset=utf-8"

$`transfer-encoding`
[1] "chunked"

$status
[1] "200 OK"

$`x-ratelimit-limit`
[1] "5000"

$`x-ratelimit-remaining`
[1] "4998"

$`x-ratelimit-reset`
[1] "1457366079"

$`cache-control`
[1] "private, max-age=60, s-maxage=60"

$vary
[1] "Accept, Authorization, Cookie, X-GitHub-OTP"

$etag
[1] "W/\"c31398b4619ba054159dc09efe97ab22\""

$`last-modified`
[1] "Tue, 12 Jan 2016 09:44:14 GMT"

$`x-oauth-scopes`
[1] "gist, repo, user"

$`x-accepted-oauth-scopes`
[1] "repo"

$`x-github-media-type`
[1] "github.beta; format=json"

$`access-control-expose-headers`
[1] "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"

$`access-control-allow-origin`
[1] "*"

$`content-security-policy`
[1] "default-src 'none'"

$`strict-transport-security`
[1] "max-age=31536000; includeSubdomains; preload"

$`x-content-type-options`
[1] "nosniff"

$`x-frame-options`
[1] "deny"

$`x-xss-protection`
[1] "1; mode=block"

$vary
[1] "Accept-Encoding"

$`x-served-by`
[1] "a241e1a8264a6ace03db946c85b92db3"

$`content-encoding`
[1] "gzip"

$`x-github-request-id`
[1] "2A938D41:1D92C:3A2A387:56DD962F"

attr(,"class")
[1] "insensitive" "list"       

$code
[1] 200

search.code

> search.code(q    = "\\docType filename:.R path:R -user:cran -user:Bioconductor-mirror language:R", 
+             sort = "indexed") -> tmp
> 
> search.code(q    = "addClass+in:file+language:js+repo:jquery/jquery", 
+             sort = "indexed") -> tmp

search.repositories

> search.repositories("gg in:file language:r")