Term-Khor is an automated Bash script designed to assist Sharif University students in the stressful course selection process by interfacing with the university’s API. Let Term-Khor handle course registration for you, so you can sit back and relax! 😎
- ⚙️ Automated Course Selection: Automatically register for courses at a precise time with multiple retry attempts.
- ⏰ Customizable Timings: Set your own start and end times for the registration process.
- 🔒 JWT or Credentials Authentication: Secure access via your university token or use your Student ID and password for dynamic token generation.
- 📚 Multi-course Support: Register for multiple courses and corresponding units in one go.
- 🛑 Graceful Shutdown: Exit the script smoothly using
CTRL+C
without losing progress or leaving tasks incomplete.
Make sure the following tools are installed on your system:
- gdate (GNU date)
- curl
You can install them using the following commands:
# On macOS
brew install coreutils
brew install curl
# On Ubuntu/Debian
sudo apt-get install curl
Also, ensure Python 3 is installed if you're using Student ID and password for authentication.
Run the script with either a JWT token or your Student ID and password:
./select_course.sh -t <token> -c <course1,course2,...> -u <unit1,unit2,...> [-s <start_time>] [-e <end_time>]
./select_course.sh -i <student_id> -p <password> -c <course1,course2,...> -u <unit1,unit2,...> [-s <start_time>] [-e <end_time>]
-t <token>
: Your JWT token for authentication (required if not using student ID/password).-i <student_id>
: Your student ID for authentication (required if not using token).-p <password>
: Your password for authentication (required if not using token).-c <course1,course2,...>
: Comma-separated list ofcourseID-groupID
s (required). Example:-c 40455-1,40103-2
.-u <unit1,unit2,...>
: Comma-separated list of units corresponding to each course (required). Example:-u 3,1
.-s <start_time>
: Start time for course registration inHH:MM
format (default:08:00
).-e <end_time>
: End time for course registration inHH:MM
format (optional).
Using a JWT token:
./select_course.sh -t eyJhbGciOiJIUzI1... -c 40455-1,40103-2 -u 3,1 -s 08:00 -e 10:00
Using Student ID and password:
./select_course.sh -i 981234567 -p mypassword -c 40455-1,40103-2 -u 3,1 -s 08:00 -e 10:00
- The number of courses (
-c
) should match the number of units (-u
). - The script retries course registration every 50 milliseconds. You can adjust this delay in the script.
- You can safely stop the script at any time by pressing
CTRL+C
.
- ⏳ Wait Until Start Time: The script waits until the specified start time before beginning the registration process.
- 📜 Course Registration: The script continuously sends registration requests for your selected courses until either the registration is successful or the end time is reached.
- 🔧 Graceful Exit: If interrupted, the script will clean up all background processes and exit smoothly.
- gdate: Required for handling precise time operations in the script.
- cURL: Utilized for sending HTTP POST requests to the university's API for course registration.
- Python 3: Needed if you're using your Student ID and password for dynamic JWT token retrieval.
This project is licensed under the MIT License. Feel free to use, modify, and share!