Unofficial CORS API by NUS Hackers

National University of Singapore Unofficial CORS API

This is an unofficial CORS API, built on the side in a couple of days during the 2011 December holidays. Source code is available on Github. API details follow (documentation on the code itself is found on the Github page).

There are two reasons for doing this: in the best case, we intend to ask the CORS team in NUS to implement a RESTful API (and we don't mind doing it for them - if anything, this project shows that the easy bit is the design and implementation of the API; the hard bit is in the scraping and parsing of data).

Should this approach fail, the NUS Hackers will host and maintain this API for as long as is needed.

If the second scenario comes to pass, please submit bug reports, feature requests, or pull requests on Github. We're doing this because we think it's good for student developers in NUS. If you're into things like this; you find programming fun, or you want to write software for the betterment of society, come join us at nushackers.org

Note: This project is built on Python, MongoDB, Flask and Scrapy. Instructions on how to fork and roll your own may be found in the readme over at github.

API Details

All API access is over HTTP, and is accessed from the api.nushackers.org domain. All data is received as JSON.

GET /modules

Returns a list of all the modules. An example:

Note that it returns a list of dictionaries, each dictionary representing a module.

To perform a regex search:

GET /modules/search/:regex

Returns a list of modules that matches the appended regex. So for instance /modules/search/CS would return all the CS-prefix modules. And running modules/search/IS4 would return all the IS level 4 modules.

GET /module/:modulecode

Returns the details for just that module code, as follows:

Note that occurences are a list of numbers representing weeks in the semester. Most modules have classes every week, but some don't. For instance, odd weeks and even weeks are represented with [1,3,5,7,9,11,13] and [2,4,6,8,10,12] respectively.

Day represents the days of the week, with Monday being 1 and Sunday being 7.

GET /timetable/:modulecode

Returns the lecture and tutorial timetables for the module code, like so:



Built by an army of crazy IT buggers.