Skip to content

Commit 363a0e0

Browse files
committed
add Readme for Grade Notifier
1 parent 2fb715a commit 363a0e0

File tree

2 files changed

+57
-15
lines changed

2 files changed

+57
-15
lines changed

Readme.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22

33
## Usage Examples
44

5+
### Grade Notifier with Docker
6+
7+
This docker container will check your grade every hour and send a notification mail, if something has changed. Currently this docker container is very tailored for DHBW-Mannheim students. But feel free to broaden its usability with a PR.
8+
9+
3 Environment variables are needed:
10+
11+
* `USERNAME`: Your student mail address with the domain part. That is also used to login to CampusNet (Dualis)
12+
* `VPNUSERNAME`: Your username without the domain part. Used for the login with Anyconnect VPN, to send mails.
13+
* `PASSWORD`: Your account password. Used for VPN, Campusnet and Mail authentication.
14+
* Optional `NOTIFY_RECIPIENT`: Mail address that will receive notifications. By default the same as `USERNAME`.
15+
16+
```
17+
docker run --privileged -e "USERNAME=s212689@student.dhbw-mannheim.de" -e "VPNUSERNAME=s212689" -e "PASSWORD=xxxxxxxxxxxxxxxx" ghcr.io/tinf21cs1/campusnet-grade-notifier
18+
```
19+
20+
[Detailed Readme](./grades-docker/Readme.md)
21+
22+
### Python Package
23+
24+
You can also use CampusNet.py as an imported Package to interact in detail with CampusNet.
25+
26+
```python
27+
$ python
28+
>>> from CampusNet import *
29+
>>> s = CampusNetSession("s***REMOVED***@student.dhbw-mannheim.de", "***REMOVED***")
30+
>>> s.modules
31+
[Module(num='T3_1000', name='Praxisprojekt I', credits=20.0, status='', semesters=['SoSe 2022'], id='381683598069776', grade=None), Module(num='T3INF1001', name='Mathematik I', credits=8.0, status='', semesters=['SoSe 2022', 'WiSe 2021/22'], id='380685560144022', grade=None), Module(num='T3INF1002', name='Theoretische Informatik I (MA-TINF21CS1)', credits=5.0, status='', semesters=['SoSe 2022'], id='382855008624547', grade=None), Module(num='T3INF1003', name='Theoretische Informatik II', credits=5.0, status='', semesters=['SoSe 2022'], id='382214102615788', grade=None), Module(num='T3INF1004', name='Programmieren', credits=9.0, status='', semesters=['SoSe 2022'], id='379974839816701', grade=None), Module(num='T3INF1005', name='Schlüsselqualifikationen', credits=5.0, status='', semesters=['SoSe 2022'], id='379974840574866', grade=None), Module(num='T3INF4102', name='Einführung in die Kryptologie', credits=5.0, status='', semesters=['SoSe 2022'], id='382214104541196', grade=None), Module(num='T3INF9000', name='Web and App Engineering', credits=5.0, status='', semesters=['SoSe 2022'], id='379974842066225', grade=None), Module(num='T3INF1006', name='Technische Informatik I', credits=5.0, status='bestanden', semesters=['WiSe 2021/22'], id='380703425164844', grade=1.2), Module(num='T3INF9001', name='Cyber Security Basics', credits=3.0, status='bestanden', semesters=['WiSe 2021/22'], id='379974841329087', grade=1.6)]
32+
>>> s.get_exams_for_module(s.modules[9])
33+
[Exam(semester='WiSe 2021/22', description='Hausarbeit (100%)', grade=1.6)]
34+
```
35+
536
### Exam Script
637

738
The `print_exams_as_table.py` script that is included in this repository will easily retrieve all Exams for a user and print them in a pretty table. This makes a quick overview very easy.
@@ -26,20 +57,6 @@ T3INF9001 Cyber Security Basics Modulabschlussleistungen
2657
--------- ---------------------------------------- ------------------------------------------------------ ------------ -------------------------------------------- ---
2758
```
2859

29-
### Python Package
30-
31-
You can also use CampusNet.py as an imported Package to interact in detail with CampusNet.
32-
33-
```python
34-
$ python
35-
>>> from CampusNet import *
36-
>>> s = CampusNetSession("s***REMOVED***@student.dhbw-mannheim.de", "***REMOVED***")
37-
>>> s.modules
38-
[Module(num='T3_1000', name='Praxisprojekt I', credits=20.0, status='', semesters=['SoSe 2022'], id='381683598069776', grade=None), Module(num='T3INF1001', name='Mathematik I', credits=8.0, status='', semesters=['SoSe 2022', 'WiSe 2021/22'], id='380685560144022', grade=None), Module(num='T3INF1002', name='Theoretische Informatik I (MA-TINF21CS1)', credits=5.0, status='', semesters=['SoSe 2022'], id='382855008624547', grade=None), Module(num='T3INF1003', name='Theoretische Informatik II', credits=5.0, status='', semesters=['SoSe 2022'], id='382214102615788', grade=None), Module(num='T3INF1004', name='Programmieren', credits=9.0, status='', semesters=['SoSe 2022'], id='379974839816701', grade=None), Module(num='T3INF1005', name='Schlüsselqualifikationen', credits=5.0, status='', semesters=['SoSe 2022'], id='379974840574866', grade=None), Module(num='T3INF4102', name='Einführung in die Kryptologie', credits=5.0, status='', semesters=['SoSe 2022'], id='382214104541196', grade=None), Module(num='T3INF9000', name='Web and App Engineering', credits=5.0, status='', semesters=['SoSe 2022'], id='379974842066225', grade=None), Module(num='T3INF1006', name='Technische Informatik I', credits=5.0, status='bestanden', semesters=['WiSe 2021/22'], id='380703425164844', grade=1.2), Module(num='T3INF9001', name='Cyber Security Basics', credits=3.0, status='bestanden', semesters=['WiSe 2021/22'], id='379974841329087', grade=1.6)]
39-
>>> s.get_exams_for_module(s.modules[9])
40-
[Exam(semester='WiSe 2021/22', description='Hausarbeit (100%)', grade=1.6)]
41-
```
42-
4360
## Contribution
4461

4562
This package is still work in progress. If you need data from CampusNet, that is currently not retrieved by it, please feel free to open an Issue or even PR for it.

grades-docker/Readme.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
docker run --privileged -e "USERNAME=s212689@student.dhbw-mannheim.de" -e "VPNUSERNAME=s212689" -e "PASSWORD=xxxxxxxxxxxxxxxx" 9cccf8dd9ca9
1+
# Campusnet Grade Notifier
2+
3+
This docker container will check your grade every hour and send a notification mail, if something has changed. Currently this docker container is very tailored for DHBW-Mannheim students. But feel free to broaden its usability with a PR.
4+
5+
## Usage
6+
7+
3 Environment variables are needed:
8+
9+
* `USERNAME`: Your student mail address with the domain part. That is also used to login to CampusNet (Dualis)
10+
* `VPNUSERNAME`: Your username without the domain part. Used for the login with Anyconnect VPN, to send mails.
11+
* `PASSWORD`: Your account password. Used for VPN, Campusnet and Mail authentication.
12+
* Optional `NOTIFY_RECIPIENT`: Mail address that will receive notifications. By default the same as `USERNAME`.
13+
14+
```
15+
docker run --privileged -e "USERNAME=s212689@student.dhbw-mannheim.de" -e "VPNUSERNAME=s212689" -e "PASSWORD=xxxxxxxxxxxxxxxx" ghcr.io/tinf21cs1/campusnet-grade-notifier
16+
```
17+
18+
`--privileged` is needed for the VPN connection.
19+
20+
## Process
21+
22+
On startup a VPN connection to `drogon.dhbw-mannheim.de` is established to allow for sending mails with SMTP.
23+
24+
Every hour a cronjob will connect to CampusNet and download the latest grades. These will be compared to the last known state, that is saved in `/app/grades.txt`
25+
26+
If something changed, sendmail is used to send the diff to the `NOTIFIER_RECIPIENT`, via `studgate.dhbw-mannheim.de:25`, authenticated as `USERNAME`.

0 commit comments

Comments
 (0)