Skip to content

PRO-2684/ucas-iclass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ucas-iclass

GitHub License GitHub Workflow Status GitHub Release GitHub Downloads (all assets, all releases) Crates.io Version Crates.io Total Downloads docs.rs

Warning

This repository is for learning purposes only. Use at your own risk.

iClass API for UCAS. Should also work for other schools, but not guaranteed.

📥 Installation

Using binstall

cargo binstall ucas-iclass

Downloading from Releases

Navigate to the Releases page and download respective binary for your platform. Make sure to give it execute permissions.

Compiling from Source

cargo install ucas-iclass

📖 Usage

  • 🔑 Login: Login to iClass and save session to a file.

    ucas-iclass login <username> <password> [-s <session-file>]
  • 📖 Courses: List courses in current semester.

    ucas-iclass courses [-s <session-file>]
  • 📃 Schedule: Get schedule for a specific date or week, defaulting to today.

    ucas-iclass schedule [-d <date>] [-w] [-s <session-file>]
  • ✅ Checkin: Check-in for a specific schedule by id or uuid, defaulting to current schedule if any.

    ucas-iclass checkin [<id_or_uuid>] [-t <timestamp-or-offset>] [-s <session-file>]

🤔 Common Problems

Error: API error: 二维码已失效!

This is likely because:

  • The iClass system's clock is far ahead, or
  • Your system's clock is far behind.

Thus, timestamp calculated from your system will be treated as outdated by the iClass system, Fortunately, you can fix this by increasing the timestamp offset to an appropriate value, like $+30000$:

ucas-iclass checkin -t +30000

☑️ TODO

  • Customize api root for cli.
  • Checkin: Default to current schedule if no id_or_uuid provided.

🎉 Credits

About

iClass API for UCAS.

Topics

Resources

License

Stars

Watchers

Forks

Contributors