XProc steps that implement the GitHub API
Currently there exist two XProc steps for requesting the GitHub API. They use primarily XProc's p:http-request
and rely on the capability of the XProc processor to expose JSON as XML.
The GitHub API responds to HTTP requests with JSON messages. In order, the XProc steps rely on an XProc processor which is able to automatically convert the JSON provided by the API to an XML representation. XML Calabash use a proprietary extension named transparentJSON for this purpose. MorganaXProc is currently not capable of exposing JSON as XML so we suggest to use XML Calabash.
The GitHub API limits the number of requests to 60 requests per day. To bypass this limit, you have to generate an access token in your GitHub settings. You can pass this token with the equally named option token
.
result
: provides the repositories and their metadata as transparentJSON XML document.
token
: GitHub access token
username
: name of the user or organization
group
: Belongs the username to a regular user or to an organization? The following values are permitted: users
and orgs
result
: provides the directories and files below the submitted contents URL as XML representation.
token
: GitHub access token
contents-url
: GitHub contents URL. If you request a repository, this information is shipped within j:contents_005furl
. Here is an example for a contents URL: https://api.github.com/repos/transpect/github-api/contents