The API to NUS IVLE, called LAPI, has been around for some time. Below is a demonstration of how one can retrieve an AuthToken:
You might have noticed that awk was used to extract the value attribute from the input element for __VIEWSTATE!
If you can find a shorter curl ...