在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:bmamlin/GitHubApi.groovy开源软件地址:https://github.com/bmamlin/GitHubApi.groovy开源编程语言:Groovy 100.0%开源软件介绍:GitHubApi.groovyA simple Groovy script to provide Groovy access to the GitHub API. I'm not making any claims to be the best Groovy programmer around. I just tend to use Groovy for scripting on occasion and wanted to be able to script against the GitHub API. The API object provided by this script will fetch all data requested, even if the data are paged. It will also respect GitHub's rate limits and sleep when necessary to avoid exceding those limits. The personal access token is necessary, since GitHub understandably limits the number of anonymous REST calls allowed. InstallationWhile you could clone this repository, that's not necessary. You can simply copy the contents of the raw GitHubApi.groovy file into an editor and save it as GitHubApi.groovy wherever you keep your Groovy scripts. SetupTo use this script, you need to have (or create) a personal access token (GitHub Settings > Personal access tokens) and place it into a file named Usage#!/usr/bin/env groovy
def github = new GitHubApi()
// Find all OpenMRS repositories whose name starts with "openmrs-module-"
repos = github.get('/orgs/openmrs/repos').findAll {
it.name.startsWith('openmrs-module-')
}
// List names of repositories
println repos.collect{ it.name }.join(', ') Methods
The GitHub API is well-documented here. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论