Jamie Wong

Mechanize and UWAce Downloader

Posted on November 17, 2010

A while ago I made something in php that would let you download things form UW-Ace (the University of Waterloo’s course management system) from the command-line. Michael Chang had the excellent idea of making something that would simply download everything available to you from Ace so you could have a local copy of everything.

His solution was an extension of my php solution.

Because I wanted to make the product easier to distribute and because I wanted to make use of Mechanize, I rewrote the solution in ruby and packaged it as a gem.

UWAce Downloader

The new version looks like this:

To get it running, you’ll need a copy of RubyGems, which you can get here: Download RubyGems. It’s a simple package management and distribution system for ruby, which is used by more or less every ruby project you can think of.

Once you have that set up, just run

sudo gem install uwace

Wait for it to finish installing, then run

uwace

Which will prompt you for a username and password.
Of course, I wouldn’t release anything that asks for your password without releasing source, so here it is:

Mechanize

This version of the downloader is written in ruby with the aid of Mechanize for ruby.
Mechanize is a set of tools for automating webpage interactions and retrieving data. It can identify links and forms on a page, fill them in, submit them and grab any data you want. Perfect for this task.