├── README.md └── wps_invite.py /README.md: -------------------------------------------------------------------------------- 1 | # WPS-invite 2 | 签到失效了,留下了邀请 3 | 使用方式见我的CSDN 4 | https://blog.csdn.net/qq_45294059/article/details/113850601 5 | # 2021.2.20更新 6 | ## 增加延时,防止被过滤 7 | # 2021.2.21 8 | ## 酷友反馈我加了太多的被邀请id导致使用云函数部署时会超时报错,删掉些。 9 | # 2021.2.22 10 | ## 好家伙,我有个版本没删我的server酱的key,结果微信收到了好多陌生人的成功推送,现在我key重置了。 11 | # 2021.2.24 12 | ## server酱的微信推送通道即将关闭,于是改换为turbo版本的安卓app推送。 13 | -------------------------------------------------------------------------------- /wps_invite.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/env python 2 | # coding=utf-8 3 | import requests 4 | import pytz 5 | import datetime 6 | from io import StringIO 7 | import time 8 | 9 | # 初始化信息 10 | SCKEY = 'xxxxxxxxxxxxxxxxxxxxxxxx' # '*********复制SERVER酱的SCKEY进来*************(保留引号)' 11 | data = { 12 | "wps_invite": [ 13 | { 14 | "name": "水哥他爸", 15 | "invite_userid": 11699139251, # "*********复制手机WPS个人信息中的用户ID进来,类似括号内容(191641526)*************(不保留双引号)", 16 | "sid": "xxxxxxxxxx" # network获取wps_sid 17 | } 18 | ] 19 | } 20 | # 初始化日志 21 | sio = StringIO('WPS签到日志\n\n') 22 | sio.seek(0, 2) # 将读写位置移动到结尾 23 | s = requests.session() 24 | tz = pytz.timezone('Asia/Shanghai') 25 | nowtime = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S") 26 | sio.write("-" + nowtime + "-\n\n") 27 | 28 | 29 | # APP 30 | def pushWechat(desp, nowtime): 31 | ssckey = SCKEY 32 | send_url = 'https://sctapi.ftqq.com/' + ssckey + '.send' 33 | if '失败' in desp: 34 | params = { 35 | 'title': 'WPS小程序邀请失败提醒' + nowtime, 36 | 'desp': desp 37 | } 38 | else: 39 | params = { 40 | 'title': 'WPS小程序邀请成功' + nowtime, 41 | 'desp': desp 42 | } 43 | requests.post(send_url, params=params) 44 | 45 | 46 | # 主函数 47 | def main(): 48 | wps_inv = data['wps_invite'] 49 | # 这13个账号被邀请 50 | invite_sid = [ 51 | "V02StVuaNcoKrZ3BuvJQ1FcFS_xnG2k00af250d4002664c02f", 52 | "V02SWIvKWYijG6Rggo4m0xvDKj1m7ew00a8e26d3002508b828", 53 | "V02Sr3nJ9IicoHWfeyQLiXgvrRpje6E00a240b890023270f97", 54 | "V02SBsNOf4sJZNFo4jOHdgHg7-2Tn1s00a338776000b669579", 55 | "V02ScVbtm2pQD49ArcgGLv360iqQFLs014c8062e000b6c37b6", 56 | "V02S2oI49T-Jp0_zJKZ5U38dIUSIl8Q00aa679530026780e96", 57 | "V02ShotJqqiWyubCX0VWTlcbgcHqtSQ00a45564e002678124c", 58 | "V02SFiqdXRGnH5oAV2FmDDulZyGDL3M00a61660c0026781be1", 59 | "V02S7tldy5ltYcikCzJ8PJQDSy_ElEs00a327c3c0026782526", 60 | "V02SPoOluAnWda0dTBYTXpdetS97tyI00a16135e002684bb5c", 61 | "V02Sb8gxW2inr6IDYrdHK_ywJnayd6s00ab7472b0026849b17", 62 | "V02SwV15KQ_8n6brU98_2kLnnFUDUOw00adf3fda0026934a7f", 63 | "V02SC1mOHS0RiUBxeoA8NTliH2h2NGc00a803c35002693584d" 64 | 65 | ] 66 | sio.write("\n\n==========wps邀请==========\n\n") 67 | for item in wps_inv: 68 | sio.write("为{}邀请---↓\n\n".format(item['name'])) 69 | if type(item['invite_userid']) == int: 70 | wps_invite(invite_sid, item['invite_userid']) 71 | else: 72 | sio.write("邀请失败:用户ID错误,请重新复制手机WPS个人信息中的用户ID并修改'invite_userid'项,注意不保留双引号\n\n") 73 | desp = sio.getvalue() 74 | pushWechat(desp, nowtime) 75 | print(desp) 76 | return desp 77 | 78 | 79 | # wps接受邀请 80 | def wps_invite(sid: list, invite_userid: int) -> None: 81 | invite_url = 'http://zt.wps.cn/2018/clock_in/api/invite' 82 | for index, i in enumerate(sid): 83 | headers = { 84 | 'sid': i 85 | } 86 | time.sleep(10) 87 | r = s.post(invite_url, headers=headers, data={ 88 | 'invite_userid': invite_userid}) 89 | # sio.write("ID={}, 状态码: {}, \n\n ".format(str(index + 1).zfill(2), r.status_code)) 90 | 91 | 92 | def main_handler(event, context): 93 | return main() 94 | 95 | 96 | if __name__ == '__main__': 97 | main() 98 | --------------------------------------------------------------------------------