Git Product home page Git Product logo

github-api's Introduction

GitHub-API (for Pharo)

Important note:

there meanwhile are three wrappers available:

  1. https://balletie.github.io/GitHub/ (from Balletie, very complete)
  2. https://github.com/astares/GitHub-API (this one)
  3. https://github.com/guillep/github-api (one from Guille, who now bases on the one from Balletie)

Introduction

This project is a GitHub API Wrapper for Pharo to easily access informations from GitHub right from your Pharo image.

Loading the project

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.

Usage

Accessing GitHub users

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'

Working with a GitHub user

Retrieving the Avatar

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:

Astares User Avatar

Check the user type

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.

Working with a GitHub repositories of a user

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.

Project Structure

General packages

Package name Description
GitHub-API-Core The core package

Test packages

Package name Description
GitHub-API-Test-Core Tests for the core package

License

(c) 2016 by Dipl.-Inf. T.Bergmann, Astares

Code is released and published with MIT License when used for Pharo projects.

github-api's People

Contributors

astares avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

estebanlm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.