Simple Grade Crawler for DHGE SelfService - Dockerized!!!
Intended for Docker (see A., B.), but also works without Docker on Linux(C.) and Windows10(D.)
This fork was designed to run headless all day, e.g. on a raspberrypi, and inform students about new grades via mail, shortly after they are uploaded. The shell output of the original script was preserved.
ℹ️ We strongly recommend to not poll for new grades more often than every 15 minutes in order to avoid too much traffic on the website. For the same reason we also recommend to form groups of students using one instance by adding multiple mail-receivers.
Additional features of the fork:
- possibilty to deploy leveraging docker
- configuration separated from main script
- check for new grades in multiple semesters with one instance
- fixed mail function, regarding problems with SSL/TLS
- add additional mail-receivers
- decide which mail-receiver is only informed that there are new grades and who actually receives the grade-list
-
Install Docker (process platform-dependent), visit https://docs.docker.com/get-started/
-
Configure the script GradeCrawler_headless.py by customizing example_configcrawler.ini and rename file to configcrawler.ini
-
Copy Dockerfile, configcrawler.ini and GradeCrawler_headless.py into same directory
-
Navigate to that directory and build docker image (dot in the end for current path)
docker build --tag <image-name>:<tag> .
example:docker build --tag gradecrawler:01 .
-
Create + start container (= docker run)
docker run --name <container-name> <image-name>:<tag>
example:docker run --name gradecrawler gradecrawler:v0x
or with shell:docker run -it --name gradecrawler
-
Install Docker (process platform-dependent),
visit https://docs.docker.com/get-started/ -
Pull image from dockerhub
docker pull rosaloeffler/gradecrawler:confexample
-
Create + start container (= docker run)
docker run -it --name <container-name> <image-name>:<tag>
example:docker run -it --name gradecrawler
-
Connect after start to change config
Get the name of an existing containerdocker ps -a
Get a bash shell in a running containerdocker exec -it <container name> /bin/bash
Install nano in the container:sudo apt-get nano
Change credentials etc.sudo nano /code/configcrawler.ini
-
Restart container, to apply changed config
docker restart <container-name>
Roughly:
-
Copy GradeCrawler_headless.py and example_configcrawler.ini into the same directory
-
Customize settings and credentials in example_configcrawler.ini and rename file to configcrawler.ini
-
apt-get update
-
sudo apt install python3.7
-
sudo apt install python3-pip
-
pip3 install selenium
-
sudo apt-get install chromium-bsu
-
sudo apt-get install chromium-driver
-
Install python (tested with 3.7)
-
Install Chrome
-
Install python packages
pip install selenium
-
Get Chromedriver and unpack:
https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip
A., B.
Application should run in container after setup.
ℹ️ In case container stopped: start existing container
docker start <container-name>
or with shell: docker start <container-name> -ia
C., D.
Execute GradeCrawler_headless.py
ℹ️ To exit close terminal/cmd or press strg+c
ℹ️ Script creates data at first run, you can check grades in terminal or in the respective files
if -it
or -ia
switches where used when executing docker run
or docker start
, respectively.
Later the script sends notification mails if new grades are detected
As of August 2020, it has only been tested with gmail. Make sure that "less secure apps" are enabled
to access your gmail account.
docker restart
command.