mirror of
https://github.com/NohamR/PronoteBot.git
synced 2025-05-24 00:49:00 +00:00
Merge branch 'main' of https://github.com/NohamR/PronoteBot
This commit is contained in:
commit
51b3cb17d6
@ -1,4 +1,6 @@
|
||||
DISCORD_WEBHOOKS_PRONOTE = 'https://discord.com/api/webhooks/???'
|
||||
ENT_USERNAME = 'prenom.nom'
|
||||
ENT_PASSWORD = 'mdp'
|
||||
PRNT_USERNAME = 'pnom'
|
||||
PRNT_PASSWORD = 'mpd'
|
||||
ENT = 'ile_de_france'
|
Binary file not shown.
Before Width: | Height: | Size: 1.2 MiB |
31
README.md
31
README.md
@ -1,6 +1,7 @@
|
||||
# PronoteApi
|
||||
# PronoteBot
|
||||
|
||||
PronoteApi est un projet conçu pour faciliter la récupération des notes Pronote et envoyer des mises à jour à un webhook. Il utilise la bibliothèque [pronotepy](https://github.com/bain3/pronotepy) pour les interactions avec Pronote.
|
||||
PronoteBot est un projet conçu pour faciliter la récupération des notes Pronote et envoyer des mises à jour à un webhook. Il utilise la bibliothèque [pronotepy](https://github.com/bain3/pronotepy) pour les interactions avec Pronote.
|
||||

|
||||
|
||||
## Dépendances
|
||||
|
||||
@ -10,13 +11,13 @@ PronoteApi est un projet conçu pour faciliter la récupération des notes Prono
|
||||
|
||||
## Utilisation
|
||||
|
||||
Pour utiliser PronoteApi, suivez ces étapes :
|
||||
Pour utiliser PronoteBot, suivez ces étapes :
|
||||
|
||||
1. Clonez le dépôt :
|
||||
|
||||
```bash
|
||||
git clone https://github.com/NohamR/PronoteApi.git
|
||||
cd PronoteApi
|
||||
git clone https://github.com/NohamR/PronoteBot.git
|
||||
cd PronoteBot
|
||||
```
|
||||
|
||||
2. Installez les dépendances :
|
||||
@ -33,11 +34,13 @@ Pour utiliser PronoteApi, suivez ces étapes :
|
||||
ENT_USERNAME=your_ent_username
|
||||
ENT_PASSWORD=your_ent_password
|
||||
ENT=name_of_ent
|
||||
PRNT_USERNAME=your_pronote_username
|
||||
PRNT_PASSWORD=your_pronote_password
|
||||
```
|
||||
|
||||
Pour avoir le nom de votre ent : [ici](https://pronotepy.readthedocs.io/en/stable/api/ent.html), par exemple : ile_de_france.
|
||||
|
||||
4. Exécutez le script PronoteApi :
|
||||
4. Exécutez le script PronoteBot :
|
||||
|
||||
```bash
|
||||
python3 getgrades.py
|
||||
@ -46,19 +49,23 @@ Pour avoir le nom de votre ent : [ici](https://pronotepy.readthedocs.io/en/stabl
|
||||
|
||||
## Docker
|
||||
|
||||
Vous pouvez également construire et exécuter PronoteApi en tant que conteneur Docker. Utilisez les configurations Dockerfile et docker-compose.yaml suivantes :
|
||||
Vous pouvez également construire et exécuter PronoteBot en tant que conteneur Docker. Utilisez les configurations Dockerfile et docker-compose.yaml suivantes :
|
||||
|
||||
### Dockerfile
|
||||
|
||||
Le fichier Dockerfile est disponible [ici](Dockerfile). Assurez-vous de le placer à la racine du répertoire PronoteApi.
|
||||
Le fichier Dockerfile est disponible [ici](Dockerfile). Assurez-vous de le placer à la racine du répertoire PronoteBot.
|
||||
|
||||
Pour construire l'image Docker, exécutez la commande suivante à la racine du répertoire PronoteApi :
|
||||
Pour construire l'image Docker, exécutez la commande suivante à la racine du répertoire PronoteBot :
|
||||
|
||||
docker build -t pronoteapi:latest .
|
||||
docker run -d pronoteapi:latest
|
||||
```bash
|
||||
docker build -t PronoteBot:latest .
|
||||
docker run -d PronoteBot:latest
|
||||
```
|
||||
|
||||
### docker-compose.yaml
|
||||
|
||||
Le fichier docker-compose.yaml est disponible [ici](docker-compose.yaml). Assurez-vous de le placer à la racine du répertoire PronoteApi.
|
||||
Le fichier docker-compose.yaml est disponible [ici](docker-compose.yaml). Assurez-vous de le placer à la racine du répertoire PronoteBot.
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
BIN
exemple.png
Normal file
BIN
exemple.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 67 KiB |
13
getgrades.py
13
getgrades.py
@ -11,6 +11,8 @@ load_dotenv()
|
||||
DISCORD_WEBHOOKS_PRONOTE = os.getenv("DISCORD_WEBHOOKS_PRONOTE")
|
||||
ENT_USERNAME = os.getenv("ENT_USERNAME")
|
||||
ENT_PASSWORD = os.getenv("ENT_PASSWORD")
|
||||
PRNT_USERNAME = os.getenv("PRNT_USERNAME")
|
||||
PRNT_PASSWORD = os.getenv("PRNT_PASSWORD")
|
||||
ENT = os.getenv("ENT")
|
||||
path = 'new/pronote/'
|
||||
path =''
|
||||
@ -36,10 +38,13 @@ def envoyer_message_webhook(contenu):
|
||||
def refresh(send):
|
||||
content = ''
|
||||
try :
|
||||
client = pronotepy.Client('https://0910626l.index-education.net/pronote/eleve.html',
|
||||
username=ENT_USERNAME,
|
||||
password=ENT_PASSWORD,
|
||||
ent=globals().get(ENT)) #ile_de_france
|
||||
# client = pronotepy.Client('https://0910626l.index-education.net/pronote/eleve.html',
|
||||
# username=ENT_USERNAME,
|
||||
# password=ENT_PASSWORD,
|
||||
# ent=globals().get(ENT)) #ile_de_france
|
||||
client = pronotepy.Client('https://0910626l.index-education.net/pronote/eleve.html?login=true',
|
||||
username=PRNT_USERNAME,
|
||||
password=PRNT_PASSWORD)
|
||||
if not client.logged_in:
|
||||
exit(1)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user