当前位置:网站首页>30行代码实现微信朋友圈自动点赞
30行代码实现微信朋友圈自动点赞
2022-08-09 12:23:00 【xindoo】
首先祝大家新年快乐,过年了,允许我水一篇博客。不知道大家都回老家了没,不过我是没有回去,晚上吃完年夜饭看到很多人发朋友圈,为了增进和大家的友谊,于是就想着给大家点个赞,无奈内容太多了,就搞个自动化脚本,原理和前两天我写的30行代码实现蚂蚁森林自动偷能量一样,这里不再赘述,直接上代码。
import uiautomator2 as u2
import time
# d = u2.connect()
d = u2.connect("192.168.0.102")
# d.app_start("com.tencent.mm")
# time.sleep(0.3)
# d(text="发现").click()
# time.sleep(0.3)
# d(text="朋友圈").click()
def click():
time.sleep(0.2)
d.xpath("//*[@resource-id='com.tencent.mm:id/kn']").click()
time.sleep(0.2)
if d.xpath("//*[@text='赞']").exists:
time.sleep(0.2)
d(text="赞").click()
time.sleep(0.1)
return True
time.sleep(0.3)
return False
def swipeDown():
a = d.xpath("//*[@resource-id='com.tencent.mm:id/kn']")
y = a.get().bounds
dist = y[3]
if dist < 200:
dist = 220
d.swipe(300, dist, 300, 50, 0.2)
time.sleep(0.1)
cnt = 0
while True:
if d.xpath("//*[@text='5小时前']").exists:
break
if click() == False:
cnt = cnt + 1
if cnt > 2:
break
swipeDown()
边栏推荐
- Flutter入门进阶之旅(三)Text Widgets
- Scala Advanced (7): Collection Content Summary (Part 1)
- Win10 compiles the x264 library (there are also generated lib files)
- 2022年非一线IT行业就业前景?
- The batch size does not have to be a power of 2!The latest conclusions of senior ML scholars
- 在已打开图片上加水印(文字)
- 张朝阳对话俞敏洪:一边是手推物理公式,一边是古诗信手拈来
- 手写大根堆
- 报告:想学AI的学生数量已涨200%,老师都不够用了
- 二叉树的序列化和反序列化
猜你喜欢
用 API Factory 产品生成 API 文档
How to upload local file trial version in binary mode in ABAP report
报告:想学AI的学生数量已涨200%,老师都不够用了
听声辨物,这是AI视觉该干的???|ECCV 2022
AQS Synchronization Component - FutureTask Analysis and Use Cases
两个链表相加
史上最猛“员工”,疯狂吐槽亿万富翁老板小扎:那么有钱,还总穿着同样的衣服!...
Flutter入门进阶之旅(八)Button Widget
Flutter入门进阶之旅(七)GestureDetector
两分钟录音就可秒变语言通!火山语音音色复刻技术如何修炼而成?
随机推荐
2022年非一线IT行业就业前景?
26、管道参数替换命令xargs
8、IDEA提交代码出现: Fetch failed fatal: Could not read from remote repository
ViewPager fragments of nested data blank page abnormal problem analysis
大佬们,请教一下,我看官方文档中,sqlserver cdc只支持2012版之后的,对于sqlser
脱光衣服待着就能减肥,当真有这好事?
手写大根堆
Batch大小不一定是2的n次幂!ML资深学者最新结论
世界第4疯狂的科学家,在103岁生日那天去世了
Glory to the Blue Yonder, speeds up the strategic growth
西湖大学教授怎么看AI制药革命?|量子位智库圆桌实录
ABAP 面试题:如何使用 ABAP 编程语言的 System CALL 接口,直接执行 ABAP 服务器所在操作系统的 shell 命令?
注:检测到当前使用的ADB不是HBuilder内置或自定义ADB:PID为:9544进程名称为:adb.exe 路径为:c:\users\administrator\appdata\local\and
World's 4th mad scientist dies on his 103rd birthday
合并两个有序列表
JVM常用监控工具解释以及使用
随机快排时间复杂度是N平方?
单面线路板与精密多层PCB线路板区别有哪些?
1-hour live broadcast recruitment order: industry big names share dry goods, and enterprise registration opens丨qubit·viewpoint
Customize VIEW to realize in-app message reminder to rotate up and down