there meanwhile are three wrappers available:
- https://balletie.github.io/GitHub/ (from Balletie, very complete)
- https://github.com/astares/GitHub-API (this one)
- https://github.com/guillep/github-api (one from Guille, who now bases on the one from Balletie)
This project is a GitHub API Wrapper for Pharo to easily access informations from GitHub right from your Pharo image.
You can load the GitHub-API Wrapper easily into your Pharo image by using the follwing load expression:
Metacello new
repository: 'github://astares/GitHub-API/repository';
baseline: 'GitHubAPI';
load.
You can access GitHub users in two ways, either using the class GitHubUser
GitHubUser named: 'astares'
or by asking the GitHub class:
GitHub userNamed: 'astares'
If you have a user you can easily access the Avatar as a regular Form instance in Pharo:
(GitHub userNamed: 'astares') avatar
returning the following graphic form/picture:
You can check if the user is an organization or regular user:
(GitHub userNamed: 'pharo-project') isOrganization
which in the particular case of our example returns true as the Pharo-project organization has an account on GitHub.
To access the collection of repositories for a given GitHub user you can use one of the two expressions:
(GitHubUser named: 'pharo-project') repositories
or
GitHub repositoriesForUser: 'pharo-project'
which is a little bit shorter.
Package name | Description |
---|---|
GitHub-API-Core | The core package |
Package name | Description |
---|---|
GitHub-API-Test-Core | Tests for the core package |
(c) 2016 by Dipl.-Inf. T.Bergmann, Astares
Code is released and published with MIT License when used for Pharo projects.