Coder Social home page Coder Social logo

shu-selfreport's Introduction

上海大学健康之路每日一报/每日两报自动打卡

适配2021-4-24版,暂不支持党史知识天天学

程序为python脚本文件,修改配置文件相关信息,设置后台运行脚本,脚本会根据配置文件信息自动进行每日一报/每日两报。

支持github actions服务器。

支持一键补报功能。

支持每日一报/每日两报。目前暂时在早上4点自动填报一次。

为了避免过多的配置,感谢@Lanszhang131的思路,利用前一天的报送信息进行填报,所以如果你真实地提交过一次,那每天会重复填报。由于默认是早4填报,所以如果你想用真实信息的话第一次在早上4点填报后修改下信息。

免责申明

本项目仅做免费的学术交流使用。

用法

0. ⭐Star⭐项目😉

如果你想获取最新的更新,记得右上角的watch

1. 你有服务器,只在自己服务器上进行自动打卡

config.yaml 中设置所有需要打卡的学号密码

本程序自带一键补报功能,如需补报,定位到 main.py 第14行

NEED_BEFORE = False  # 如需补报则置为True,否则False
START_DT = dt.datetime(2020, 11, 10)  # 需要补报的起始日期

针对Ubuntu,编辑定时执行程序cron

crontab -e

加入以下命令:

# 程序每天4点执行一次,并将结果输出至shu_report.log
# 注意python的路径,main.py与输出日志shu_report.log的绝对路径
0 4 * * * python -u /xxx/main.py 2>&1 >> /xxx/shu_report.log

如果你服务器是UTC时区,则为

0 20 * * * python -u /xxx/main.py 2>&1 >> /xxx/shu_report.log

如果你不确定你服务器的时区,也可以每小时运行一次:

0 * * * * python -u /xxx/main.py 2>&1 >> /xxx/shu_report.log

2. 你没有服务器,使用 github actions(推荐)

在该模式下请不要开启补报功能

你第一次Fork

  1. fork 该仓库至你的仓库下
  2. 定位到你的仓库的SettingsSecrets选项卡
  3. 添加secret(New repository secret)

NAME 设置为 USERS

VALUE 设置为 学号1,密码1;学号2,密码2 的格式,注意逗号与分号的区分,学号密码之间用逗号,每两个学号之间用分号,必须是英文半角符号,如果只有一个学号密码则不需要加分号

  1. 定位到你仓库下的 Actions 选项卡,点击 Enable workflow

  1. 此时Actions 已经启动完成,每天上午七点(UTC+8)执行一次,每执行一次会在 Actions 选项卡下生成一个报告。

    如果需要对报送功能进行测试,可以点击 run workflow 按钮,立即进行一次运行。

你第二次Fork,要更新原先内容

或者最简单的方法, 删除你fork的项目,重新fork

依赖

  • python3
  • 依赖:
    • pyyaml
    • beautifulsoup4
    • requests

感谢

感谢各位 contributors 所做的贡献。

shu-selfreport's People

Contributors

amluckydave avatar bluefisher avatar jeremy-hibiki avatar lemon-412 avatar lonelyion avatar panghaibin avatar stepneverstop avatar syyani avatar xxf0512 avatar zhangrui-wolf 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.