rockym93 dot net

archive · tags · feed

The Inverse Timetable Project

25 July 201103:59AMcode

I've had this idea sitting in the back of my head for a while now, and I thought this is a pretty good time to act on it considering that second semester is coming up soon.

The Problem: The problem with uni is that there's no set times when everyone's free. You end up spending a lot of time phoning and texting the same people over and over just to figure out who's free, which is not good for your phone bill. Eventually you figure out what times are good for everyone, and then suddenly everything changes the next semester.

The Solution: A couple of solutions to this have been chucked around. We tried an IRC channel, but only about 3 people know how to use it. What I think we need is a centralised list of the times which people are free. Either that, or walkie-talkies, but this way's cheaper, and means I get to muck around with Python again. So that's what I've been doing for the last couple of days.

The idea is that you look at your timetable, and find the parts where you're free between classes (and optionally, after you've finished but are cool with staying around for a while anyway), make a list of those times, and then, using this hideously complex web form (complex to write, that is- it's pretty easy to actually use) you store it on a centralised list. Like so:

Now, I could just have used a Google Calendar, and made it publicly available, and then uploaded the iCal files generated by the OLCR system. Which would've required significantly less programming, and is about as easy to understand. But I did it this way, so there.

I've tested it on Firefox, Chrome, Internet Exploder, as well as the iPhone browser and my phone's web browser. It works perfectly on all of them (it's just plain HTML, there's no reason it shouldn't), and is actually nicer on touch screens cause you can poke the little check boxes. So everyone can use it. The real question is if anyone will.

If anyone's interested, here's some technical stuff. It's written in Python, and uses the built-in CGI module to pull data from the webserver. The display page is a python file, the data input page is a plain HTML file (getting Python to print a form that complex would've been hellish, and it's not necssary.) which sends its data through an HTTP POST to a second Python script. I was going to use an SQL database to store all the stuff, but I realised that was a) really hard, and b) overkill for something probably nobody will ever use. So it uses the filesystem- every day is a folder, and each time is a file, and in each of those files is a list of people who are free on that time. Then, to print it, I just read each of those files straight into the HTML table, and print the results. I thought Python might be hard to use for this kind of thing, but it's actually really simple- all the form data is just stored in a dictionary-like object and you just pull out the data you need.

For the next version, if there is a next version, I'm going to add colours to the tags - although that might need a pretty big rewrite of some of the internals, so it might have to wait for next time I'm procrastinating. Maybe at the same time I'll separate the data by user, to enable editing of the timetable once it's up, instead of just adding. We'll see.

If you want to look at the source code (and trust me, you probably don't- it's a real mess), you can find that here:

.zip / .tar.gz

Oh yeah, the address. I'm not going to post it here, since this is on the public internet and I don't want the timetable flooded with spam because at the moment the only way to clean it out is to delete all the data and start again. Derp. But it's easy enough to remember, and I'll probably send an email to some people to test it out once my server restarts.

So yeah. That's what I've been doing for the last couple of days.

read the comments

< On Potter. Bringing Sexy (Words) Back >