Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geoffreybauduin/nodejs-epitech-api
A small API to request Epitech's intranet using Nodejs
https://github.com/geoffreybauduin/nodejs-epitech-api
Last synced: about 9 hours ago
JSON representation
A small API to request Epitech's intranet using Nodejs
- Host: GitHub
- URL: https://github.com/geoffreybauduin/nodejs-epitech-api
- Owner: geoffreybauduin
- License: gpl-2.0
- Created: 2014-08-04T21:09:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-04T21:25:37.000Z (almost 8 years ago)
- Last Synced: 2024-11-01T09:33:38.238Z (5 days ago)
- Language: CoffeeScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Nodejs-Epitech-API
==================
[ ![Codeship Status for lght/Nodejs-Epitech-API](https://www.codeship.io/projects/a48f68f0-459c-0132-b40a-027a8d46592e/status)](https://www.codeship.io/projects/45065)A small API to request Epitech's intranet using Nodejs
`npm install epitech-api --save`
## Usage
### Login
```
var EpitechAPIConnector = require("epitech-api").EpitechAPIConnector;
var connector = new EpitechAPIConnector("login_x", "passwordunix");
var callbackSuccess = function (jsonData) {
console.log("User is connected");
};var callbackFailure = function (error, response) {
console.log("User is not connected");
};connector.signIn(callbackSuccess, callbackFailure);
```### Modules
Once logged in, you can get some informations about a specific module. You need to provide its `year`, its `codemodule` and its `codeinstance`.
```
var EpitechAPIConnector = require("epitech-api").EpitechAPIConnector;
var connector = new EpitechAPIConnector("login_x", "passwordunix");
connector.signIn(function () {
connector.getModule("2013", "B-GPR-650", "FR-6-1", function (json) {
console.log("Successfully get'd module");
}, function (error, response) {
console.log("Couldn't get module");
});
}, function () {
console.log("Cannot login");
});
```### Activity meeting slots
Once logged in, you can get a complete dump of the meeting slots page for an activity.
You need to provide its `year`, its `codemodule`, its `codeinstance` and its `codeacti`.```
var EpitechAPIConnector = require("epitech-api").EpitechAPIConnector;
var connector = new EpitechAPIConnector("login_x", "passwordunix");
connector.signIn(function () {
connector.getMeetingSlots("2013", "B-GPR-650", "FR-6-1", "acti-122352", function (json) {
console.log("Successfully get'd meeting slots");
}, function (error, response) {
console.log("Couldn't get meeting slots");
});
}, function () {
console.log("Cannot login");
});
```