当前位置:网站首页>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()
边栏推荐
- 腾讯发布第二代四足机器人Max,梅花桩上完成跳跃、空翻
- Flutter入门进阶之旅(六)Layout Widget
- Flutter Getting Started and Advanced Tour (2) Hello Flutter
- The latest interview summary in 20022 brought by Ali senior engineer is too fragrant
- Say goodbye to the AI era of hand looms
- 一甲子,正青春,CCF创建六十周年庆典在苏州举行
- 字符串转换整数 (atoi)
- #Internet of Things essay#Xiaoxiong pie equipment development actual combat
- 8、IDEA提交代码出现: Fetch failed fatal: Could not read from remote repository
- h264协议
猜你喜欢
基于CAP组件实现补偿事务与幂等性保障
无需精子卵子子宫体外培育胚胎,Cell论文作者这番话让网友们炸了
十分钟教会你如何使用VitePress搭建及部署个人博客站点
注释、关键字、标识符的区别你知道吗?
Flutter入门进阶之旅(六)Layout Widget
1-hour live broadcast recruitment order: industry big names share dry goods, and enterprise registration opens丨qubit·viewpoint
1小时直播招募令:行业大咖干货分享,企业报名开启丨量子位·视点
中断系统结构及中断控制详解
Flutter Getting Started and Advanced Tour (3) Text Widgets
超越CLIP的多模态模型,只需不到1%的训练数据!南加大最新研究来了
随机推荐
用 API Factory 产品生成 API 文档
使用RecyclerView实现三级折叠列表
Flutter入门进阶之旅(八)Button Widget
Flutter Getting Started and Advanced Tour (2) Hello Flutter
生成上传密钥和密钥库
#物联网征文#小熊派设备开发实战
Glory to the Blue Yonder, speeds up the strategic growth
Nature:猪死亡1小时后,器官再次运转
Go 事,如何成为一个Gopher ,并在7天找到 Go 语言相关工作,第1篇
Introduction to Flutter advanced trip Dialog&Toast (10)
腾讯欲成育碧最大股东/ 米哈游招NLP内容生成研究员/ AI发现四千余物种濒临灭绝...今日更多新鲜事在此...
发明时代,「幂集创新」事关你我
放下手机吧:实验表明花20分钟思考和上网冲浪同样快乐
How to upload local file trial version in binary mode in ABAP report
用场景定义硬件,英码科技破解“边缘计算”密码
K个结点的组内逆序调整
The FFmpeg library is configured and used on win10 (libx264 is not configured)
Scala Advanced (7): Collection Content Summary (Part 1)
【HCIP持续更新】IS-IS协议原理与配置
基于CAP组件实现补偿事务与幂等性保障