Skip to main content

Library to check if courses are available.

Project description

Course Watcher Module for ILIAS

This README is outdated...

This is an unoffial Application. It is not associated with the ILIAS project.

This library let's you query your ILIAS instance in some specific ways described in the task types section.

Usage

Because I hate argparse, getopt and the likes and because a command might get pretty complicated otherwise, you only need to specify exactly one argument:

The path of the [config file]{#configuration}. Alternatively - can be specified to read the config file from stdin.

# Setup needed before!
./icw config.json

This programm does not (yet?) have any daemon capabilities. It conceived to be run regularly by another tool such as cron or systemd timers.

Example configurations are provided in ilias-course-watcher.service + ilias-course-watcher.timer and ilias-course-watcher.crontab.

Setup

pypi.org (Recommended)

pip install --user ilias-course-watcher

Manual

# Install poetry using your package manager and then run:
poetry install
poetry build
pip install --user dist/*.tar.gz
# This will install all needed dependencies in a virtual environment
#
### You could also install the dependencies specified in the
### pyproject.toml yourself (maybe also in a virtual environment)
### and run CourseWatcher.py directly. There's no need to use poetry.

Systemd timer

./install-systemd-user-config.sh

Configuration

The configuration is specified in JSON format. A template can be found in template-config.json.

Always specified need to be the fields:

  • "Domain": string
  • "Username": string
  • "Password": string
  • "Tasks": list of tasks
{
	"Domain": "https://www.studon.fau.de",
	"Username": "my-username",
	"Password": "my-password",
	"Tasks": [
		... See Task Types ...
	]
}

Task Types

There are 3 different task types serving each a different function.

Search Entry (search_entry)

A category search searches in a given Category page for entries containing the given search string (case-insensitive).

{
	"type": "search_entry",
	"search_object": "crs123456",
	"search_string": "WS 2023",
	"success_command": "notify-send"
}

The search_object can optionally include a .html-suffix.

The success_command is executed if the search_string was found in the title of one of the entries of the specified category, course or fold.

Search Update (search_update)

An update search remembers the contents of a category, course or fold page (if the search has been run before) and compares them to the current contents.

A history of past contents is saved in the cached files.

A cache directory can optionally be specified. By default the XDG Cache Directory is used (~/.cache/ilias-course-watcher by default).

{
	"type": "search_update",
	"search_object": "fold123456.html",
	"cache_dir": "~/.ilias-course-watcher",
	"success_command": "command ls -1 -c ~/.ilias-course-watcher/fold123456.icw* | head -n 2 | tac | xargs diff"
}

The success_command is executed if an update has been detected. The command pipeline in the example above prints the name of the files containing the up-to-date contents and the previous contents respectively. This output is then piped to xargs, which in turn then runs diff providing these two files as parameters. Other possible may include sending emails for example.

Queue Availability (queue)

The queue task is not yet implemented. It should in the future monitor a queue to a course, running the success command if the course is open for sign-up and maybe even try to sign up by itself.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iliascw-0.2.0.tar.gz (21.2 kB view hashes)

Uploaded Source

Built Distribution

iliascw-0.2.0-py3-none-any.whl (20.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page