Giter Club home page Giter Club logo

myges's Introduction

MyGes API Client Library for PHP

This library allows students to obtain information about their schooling (agenda, grades, absences, teachers, classes, students) if their school is part of the GES organization.

NOTE This library is unofficial, if you find a bug please feel free to contribute with a PR.

Requirements

Installation

Composer

Execute the following command to install this library:

composer require tchenu/myges

Include the autoloader

require_once  'vendor/autoload.php';

How to connect

You can connect your account with the client-id of the Skolae application.

<?php

require_once  'vendor/autoload.php';

try {
    // client-id = skolae-app
    $client = new MyGes\Client('skolae-app', 'your-login', 'your-password');
} catch(MyGes\Exceptions\BadCredentialsException $e) {
    die($e->getMessage()); // bad credentials
}

Examples

Run the following command to start a web server with PHP.


$ composer run-script examples

And then browsing to http://localhost:1337/profile.php (or any example available in the examples folder).

Example

<?php

require_once  'vendor/autoload.php';

try {
    $client = new MyGes\Client('<client-id>', '<login>', '<password>');
} catch(MyGes\Exceptions\BadCredentialsException $e) {
    die($e->getMessage()); // bad credentials
}

$me = new MyGes\Me($client);

$profile = $me->getProfile();

echo  "<img src='". $profile->_links->photo->href ."'></br>";
echo  "Nom : ". $profile->name ."</br>";
echo  "Prenom : ". $profile->firstname ."</br>";

Profile

myges's People

Contributors

tchenu avatar

Stargazers

annael.moussa avatar Angelo GERARD avatar Gonçalves Swan avatar Maxime LE HENAFF avatar Noé Larrieu-Lacoste avatar Nino Treyssat-Vincent avatar Dakyne avatar Aloïs marcellin avatar

Watchers

Aloïs marcellin avatar

Forkers

maaximelh

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.