An open API service indexing awesome lists of open source software.

https://github.com/v4lli/zpa2ics

Convert HM FK07 timetables to iCalendar feeds
https://github.com/v4lli/zpa2ics

Last synced: about 1 year ago
JSON representation

Convert HM FK07 timetables to iCalendar feeds

Awesome Lists containing this project

README

          

# zpa2ical scraper

Scrapes the new [HM FK07](http://www.cs.hm.edu/) ZPA system and converts
the personalized weekly time table to an iCalendar feed file. iCal
feeds are compatible with almost all calendar systems (including Gmail)
as well as most calendar apps.

![Calendar view example](/ical.png)

## Requirements

* python3 (tested with 3.5)
* BeautifulSoup4 (`pip install BeautifulSoup4`)
* icalendar (`pip install icalendar`)
* requests (`pip install requests`)

# Usage
Put your login credentials into a text file, separated by a colon
(htaccess-style). Pass the path to this file as the first parameter to
zpa2ics.py.

Example credential file:

ifw1234:foobar

Example call which scrapes all weeks from WS16/17:

$ ./zpa2ics.py ~/.zpa_login.conf /var/www/stundenplan.ics 04.10.2016 01.02.2017

It's probably a good idea to add zpa2ics.py to crontab and re-fetch it e.g. daily:

@daily chronic /home/valentin/zpa2/zpa2ics.py ...

## Note
This is a quick-and-dirty implementation. The code might look rather adventurous.

The code currently does not verify the (invalid) ZPA certificate. Only use
on trusted networks!

## TODO
- certificate pinning
- convert date strings to objects
- error handling
- cache all weeks but the current one
- don't re-fetch past weeks
- log out when finished?