Git Product home page Git Product logo

simple-php-github-api's Introduction

About

Very simple github API for PHP using OAuth

A github app

Make an github app under your github account -> edit profile -> apps

For my example I used:

URL:

http://cos/test/github/example/github.php

Callback URL:

http://cos/test/github/example/callback.php

Example without composer

Clone the source or download it into a web directory

git clone git://github.com/diversen/simple-php-github-api.git github

copy config.php-dist to config.php

cp config.php-dist config.php

Edit the 3. constants according to your setup.

define('GITHUB_ID', 'github_id');
define('GITHUB_SECRET', 'github_secret');
define('GITHUB_CALLBACK_URL', 'http://cos/test/github/callback.php');

Test it:

go to http://cos/test/github/github.php (or your web path).

This example will show the user his basic profile info. This could be used to make e.g. a login system.

More github API info

For full listing of all API calls check:

http://developer.github.com/

I have not tested all calls - but you should be able to use all. E.g. POST, or PATCH.

Composer specifics

You can include the lib into a vendor library

edit you composer.json file

add the following to repos (after I added this to packagist I believe you don't need it anymore):

{
    "type": "vcs",
    "url": "https://github.com/diversen/simple-php-github-api"
}

add the following to the require section:

"diversen/simple-php-github-api": "1.0.2"

simple-php-github-api's People

Watchers

Carlos Hugo Gonzalez Castell avatar James Cloos avatar

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.