Used to record WKU's utility bills on a regular basis.

Overview

WKU水电费小助手

一个用于定期记录WKU水电费的脚本

Looking for English Readme?

背景

由于WKU校园内的水电账单系统时常存在扣费延迟的现象,而补扣的费用缺乏令人信服的证明。不少学生为费用摸不着头脑,但也没有申诉的依据。为了更好地掌握水电费使用情况,留下一手证据,我开源了这个自动化脚本。配合定时任务,它可以根据设定的时间间隔,自动查询当前的剩余的水电费情况,并形成记录。

安装以及部署

步骤#1: 捕获必要的验证信息

在获取水电费数据过程中,Cookie是通过身份认证的必要元素。为了抓取用于认证的数据包,我从微信公众号 ”温州肯恩大学校园卡 “下的“一卡通充值”服务入手。

提示:在本篇教程中,我使用Fiddler作为抓包工具。

步骤#1.1: 启用对HTTPS流量的捕获功能

由于我们获取Cookie所需的参数是通过HTTPS通信的,所以我们必须确保在开始之前,抓包软件已经启用了这个功能。

fiddler_https

步骤#1.2: 抓取微信公众号下H5网页的HTTPS请求

在抓包软件开始正常抓包后,我们打开微信公众号 ”温州肯恩大学校园卡 “并依次点击 "校园服务"、"一卡通充值"、"缴水费"。

步骤#1.3: 获得验证数据

最后一步! 我们从抓包软件中找到请求头为 "POST /app/login/getThirdUserAuthorize HTTP/1.1"的请求。在文本视图中复制ymTokenymUserId备用。

fiddler_data

提示:如果文本包含特殊符号,你需要将其转换为ASCII码。例如,"="需要转换为"%3D"。

步骤#2:安装Python脚本的依赖包

这个项目使用了Python3以及相关的依赖包,请确保你已经安装了它们。

pip install -r requirements.txt

步骤#3: 获取你寝室的areaCode

步骤#3.1: 填入验证数据

还记得我们在第一步获取的ymTokenymUserId嘛?将它们复制到我所提供的两个脚本中。

example_ym

步骤#3.2: 执行firstRun.py

在firstRun脚本中,你需要按照提示依次选择所属楼栋、所在楼层以及寝室号。

python firstRun.py

Step#3.3: 获取areaCode

复制脚本提供的areaCode,以便之后部署水电费记录机器人。

example_firstRun

提示:如果显示的水电费与微信公众号不一样,请通过问题板块告诉我(或者见面告诉我)

第4步:部署水电费记录机器人

步骤#4.1: 执行logRobot.py

python logRobot.py "your_area_code"

example_logRobot

提示:areaCode参数需要用引号括起来,否则记录机器人会报错。

执行后,在当前目录下会产生一个以areaCode为名称的txt文件。时间和对应的水电费会被记录在其中。

example_logFile

步骤#4.2: 将机器人部署在你想要部署的地方

该脚本目前部署在我的私人NAS上,并通过crontab定期进行记录。下面是我设置的crontab任务。

0 */4 * * * cd /data/fee && /usr/bin/python3 logRobot.py [areaCode]

拓展

这个脚本在轻量改写后可以在钉钉中实现缴费预警的功能。代码会在以后公布(可能会吧 老鸽子了orz)

example_dingReport

This repository is maintained for the scientific paper tittled " Study of keyword extraction techniques for Electric Double Layer Capacitor domain using text similarity indexes: An experimental analysis "

kwd-extraction-study This repository is maintained for the scientific paper tittled " Study of keyword extraction techniques for Electric Double Layer

ping 543f 1 Dec 05, 2022
Cupytorch - A small framework mimics PyTorch using CuPy or NumPy

CuPyTorch CuPyTorch是一个小型PyTorch,名字来源于: 不同于已有的几个使用NumPy实现PyTorch的开源项目,本项目通过CuPy支持

Xingkai Yu 23 Aug 17, 2022
EMNLP 2021 Findings' paper, SCICAP: Generating Captions for Scientific Figures

SCICAP: Scientific Figures Dataset This is the Github repo of the EMNLP 2021 Findings' paper, SCICAP: Generating Captions for Scientific Figures (Hsu

Edward 26 Nov 21, 2022
OpenVINO黑客松比赛项目

Window_Guard OpenVINO黑客松比赛项目 英文名称:Window_Guard 中文名称:窗口卫士 硬件 树莓派4B 8G版本 一个磁石开关 USB摄像头(MP4视频文件也可以) 软件(库) OpenVINO RPi 使用方法 本项目使用的OPenVINO是是2021.3版本,并使用了

Tango 6 Jul 04, 2021
Active Offline Policy Selection With Python

Active Offline Policy Selection This is supporting example code for NeurIPS 2021 paper Active Offline Policy Selection by Ksenia Konyushkova*, Yutian

DeepMind 27 Oct 15, 2022
The project covers common metrics for super-resolution performance evaluation.

Super-Resolution Performance Evaluation Code The project covers common metrics for super-resolution performance evaluation. Metrics support The script

xmy 10 Aug 03, 2022
Our solution for SSN Invente 2021's Hackathon

Our solution for SSN Invente 2021's Hackathon. To help maitain godowns in a pristine and safe condition using raspberry pi.

1 Jan 12, 2022
An implementation of the WHATWG URL Standard in JavaScript

whatwg-url whatwg-url is a full implementation of the WHATWG URL Standard. It can be used standalone, but it also exposes a lot of the internal algori

314 Dec 28, 2022
catch-22: CAnonical Time-series CHaracteristics

catch22 - CAnonical Time-series CHaracteristics About catch22 is a collection of 22 time-series features coded in C that can be run from Python, R, Ma

Carl H Lubba 229 Oct 21, 2022
ROMP: Monocular, One-stage, Regression of Multiple 3D People, ICCV21

Monocular, One-stage, Regression of Multiple 3D People ROMP, accepted by ICCV 2021, is a concise one-stage network for multi-person 3D mesh recovery f

Yu Sun 937 Jan 04, 2023
PyTorch implementation of TSception V2 using DEAP dataset

TSception This is the PyTorch implementation of TSception V2 using DEAP dataset in our paper: Yi Ding, Neethu Robinson, Su Zhang, Qiuhao Zeng, Cuntai

Yi Ding 27 Dec 15, 2022
Jigsaw Rate Severity of Toxic Comments

Jigsaw Rate Severity of Toxic Comments

Guanshuo Xu 66 Nov 30, 2022
공공장소에서 눈만 돌리면 CCTV가 보인다는 말이 과언이 아닐 정도로 CCTV가 우리 생활에 깊숙이 자리 잡았습니다.

ObsCare_Main 소개 공공장소에서 눈만 돌리면 CCTV가 보인다는 말이 과언이 아닐 정도로 CCTV가 우리 생활에 깊숙이 자리 잡았습니다. CCTV의 대수가 급격히 늘어나면서 관리와 효율성 문제와 더불어, 곳곳에 설치된 CCTV를 개별 관제하는 것으로는 응급 상

5 Jul 07, 2022
MolRep: A Deep Representation Learning Library for Molecular Property Prediction

MolRep: A Deep Representation Learning Library for Molecular Property Prediction Summary MolRep is a Python package for fairly measuring algorithmic p

AI-Health @NSCC-gz 83 Dec 24, 2022
Implementation of self-attention mechanisms for general purpose. Focused on computer vision modules. Ongoing repository.

Self-attention building blocks for computer vision applications in PyTorch Implementation of self attention mechanisms for computer vision in PyTorch

AI Summer 962 Dec 23, 2022
A project to build an AI voice assistant using Python . The Voice assistant interacts with the humans to perform basic tasks.

AI_Personal_Voice_Assistant_Using_Python A project to build an AI voice assistant using Python . The Voice assistant interacts with the humans to perf

Chumui Tripura 1 Oct 30, 2021
Pretrained Cost Model for Distributed Constraint Optimization Problems

Pretrained Cost Model for Distributed Constraint Optimization Problems Requirements PyTorch 1.9.0 PyTorch Geometric 1.7.1 Directory structure baseline

2 Aug 28, 2022
This project uses Template Matching technique for object detecting by detection of template image over base image.

Object Detection Project Using OpenCV This project uses Template Matching technique for object detecting by detection the template image over base ima

Pratham Bhatnagar 7 May 29, 2022
Official PyTorch implementation of Synergies Between Affordance and Geometry: 6-DoF Grasp Detection via Implicit Representations

Synergies Between Affordance and Geometry: 6-DoF Grasp Detection via Implicit Representations Zhenyu Jiang, Yifeng Zhu, Maxwell Svetlik, Kuan Fang, Yu

UT-Austin Robot Perception and Learning Lab 63 Jan 03, 2023
Multitask Learning Strengthens Adversarial Robustness

Multitask Learning Strengthens Adversarial Robustness

Columbia University 15 Jun 10, 2022