Skip to content

AlxisHenry/epigrades

Repository files navigation

Epigrades 🎓

This project is a more glamorous and faster Gandalf (the intranet of Epitech). On this website you can retrieve my own grades ordered by semesters and also by modules, and the possibility for you student to see your grades easily !

Table of contents

  1. How to use it ?
  2. Technical guide
  3. Technologies
  4. Authors

How to use it ?

Go to epigrades, enter your Microsoft Epitech credentials, give your authentication code and that's it !

Tips: if you do not receive any notification, open your authenticator app and refresh the home screen to check for notifications.

For more confidentiality you will have a private token linked to your account.

Technical guide

First, you need to clone the repository.

$ git clone https://github.com/AlxisHenry/epigrades.git
$ cd epigrades

Install javascript dependencies

Note that I'm using pnpm instead of npm

$ pnpm install
$ pnpm run build
$ pnpm start

The web application is now running on http://localhost:3000.

Configure the puppeteer bot

The puppeteer bot is used to scrap the grades from the intranet. You can use it to scrap your grades and then use the web application to see your statistics.

Note: the bot is supporting SMS 2FA authentication and Microsoft Authenticator application usage.

You need to install the apt packages with the following command:

cd scraper
bash packages.sh

Testing

$ node scraper/index.js <email> <password> <uuid>
Using SMS A2F

When you run the script, you will be asked for an OTP code, which you should normally receive by phone.

You just need to run the otp.sh script using the following command:

$ bash scraper/otp.sh <uuid> <code>
Using Microsoft Authenticator

When you run the script, your A2F app will ask for a code of two digits, you can retrieve this code in the scraper/temp folder, in png format in a file named authenticator-<uuid>.png.

Access to your report

When the script is finished, you can access with the web application to your grades with the following url:

http://localhost:3000/online/<uuid>

For example, the default file is named me.json, so the url will be:

http://localhost:3000/online/me

API usage

The uuid parameter is the name of the file in the scraper/reports folder.

You can use the API to get your report in JSON format with the following command:

$ curl -X GET http://localhost:3000/api/online/<uuid>

Average

You can get the average of all your grades with the following endpoint:

$ curl -X GET http://localhost:3000/api/average?uuid=<uuid>

Without the uuid parameter, the API will return by default the average of the me.json file.

Note: If the given uuid is not found, the API will return -1.

Report (in PDF format)

You can get your report (in PDF format) encoded in base64 using the following endpoint:

$ curl -X GET http://localhost:3000/api/online/<uuid>/pdf

Note: If the given uuid is not found, the API will return null instead of the base64.

Technologies

Authors

About

Epigrades is a tool for Epitech students (in MSc-Pro) that allows them to retrieve all the necessary information for their academic journey in less than 2 minutes!

Topics

Resources

Stars

Watchers

Forks