Git Product home page Git Product logo

hdu-xkl's Introduction

English | 中文

XKL

Full access to skl, mainly used for class checkin and daily health check in.

Attention

This repository is created for technical discussion, any kind of modification is strongly forbidden.

IF YOU TRIED TO DEVELOP ANY ILLIEGAL OR UNAUTHORIZED TOOL BASED ON THIS REPOSITORY, PLEASE BE RESPONSIBLE FOR YOUR OWN BEHAVIOR.

Introduction

This respository could be helpful to obtain access to skl system, including Personal Info, Class Check In, Course List, Daily health check in and etc.

How to use

1 Install modules from requirements

Make sure all the modules required are installed before running the code.

Execute the code bellow:

pip install -r requirements.txt

2 Class check in [API]

2.1 run the demo.py file

demo.py

myCheck = Check()               # create a `Check` Object
myCheck.getUserinfo()           # get UserInfo
myCheck.getCourse("2022-05-11") # get user's CourseList by date
myCheck.check()                 # class check

3 Auto health check in

3.1 Environment advices

Deploying XKL to ECS is not recommended, because the IP address of your ECS could be detected and banned by the school's server.

Creating a cron task on a stable facility using educational network (like dormitory WiFi and i-HDU) is the best choice if you own some devices like Smart phones, Raspberry Pi, NVIDIA Jetson, Laptop and etc.

3.2 ECS or Local Terminal(Android Termux 、Linux)Detailed Tutorial for the Deployment in Android System

  • First, use Vim/Nano to edit XKL/src/task.sh manually:

    • workdir is the full path of XKL/src. e.g. /home/ubuntu/XKL/src. ATTENTION: this path doesn't need to be ended up with /
    • thisPython is the full path of the Python interpreter in your system, please use the path of Python3. It's full path will be obtained by executing command $which python3 in Linux systems. The output could be like /usr/bin/python3
    • thisPythonPATH is the full path of Python's dependencies, and it tends to be /usr/lib/python3/dist-package
  • Then, create a task with cron:

crontab -e

# The first `five` params mean `minute`, `hour`, `day`, `month`, `week`, and `*` means no limitation. The code below shows an example of executing command at 05:20 on everyday
20 05 * * * bash /home/XKL/src/task.sh

# Launch the cron service. 
# (Under Ubuntu, cron service is `cron`, while in the other Linux distributions, it usually tends to be `crond`.)
service cron start

# [Extra]
# Please restart the cron service after modifying the task's content
service cron restart

# [Extra]
# `systemctl` could be used to manage the system services in some lastest Linux releases
# Launch cron service
systemctl start cron
# Restart cron service
systemctl restart cron

4 In addition

Both of your account and password are required in your first login, and in the next they'll be optional. ( Don't worry, the token will be updated by code automatically.)

👋 (Look at here)

The file below DO NOT need to be edited manually. (If you use this repository just for health check in, you could fill in the User Node and step over 4 Inaddition.)

config.ymal:

User:
  id:       # Your UserID (HDU-CAS)
  pwd:      # Your LoginPassword

params:     # This node is not allowed to edit.
  X-Auth-Token: 
  XAT_updateTime:

ATTENTION

  • DO NOT USE PROXY!

  • DO NOT USE PROXY!

  • DO NOT USE PROXY!

Otherwise, errors could be triggerred like (Caused by ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory')))

hdu-xkl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.