A Node.js script to re-emit your Hull University Timetable as an ical calendar.
Switch branches/tags
Nothing to show
Clone or download
sbrl Update scraper & parser for new semester.
A further update will be required in ~mid-December-early-January time.

If I don't do said update, feel free to open an issue / pull request!
Latest commit 16c0f50 Sep 18, 2018
Permalink
Failed to load latest commit information.
.gitignore
.timetable-settings.default Create settings file and executing as another user support Sep 13, 2017
LICENSE Initial commit Nov 23, 2015
README.md
generate.js
package-lock.json Update npm packages Sep 18, 2018
package.json
timetable_convert.js Create timetable html parser Sep 13, 2017
timetable_downloader.sh Use sudo & preserve environment when running the generator Sep 14, 2017
timetable_parser.js Update scraper & parser for new semester. Sep 18, 2018

README.md

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

Technologies used:

Getting Started

  1. Install Node.js if you haven't already.
  2. Clone this repository.
  3. Run npm install in the root of the clone.
  4. Set the appropriate environment variables (see the environment variables section below)
  5. Run node generate.js from the root of the repository

Environment Variables

Variable Meaning
SBRL_OUTPUT_FILENAME Optional. The filename to which the ical file should be saved. Default: timetable.ical in the current directory.
SWS_ROOT_URL Optional. The url at which sws can be accessed. Default: https://timetable.hull.ac.uk/
SWS_USERNAME Required. Your network login username.
SWS_PASSWORD Required. Your network login password.

Automation

The script 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.).

License

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.