tchenu / myges
There is no license information available for the latest version (1.0.2) of this package.
1.0.2
2021-10-17 16:33 UTC
Requires
- php: >=7.2
- guzzlehttp/guzzle: ^6.3
This package is not auto-updated.
Last update: 2024-05-16 23:02:48 UTC
README
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>";