forked from testerSunshine/12306
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf8 -*- | ||
__author__ = 'kongkongyzt' | ||
import requests | ||
from config.ticketConf import _get_yaml | ||
|
||
PUSH_BEAR_API_PATH = "https://pushbear.ftqq.com/sub" | ||
|
||
def sendPushBear(msg): | ||
""" | ||
pushBear微信通知 | ||
:param str: 通知内容 content | ||
:return: | ||
""" | ||
conf = _get_yaml() | ||
if conf["pushbear_conf"]["is_pushbear"] and conf["pushbear_conf"]["send_key"].strip() != "": | ||
try: | ||
requests.get("{}?sendkey={}&text=来自12306抢票助手的通知&desp={}".format(PUSH_BEAR_API_PATH, conf["pushbear_conf"]["send_key"].strip(), msg)) | ||
print(u"已下发 pushbear 微信通知, 请查收") | ||
except Exception as e: | ||
print(u"pushbear 配置有误 {}".format(e)) | ||
else: | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
sendPushBear(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.