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
- Host: GitHub
- URL: https://github.com/v4lli/zpa2ics
- Owner: v4lli
- License: bsd-2-clause
- Created: 2016-11-22T00:15:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-06T10:00:55.000Z (over 9 years ago)
- Last Synced: 2025-03-13T13:44:47.733Z (over 1 year ago)
- Language: Python
- Size: 207 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.

## 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?