Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8e5d598

Browse files
committed
企业微信模拟点击发消息
1 parent 62130eb commit 8e5d598

File tree

1 file changed

+27
-23
lines changed

1 file changed

+27
-23
lines changed

qq加群/tt.py

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,20 @@
1919
# qq_or_wx = "TXGuiFoundation" qq
2020
# qq_or_wx = "ChatWnd" #微信
2121
qq_or_wx = "WwStandaloneConversationWnd" # 企业微信
22-
sleep_time = 60 # 休眠时间
23-
winname = ["阿尔萨斯", "Q", "不搭*"] # 需要发送的
22+
sleep_time = 300
2423

25-
add_txt = "\n ❤ 更多咨询请联系客服微信:876134889"
24+
# 休眠时间
25+
winname = ["阿尔萨斯"] # 需要发送的
26+
27+
add_txt = "\n \n 更多咨询请联系客服微信:876134889"
2628

2729
totol_dic = set() # 去重
2830

31+
l, res = spider()
32+
res = res
33+
for one in res:
34+
totol_dic.add(one)
35+
2936

3037
def logger(msg):
3138
"""
@@ -132,25 +139,26 @@ def sendMsgToWX(msg, winname):
132139
def main(winname):
133140
# totol_dic = set()
134141
# 接收内容
135-
l, res = spider()
136-
res = res
137-
for one in res:
138-
totol_dic.add(one)
142+
# l, res = spider()
143+
# res = res
144+
# for one in res:
145+
# totol_dic.add(one)
139146

147+
global totol_dic
140148
while 1:
141149
logger("检测新闻中")
142150
try:
143151
new_l, new_res = spider()
144152
if new_res:
145153
for one in new_res:
146154
if one not in totol_dic:
147-
one = time.strftime("%H:%M", time.localtime(time.time())) + " " + one + add_txt
155+
tem = time.strftime("%H:%M", time.localtime(time.time())) + " " + one + add_txt
148156
for wn in winname:
149-
if sendMsgToWX(one, wn):
150-
logger("发送成功:{}".format(one))
157+
if sendMsgToWX(tem, wn):
158+
logger("发送成功:{}".format(tem))
151159
totol_dic.add(one)
152160
else:
153-
logger("发送失败:{},下次将会重新发送".format(one))
161+
logger("发送失败:{},下次将会重新发送".format(tem))
154162
else:
155163
break
156164
time.sleep(sleep_time)
@@ -162,21 +170,17 @@ def test(winname):
162170
totol_dic = set()
163171
# 接收内容
164172
l, res = spider()
165-
res = res
173+
res = res[:1]
166174
for one in res:
167-
one = one + add_txt
168-
if sendMsgToWX(one, winname):
169-
logger("发送成功:{}".format(one))
170-
time.sleep(2)
171-
else:
172-
loop = True
173-
while loop:
174-
if sendMsgToWX(one, winname):
175-
loop = False
175+
176+
one = time.strftime("%H:%M", time.localtime(time.time())) + " " + one + add_txt
177+
for wn in winname:
178+
if sendMsgToWX(one, wn):
179+
logger("发送成功:{}".format(one))
180+
totol_dic.add(one)
181+
else:
176182
logger("发送失败:{},下次将会重新发送".format(one))
177-
time.sleep(5)
178183

179-
time.sleep(3)
180184

181185

182186
if __name__ == '__main__':

0 commit comments

Comments
 (0)