Auto daily report for HITSZ Students.
Golang
go run main.go -u your-studentID -p your-password -e your-email
Docker
docker run --rm rocketeerli/auto-report -u your-studentID -p your-password -e your-email
Crontab
- You need a server.
- Adjust your local timezone.
timedatectl set-timezone "Asia/Shanghai"
- Use
crontab -e
and append the following line:15 8 * * * curl -L -o /tmp/auto-report https://github.com/hstable/auto-report/releases/latest/download/auto-report_linux_amd64 && chmod +x /tmp/auto-report && /tmp/auto-report -u your-studentID -p your-password -e your-email
By default, this program will run at 8:15 a.m. everyday.
Github Action
-
Fork this repository from here.
-
Add the repository secrets
STUDENTID
,PASSWORD
andEMAIL
in your own repository's Settings-Secrets, which also can be found bySettings
->Secrets
->New repository secret
. (Repository secrets are invisible for others.) -
Add
report.yml
file to.github/workflows
, and write the following content to this file:name: Auto Report on: schedule: - cron: "15 0 * * *" push: branches: [main] jobs: report: name: auto report runs-on: ubuntu-latest steps: - name: Build run: | curl -L -o auto-report https://github.com/hstable/auto-report/releases/latest/download/auto-report_linux_amd64 chmod +x auto-report - name: Run env: STUDENTID: ${{ secrets.STUDENTID }} PASSWORD: ${{ secrets.PASSWORD }} EMAIL: ${{ secrets.EMAIL }} run: | if [[ -z $EMAIL ]] then ./auto-report -u $STUDENTID -p $PASSWORD else ./auto-report -u $STUDENTID -p $PASSWORD -e $EMAIL fi
The time cron above is an UTC time, which is 8 hours slower than Beijing time zone.
By default, this program will run at 8:15 a.m. everyday.
auto-report is licensed by an MIT license as can be found in the LICENSE file.