Course Catalog Search
Two-sentence description
Goodbye Google site-search, hello web-service powered University of Washington course catalog search! PHP, web services, and some jQuery sprinkled in for good measure produced a much-improved search tool for the UW’s student population.
Background
For years, the University of Washington provided an online course catalog consisting of a maze of HTML pages. How best to provide a search tool? Why, Google’s free site search, of course. And it works… but not ideally. It’s problem is that it applies Google’s algorithm to the entire set of pages within the scope of the search, and those results are not often the best results for students looking for classes. Happily, I realized that the UW’s then-recently launched web services initiative (put in place to support the launch of the UW’s iPhone app) could provide a data source upon which I could build a better course catalog search. The serendipity effect of making data publicly available!
Because not all the information contained within the course catalog (such as instructor course descriptions) is available via web services or other programmatic sources, the UW must currently offer both search options, with my web-service based option bearing a “beta” tag for the time being.
Skills and technologies
This tool was created largely in PHP, as that is the server-side technology I used to write classes to interact with the UW’s Student Web Services (SWS). I extended existing cURL classes to retrieve payloads in XHTML format, parse them, and return arrays of data to the page. The SWS provides many resources, and the course catalog search queried three of them (course, curriculum, and term) in order to provide a search form that returned a list of courses matching the student’s criteria.
On the client side, I wanted a search form that matched what the tool’s audience had become accustomed to: simple search forms in the vein of Google or Amazon. So I crafted a form showing only a single search field, with more advanced options hidden away. This project also offered me my first opportunity to write some jQuery javascript code. Initially it was just to hide or show the advanced search features but once I’d seen the powerful features it had, I had to play around with it more. That’s how I was able to provide additional course information without increasing page load times with additional calls to the SWS. Instead of making that call for each matching course, I wrapped each class title in a link to another SWS resource and used jQuery to intercept clicks on those links and load the resulting info via AJAX (and display that info with a little animated polish!).
Another tool I integrated into this project was a user-feedback mechanism. There are a number available, but I chose Kampyle because it was free and integrated simply with a few lines of javascript. As this tool was available to all the UW student population, there was a lot of feedback: hundreds in the first few weeks and tapering off to about a dozen a week. Most were feature requests (and I’m proud to say I was able to implement some of them), though a few were legitimate bugs that slipped through my testing.
Take aways
This project, though relatively simple on its front, taught me three important things:
- jQuery is powerful and flexible—its difficult to imagine writing a web app (even a simple one) without it;
- Web services are the “next big thing” in how they provide developers data without cumbersome accounts, database connections, or other stumbling blocks: just point at the URI and get the data; and
- Providing an easy method for users to offer feedback is a very valuable resource as a developer, and after having tried it I am definitely a proponent.



