University Timetable Proxy
Disclaimer: I don't own the website that this script connects to, nor am I responsible for discovering it. This may break or go away at any time. I only wrote this script for my own convenience.
This script, when configured, will save your Hull University timetable as an ical file on a regular basis to a specified location for use with Google Calendar.
I built this thing to be compatible with Google Calendar, so you can enter the URL that this program is running on into the "Add by URL" box on your Google Calendar.
Rewrite in progress!
- Grab the timetable as html
- Parse out the events from the html
- Output events as ical
- Create bash wrapper that calls node script reguarly and automatically to keept he ical file up-to-date
- Install Node.js if you haven't already.
- Clone this repository.
npm installin the root of the clone.
- Set the appropriate environment variables (see the environment variables section below)
node generate.jsfrom the root of the repository
||Optional. The filename to which the ical file should be saved. Default:
||Optional. The url at which sws can be accessed. Default: https://timetable.hull.ac.uk/|
||Required. Your network login username.|
||Required. Your network login password.|
timetable_downloader.sh can be used to automate the process of scraping your timetable. Here's a rough guide as to how I recommend setting it up:
# Run all the following commands as root # cd to the place you want to put the script cd /root; # Clone this repository git clone https://github.com/sbrl/university-timetable.git; # Install the dependencies npm install; # Copy the example settings file cp .timetable-settings.default .timetable-settings; # Set the permissions correctly chmod 0400 .timetable-settings; # Edit the settings file to suit nano .timetable-settings;
After executing the above, you should be ready for a test run. Try
sudo ./timetable_downloader.sh and see if it works! Once satisfied, set it up as a system service with your service manager (be that OpenRC, init.d, upstart, systemd, etc.).
This code is available under the Mozilla Public License, version 2.0. The full license text is available in the
LICENSE file in this repository.