A scripting tool to automatically enroll on UCSD WebReg.
Note: These instructions are for Python 3, for Python 2, check here
- Python 3.x (get it here)
- Libraries
mechanize
andcookiejar
- Download or clone the project
- Install the project dependencies (see below)
- Install
cookiejar
with:
pip3 install cookiejar
- You may have to use
sudo pip3 install
- Mechanize has not been officially updated for Python 3, so install adevore's working fork locally as shown below:
- Go to the adevore's mechanize repository page and select
Download as ZIP
- Move the folder
mechanize
(containing__init__.py
) inside the unzippedmechanize-python3
folder you just downloaded into the project directory (enrollment-bot/
)
- Download the cookiejar.py file here and move it to the project directory
Modify PID
, PASS
and SECTION_IDS
in settings.py
to be your PID, password and a list of valid section IDs from WebReg
# Authentication Settings
PID = 'A12345678' # change this to your PID
PASS = 'ilovepugs5' # change this to your SSO password
# Enrollment Options
SECTION_IDS = ['843721','939283','422304'] # change these to the section IDs you want to add
- To execute the script directly, simply run
python3 regbot.py
from the project directory - If you would like to have the script execute at a certain time, you can use the Unix utility
at
. - For example, the following will run enrollment-bot at 9PM today, or tomorrow if it is already past 9PM:
# Run this from the project directory!
echo "python3 regbot.py" | at 2100
- For more information on how to use
at
, visit this website
Your computer needs to be on at the given time for at
to run enrollment-bot. Instead, use at
on a server you know will be running at when your enrollment time starts.
Running on ieng6.ucsd.edu:
- ieng6 has Python 2 installed by default, so use the installation instructions given here
- ieng6 will automatically send you the output of your job via email, so check your email to see the terminal output
- A copy of the terminal/debug output will also be saved to
log.log
in the project directory
Feel free to help out by picking up one of the tasks from the to-do list at the bottom
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
Distributed under the MIT license.
- For educational purposes only: I do not condone the use of this script on actual university services
- Use at your own risk!
Built-in SMTP mailer to send status update on completion / failurerunning withat
will send you mail to your ieng6 account- Clean error handling code
- Move authentication to command-line args from settings file