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

BMN: Boundary-Matching Network

BMN: Boundary-Matching Network A pytorch-version implementation codes of paper: "BMN: Boundary-Matching Network for Temporal Action Proposal Generatio

qinxin 260 Dec 06, 2022
the official code for ICRA 2021 Paper: "Multimodal Scale Consistency and Awareness for Monocular Self-Supervised Depth Estimation"

G2S This is the official code for ICRA 2021 Paper: Multimodal Scale Consistency and Awareness for Monocular Self-Supervised Depth Estimation by Hemang

NeurAI 4 Jul 27, 2022
g2o: A General Framework for Graph Optimization

g2o - General Graph Optimization Linux: Windows: g2o is an open-source C++ framework for optimizing graph-based nonlinear error functions. g2o has bee

Rainer Kümmerle 2.5k Dec 30, 2022
Implement the Pareto Optimizer and pcgrad to make a self-adaptive loss for multi-task

multi-task_losses_optimizer Implement the Pareto Optimizer and pcgrad to make a self-adaptive loss for multi-task 已经实验过了,不会有cuda out of memory情况 ##Par

14 Dec 25, 2022
Dense matching library based on PyTorch

Dense Matching A general dense matching library based on PyTorch. For any questions, issues or recommendations, please contact Prune at

Prune Truong 399 Dec 28, 2022
PyTorch code for the paper "Complementarity is the King: Multi-modal and Multi-grained Hierarchical Semantic Enhancement Network for Cross-modal Retrieval".

Complementarity is the King: Multi-modal and Multi-grained Hierarchical Semantic Enhancement Network for Cross-modal Retrieval (M2HSE) PyTorch code fo

Xinlei-Pei 6 Dec 23, 2022
This is the pytorch code for the paper Curious Representation Learning for Embodied Intelligence.

Curious Representation Learning for Embodied Intelligence This is the pytorch code for the paper Curious Representation Learning for Embodied Intellig

19 Oct 19, 2022
Office source code of paper UniFuse: Unidirectional Fusion for 360$^\circ$ Panorama Depth Estimation

UniFuse (RAL+ICRA2021) Office source code of paper UniFuse: Unidirectional Fusion for 360$^\circ$ Panorama Depth Estimation, arXiv, Demo Preparation I

Alibaba 47 Dec 26, 2022
S2-BNN: Bridging the Gap Between Self-Supervised Real and 1-bit Neural Networks via Guided Distribution Calibration (CVPR 2021)

S2-BNN (Self-supervised Binary Neural Networks Using Distillation Loss) This is the official pytorch implementation of our paper: "S2-BNN: Bridging th

Zhiqiang Shen 52 Dec 24, 2022
Fast and Context-Aware Framework for Space-Time Video Super-Resolution (VCIP 2021)

Fast and Context-Aware Framework for Space-Time Video Super-Resolution Preparation Dependencies PyTorch 1.2.0 CUDA 10.0 DCNv2 cd model/DCNv2 bash make

Xueheng Zhang 1 Mar 29, 2022
A toy project using OpenCV and PyMunk

A toy project using OpenCV, PyMunk and Mediapipe the source code for my LindkedIn post It's just a toy project and I didn't write a documentation yet,

Amirabbas Asadi 82 Oct 28, 2022
Cross-media Structured Common Space for Multimedia Event Extraction (ACL2020)

Cross-media Structured Common Space for Multimedia Event Extraction Table of Contents Overview Requirements Data Quickstart Citation Overview The code

Manling Li 49 Nov 21, 2022
Continual learning with sketched Jacobian approximations

Continual learning with sketched Jacobian approximations This repository contains the code for reproducing figures and results in the paper ``Provable

Machine Learning and Information Processing Laboratory 1 Jun 30, 2022
Its a Plant Leaf Disease Detection System based on Machine Learning.

My_Project_Code Its a Plant Leaf Disease Detection System based on Machine Learning. I have used Tomato Leaves Dataset from kaggle. This system detect

Sanskriti Sidola 3 Jun 15, 2022
A deep-learning pipeline for segmentation of ambiguous microscopic images.

Welcome to Official repository of deepflash2 - a deep-learning pipeline for segmentation of ambiguous microscopic images. Quick Start in 30 seconds se

Matthias Griebel 39 Dec 19, 2022
Script that attempts to force M1 macs into RGB mode when used with monitors that are defaulting to YPbPr.

fix_m1_rgb Script that attempts to force M1 macs into RGB mode when used with monitors that are defaulting to YPbPr. No warranty provided for using th

Kevin Gao 116 Jan 01, 2023
Code for the CIKM 2019 paper "DSANet: Dual Self-Attention Network for Multivariate Time Series Forecasting".

Dual Self-Attention Network for Multivariate Time Series Forecasting 20.10.26 Update: Due to the difficulty of installation and code maintenance cause

Kyon Huang 223 Dec 16, 2022
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context Code in both PyTorch and TensorFlow

Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context This repository contains the code in both PyTorch and TensorFlow for our paper

Zhilin Yang 3.3k Jan 06, 2023
[ICCV 2021 (oral)] Planar Surface Reconstruction from Sparse Views

Planar Surface Reconstruction From Sparse Views Linyi Jin, Shengyi Qian, Andrew Owens, David F. Fouhey University of Michigan ICCV 2021 (Oral) This re

Linyi Jin 89 Jan 05, 2023
Adaptive Prototype Learning and Allocation for Few-Shot Segmentation (CVPR 2021)

ASGNet The code is for the paper "Adaptive Prototype Learning and Allocation for Few-Shot Segmentation" (accepted to CVPR 2021) [arxiv] Overview data/

Gen Li 91 Dec 23, 2022