| 260 | |
| 261 | |
| 262 | def wecom_key(title, content): |
| 263 | print("\n") |
| 264 | if not QYWX_KEY: |
| 265 | print("QYWX_KEY未设置!!\n取消推送") |
| 266 | return |
| 267 | print("QYWX_KEY服务启动") |
| 268 | print("content"+content) |
| 269 | headers = {'Content-Type': 'application/json'} |
| 270 | data = { |
| 271 | "msgtype":"text", |
| 272 | "text":{ |
| 273 | "content":title+"\n"+content.replace("\n", "\n\n") |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | print(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}") |
| 278 | response = requests.post(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}", json=data,headers=headers).json() |
| 279 | print(response) |
| 280 | |
| 281 | # 飞书机器人推送 |
| 282 | def fs_key(title, content): |