Giter Club home page Giter Club logo

get_libseat's Introduction

依赖项

r = requests.get('http://127.0.0.1/newinfo.json') 该行是读取数据文件, newinfo.json 中存放的是账号、密码、座位id、预约时间等数据, 我是将 json 文件放在本地服务器的 web 路径下了, 你也可以直接用普通读文件方法或者将这些数据放到数据库中读取

整个程序很简短, 只是使用 requests 包来发送 HTTP(s) 请求

What's this?

基于 Python 的利昂图书馆预约系统自动签到&预约程序。可支持自动预约、自动签到 (可外网签到-利用 X-Forwarded-For 字段)

Get Started

git clone https://github.com/yunqiang-sun/get_LibSeat
cd get_LibSeat
python newSeatCrawler.py ## 预约,json是配置文件,放账号密码预约座位号时间等信息
python newCheckIn.py ## 签到

Tips

使用 crontab 设置定时任务, 另外要注意学校服务器时间与你所用的服务器的微小时间差, 如果你设置的预约时间为 5:00 则有可能学校服务器的时间还没有到, 此时预约可能会失败, 可以在代码中加入 try.. except.. 做异常处理

性能

现在每天有很多程序在抢座, 甚至出现了多个程序抢同一个座位, 早晨如果要加快预约速度, 首先服务器的网络速度要快(使用 ping 命令测试), 这是最重要的因素. 其次应去掉程序中的所有 IO 操作, 另外可以在 5:00 预约开始前提前发送 get 请求获取 token, 将token 放到 redis 中, 预约开始后直接从 redis 读取

School List

No SchoolName
01 济南大学
02 **人民大学
03 哈尔滨工业大学
04 武汉大学
05 天津大学
06 同济大学
07 首都医科大学
08 合肥工业大学
09 安徽工程大学
10 辽宁大学
11 北京联合大学
12 闽南师范大学
13 华中农业大学
14 聊城大学
15 沈阳大学
16 燕山大学
17 宁波工程学院
18 辽宁师范大学
19 河南工业大学
20 河南财经政法大学
21 对外经济贸易大学
22 广东外语外贸大学
23 武汉音乐学院
24 华东政法大学
25 福州大学
26 华南农业大学
27 陕西师范大学
28 南华大学
30 厦门理工学院
31 首都师范大学
32 阜阳师范大学
33 江苏医药职业学院
34 中华女子学院
35 广西大学
36 河南理工大学
37 常州大学
38 河南牧业经济学院

get_libseat's People

Contributors

yunqiang-sun 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.