Git Product home page Git Product logo

pkurunninghelper's Introduction

PKURunningHelper

这是一个慢性腰痛但是开不出证明的苦逼大学生为了能够毕业而写的小工具,用于伪造生成和上传跑步记录,目前支持 PB, PKU Runner, 悦跑圈 Joyrun

该项目改写自学长的项目 PKULayer

依赖环境

该项目目前仅支持 Python 3

$ apt-get install python3.6

安装依赖包 requests, requests_toolbelt

$ pip3 install requests requests_toolbelt

可选择安装 simplejson

$ pip3 install simplejson

下载

下载这个分支到本地

$ git clone https://github.com/zhongxinghong/PKURunningHelper

用法

进入项目根目录

$ cd PKURunningHelper/

首先根据提示,修改配置文件 config.ini

$ vim config.ini

运行 runner.py 查看命令行界面,输入参数 --help 查看用法

$ python3 runner.py --help

Usage: PKU running helper ! Check your config first, then enjoy yourself !

Options:
  -h, --help   show this help message and exit
  -c, --check  show 'config.ini' file
  -s, --start  run the runner's client

输入参数 --check 检查配置文件的解析情况

$ python3 runner.py --check

Section [Base]
{
    "app": "Joyrun",
    "debug": "true"
}


Section [PB]
{
    "studentid": "1x000xxxxx",
    "password": "1x000xxxxx",
    "distance": "1.20",
    "pace": "4.50",
    "stride_frequncy": "160"
}


Section [PKURunner]
{
    "studentid": "1x000xxxxx",
    "password": "xxxxxxxx",
    "distance": "3.10",
    "pace": "5.00",
    "stride_frequncy": "160"
}


Section [Joyrun]
{
    "studentid": "1x000xxxxx",
    "password": "123456",
    "distance": "1.20",
    "pace": "5.50",
    "stride_frequncy": "160"
}

确保配置文件书写,然后输入 --start,即可完成一次上传。默认为 debug 模式,因此还会输出每次请求返回的 json 数据包

$ python3 runner.py --start

[INFO] runner, 2018-09-28 18:08:55, upload record success !

文件夹结构

PKURunningHelper/
├── Joyrun                    // Joyrun 客户端程序包
│   ├── __init__.py
│   ├── auth.py                   // 请求鉴权类
│   ├── client.py                 // Joyrun 客户端程序包
│   ├── data                  // 跑步记录数据
│   │   └── 400m.250p.54.joyrun.json       // 由 PKURunner 的跑步数据经过校正得到
│   ├── error.py                  // 错误类定义
│   └── record.py                 // 跑步记录类
├── LICENSE
├── PB                        // PB 客户端程序包
│   ├── __init__.py
│   ├── client.py                 // PB 客户端类,伪造 HTTP 请求,生成 Running Record
│   ├── data                  // 跑步记录数据
│   │   └── 400m.locus.json       // 五四跑廊一圈 GPS 数据,抽取和修改自我曾经的跑步记录
│   └── error.py                  // 错误类定义
├── PKURunner                 // PKURunner 客户端程序包
│   ├── __init__.py
│   ├── client.py                 // PKURunner 客户端类
│   ├── data                  // 跑步记录数据
│   │   └── 400m.250p.54.pkurunner.json    // 五四跑廊走一圈的高德 GPS 数据,共 250 点,坐标手动校正过
│   ├── error.py                  // 错误类定义
│   ├── iaaa.py                   // 北大 iAAA 统一认证客户端类
│   └── record.py                 // 跑步记录类
├── README.md
├── cache                     // 缓存文件夹
│   ├── Joyrun_LoginInfo.json         // Joyrun 的登录状态缓存
│   └── PKURunner_AccessToken.json    // PKURunner 的 iAAA 认证所得 token 缓存
├── config.ini                    // 项目配置文件
├── requirements.txt
├── runner.py                     // 项目主程序
├── test                      // 主要存储了一些抓包结果,API 调用结果,测试代码等
│   ├── Joyrun
│   │   ├── 401.json
│   │   ├── joyrun.saz
│   │   ├── joytherun.cpp
│   │   ├── main.cpp
│   │   ├── md5.cpp
│   │   ├── md5.h
│   │   ├── ......
│   │   ├── po.aspx.247294144.saz
│   │   ├── record.247074473.json
│   │   ├── record.247074473.parse.json
│   │   └── test.py
│   ├── PB
│   │   ├── 11km.locus.json
│   │   ├── 309.gz
│   │   ├── ......
│   │   └── 867_Request.txt
│   └── PKURunner
│       ├── code.-1.json
│       ├── ......
│       ├── record.7.json
│       └── upload.json
└── util                      // 通用程序包
    ├── __init__.py
    ├── class_.py                 // 通用类
    ├── func.py                   // 通用函数库
    └── module.py                 // 通用模板类,统一 import 导入结果

声明

本项目仅供参考学习,你可以修改和使用这个项目,但请自行承担使用不当造成的一切后果。

证书

MIT LICENSE

pkurunninghelper's People

Stargazers

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