From 2e1f94dbb9154e48537f3f5c35c37f0d5ccb83dc Mon Sep 17 00:00:00 2001 From: "xianping.wen" <931128603@qq.com> Date: Mon, 9 Sep 2019 19:33:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4PushBear?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++----- TickerConfig.py | 6 ------ UnitTest/TestAll.py | 8 -------- inter/GetQueueCount.py | 2 -- inter/QueryOrderWaitTime.py | 3 --- run.py | 5 ----- 6 files changed, 5 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 82200ba..677a0da 100755 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ - [x] 准点预售和捡漏 - [x] 智能候补 - [x] 邮件通知 - - [x] pushbear通知 + - [x] server酱通知 #### 依赖库 - 验证码目前可以本地识别,需要下载模型,放于项目根目录,全部代码来源于此项目 [传送门](https://github.com/zhaipro/easy12306),表示感谢 @@ -26,13 +26,12 @@ - 非root用户(避免安装和运行时使用了不同环境): `pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt` #### 项目使用说明 - - 可以配置邮箱,配置邮箱的格式在[配置](TickerConfig.py)里面可以看到ex - - 可以配置server酱提醒(推荐)[配置教程](https://www.jianshu.com/p/8d10b5b9c4e3) - - 配置[配置](TickerConfig.py)文件的时候,需注意空格和遵循python语法格式 -#### 项目开始 - 服务器启动: - 修改[配置](TickerConfig.py)文件 + - 可以配置邮箱,配置邮箱的格式在[配置](TickerConfig.py)里面可以看到ex + - 可以配置server酱提醒(推荐)[配置教程](https://www.jianshu.com/p/8d10b5b9c4e3) + - 配置[配置](TickerConfig.py)文件的时候,需注意空格和遵循python语法格式 - 运行根目录`sudo python run.py`,即可开始 - 如果你的服务器安装了docker与docker-compose, 那么就可以通过`docker-compose`进行启动,`docker.sh`脚本对此进行了封装,可以通过如下命令进行启动 - 1、`sudo ./docker.sh run` #创建一个镜像并启动容器,如果镜像已经创建过了会直接启动容器。 @@ -100,6 +99,7 @@ - 目前12306对服务器ip比较敏感,大家还是在自己家里挂着吧 - 自动更换ip软件目前已支持TPLINK和小米路由器,只限家庭网络[点我跳转](https://github.com/testerSunshine/AutoRouterIP) + #### 感谢一下小伙伴对本项目提供的帮助 - @sun7127@126.com - @ 才 diff --git a/TickerConfig.py b/TickerConfig.py index 4c0a306..c48fbaa 100644 --- a/TickerConfig.py +++ b/TickerConfig.py @@ -81,12 +81,6 @@ EMAIL_CONF = { "host": "", } -# 是否开启 pushbear 微信提醒, 使用前需要前往 http://pushbear.ftqq.com 扫码绑定获取 send_key 并关注获得抢票结果通知的公众号 -PUSHBEAR_CONF = { - "is_pushbear": False, - "send_key": "" -} - # 是否开启 server酱 微信提醒, 使用前需要前往 http://sc.ftqq.com/3.version 扫码绑定获取 SECRET 并关注获得抢票结果通知的公众号 SERVER_CHAN_CONF = { "is_server_chan": False, diff --git a/UnitTest/TestAll.py b/UnitTest/TestAll.py index beef095..4483d3f 100644 --- a/UnitTest/TestAll.py +++ b/UnitTest/TestAll.py @@ -6,7 +6,6 @@ import requests from agency.agency_tools import proxy from config.emailConf import sendEmail -from config.pushbearConf import sendPushBear from config.serverchanConf import sendServerChan @@ -40,13 +39,6 @@ class testAll(unittest.TestCase): :return: """ sendEmail(u"订票小助手测试一下") - - def testPushbear(self): - """ - 实测pushbear是否可用 - :return: - """ - sendPushBear(u"pushbear 微信通知测试一下") # def testConfig(self): # """ diff --git a/inter/GetQueueCount.py b/inter/GetQueueCount.py index 3e7535a..f9a3772 100644 --- a/inter/GetQueueCount.py +++ b/inter/GetQueueCount.py @@ -8,7 +8,6 @@ import wrapcache import TickerConfig from config.TicketEnmu import ticket from config.emailConf import sendEmail -from config.pushbearConf import sendPushBear from config.serverchanConf import sendServerChan from config.urlConf import urls from inter.ConfirmSingleForQueue import confirmSingleForQueue @@ -130,7 +129,6 @@ class queryQueueByAfterNate: time.sleep(1) else: sendEmail(ticket.WAIT_ORDER_SUCCESS) - sendPushBear(ticket.WAIT_ORDER_SUCCESS) sendServerChan(ticket.WAIT_ORDER_SUCCESS) raise ticketIsExitsException(ticket.WAIT_AFTER_NATE_SUCCESS) diff --git a/inter/QueryOrderWaitTime.py b/inter/QueryOrderWaitTime.py index a9131f2..ca63c18 100644 --- a/inter/QueryOrderWaitTime.py +++ b/inter/QueryOrderWaitTime.py @@ -4,7 +4,6 @@ import time from config.TicketEnmu import ticket from config.emailConf import sendEmail -from config.pushbearConf import sendPushBear from config.serverchanConf import sendServerChan from myException.ticketIsExitsException import ticketIsExitsException from myException.ticketNumOutException import ticketNumOutException @@ -44,8 +43,6 @@ class queryOrderWaitTime: if data and data.get("orderId", ""): sendEmail(ticket.WAIT_ORDER_SUCCESS.format( data.get("orderId", ""))) - sendPushBear(ticket.WAIT_ORDER_SUCCESS.format( - data.get("orderId", ""))) sendServerChan(ticket.WAIT_ORDER_SUCCESS.format( data.get("orderId", ""))) raise ticketIsExitsException(ticket.WAIT_ORDER_SUCCESS.format( diff --git a/run.py b/run.py index dea77c6..61137f5 100755 --- a/run.py +++ b/run.py @@ -1,6 +1,5 @@ # -*- coding=utf-8 -*- from config.emailConf import sendEmail -from config.pushbearConf import sendPushBear from config.serverchanConf import sendServerChan from init import select_ticket_info @@ -13,10 +12,6 @@ def Email(): sendEmail(u"订票小助手测试一下") -def PushbearConf(): - sendPushBear("订票小助手测试一下") - - def PushServerChan(): sendServerChan("订票小助手测试一下") -- GitLab