Giter Club home page Giter Club logo

health-report-whut's Introduction

武汉理工大学健康填报自动化脚本(研究生版本)

该脚本是基于此项目进行的修改,由于研究生版本的健康填报请求的地址不同,因此使用fiddler进行抓包,然后对着代码进行修改即可。

微信小程序中填报的相关链接有四个:checkBindbindUserInfomonitorRegistercancelBind,查看fiddler修改请求头和体温记录,位置信息即可。

使用教程

注意使用前请先取消小程序的关联

首先需要在main.py修改为自己的账号和密码,地址和是否在校需要对应修改。与参考项目不同的是HeaderHostReferer有所区别,这里已经修改好了。

使用邮件提醒打卡结果:mail.py。这里需要开通邮箱的SMTP服务,会生成一个授权码,填上以后就可以接收提醒了。当然也可以不要mail.py,注释掉main中的代码,自己手动去看也可以。

运行需要安装python3,然后终端中执行下面命令pip安装包:

pip install requests
pip install yagmaill

安装完成后直接运行main.py即可

ios快捷指令

icloud分享链接,手机上使用safari打开,导入后修改成自己的登录账号(身份证或者学号),密码,如果要修改打开地点和是否在校可以更改monitorRegister的内容,如下图: 修改地址等信息

服务器部署

把脚本部署到宝塔面板上,首先上传文件到宝塔目录里,记录路径。由于之前宝塔安装的是python2.7,需要升级python版本。

注意这里遇到的坑,直接下载python3以上的版本解压编译,然后运行脚本会提示ssl no host的错误,原因在编译python时没有编译ssl模块.

解决方法:在编译python3前指定openssl的安装目录。

这里需要查看你服务器安装openssl没有,使用whereis openssl找到openssl的安装目录,一般在usr\local\openssl,没有的话可以先安装open ssl1.0.2以上的版本。仓库地址,上传到宝塔自定义目录,解压编译安装:

tar -xvf openssl-xxx.tar.gz
cd openssl-xxx
./config  no-shared -no-tests --prefix=/usr/local/openssl --openssldir=/usr/local

然后在解压的python3目录:../Python-3.6.4/Modules下修改setup文件,取消以下4行(6-9)的注释。SSL=/usr/local/openssl这里填上你自己的安装目录。

# Socket module helper for socket(2)
#_socket socketmodule.c

# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/openssl
_ssl _ssl.c \
	-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
	-L$(SSL)/lib -lssl -lcrypto

# The crypt module is now disabled by default because it breaks builds
# on many systems (where -lcrypt is needed), e.g. Linux (I believe).
#
# First, look at Setup.config; configure may have set this for you.

#_crypt _cryptmodule.c # -lcrypt	# crypt(3); needs -lcrypt on some systems

修改完成后编译安装python即可make && make install

接着设置python3为默认版本,可以参考这篇,修改完后,安装requestsyagmail包,然后在宝塔面板的定时任务上设置shell脚本如下,定时执行即可。

image-20220220095747102

health-report-whut's People

Contributors

happy2h avatar

Stargazers

 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.