Allocate+ Timetable Exporter

My place of study (University of Canterbury) recently invested in a new timetabling system to allocate all student classes [supposedly] with no clashes. While the allocation system itself has been a topic of interest, the web interface provided is a nightmare on its own.

Upon login you are presented with either an impossible to follow HTML view of your entire term compressed onto one page. The other alternative is a javascript based calendar which isn’t all too bad on a desktop… except that no-one wants to have to login to a desktop every time they are late for class and want to know where they should be!

So in my spare time I started reverse engineering the site and how it delivers content. The web interface makes function calls to the server with URLs, the server then responds and the content is rendered for the user to view. This is all done in the background so the user can’t see the calls being made. The important thing to remember is that the content is separate from the view, so if I could find a way to intercept this content before it was rendered into the javascript calendar or HTML timetable I could then present it however I wanted.

After looking at the javascript running on my browser to make the function call to the server I managed to find the required call to make to get the server to deliver me an XML of all my timetable events; success!

This was all done using python scripts due to the speed at which they can be written and the massive amount of libraries out there. Parsing the XML file using the ‘Beautiful Soup’ python library, I could then use the ‘icalendar’ python library to generate an .ics iCalendar file so my timetable could be imported to iCal or Google Calendar. These sync with both iPhone and Android calendars, so now my calendar is in my pocket at all times.

But it seemed a little redundant to do all this work and keep it to myself. The benefit of python is that Google loves it; the benefit of this is that Google also loves providing awesome free services. Google app engine is a platform to create and deploy web apps that are hosted on Google’s infrastructure. These are free up to a certain resource limit per day and can be written in python, java or Google’s proprietary language, Go.

All my existing python code could be reused and tweaked for deployment. I re-jigged a free CSS template I found online that allowed the site to be viewed nicely on a desktop, tablet or mobile device – something the original University of Canterbury site totally neglected. By entering your student credentials your timetable can be downloaded as an .ics file, and iOS 5 devices can load this directly into the native calendar! I’m still working on changing the interface to an AJAX one to make it seem faster and not hang on some browsers. Also I will work to add integration with Google’s calendar API, so that the events can be loaded straight to your Google calendar, which is ideal for Android devices.

For any University of Canterbury students who would like to use this, click here.

 

Advertisements