Giter Site home page Giter Site logo

auto-report's Introduction

auto-report

Auto daily report for HITSZ Students.

Usage

Report Once

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

Daily Auto Report

Crontab

  1. You need a server.
  2. Adjust your local timezone.
    timedatectl set-timezone "Asia/Shanghai"
  3. 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

  1. Fork this repository from here.

  2. Add the repository secrets STUDENTID, PASSWORD and EMAIL in your own repository's Settings-Secrets, which also can be found by Settings-> Secrets -> New repository secret. (Repository secrets are invisible for others.)

  3. 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.

License

auto-report is licensed by an MIT license as can be found in the LICENSE file.

auto-report's People

Contributors

rocketeerli 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.