简书阅读文章

前几天在网上看到一个用autojs实现的阅读简书文章的js代码感觉很有意思,于是搞了一把,虽然搞定了,但是熟悉autojs开发环境、调试摸索api等花了我不少时间。今天我来使用一个完全不同的方法,不编程直接通过配置参数来实现,给大家提供一个参数,实现步骤如下:

创建自动构建

进入冰狐智能辅助aznfz.com,在网页端「移动端」/「自动构建脚本」中新建…

通过“元数据”构造自动构建

通过元数据可以直接复制一个完全一样的构建。在上一步创建的构建右边点击“元数据”按钮,将如下元数据拷贝进入并保存,此时系统会根据元数据自动完成模块参数配置。

{ "type": "root", "children": [{ "type": "declareVar", "var": [{ "name": "ret", "type": "normal", "initType": "null", "initValue": "null" }, { "name": "view", "type": "normal", "initType": "null", "initValue": "null" }, { "name": "viewContainer", "type": "normal", "initType": "null", "initValue": "null" }, { "name": "item", "type": "normal", "initType": "null", "initValue": "null" }] }, { "type": "enterApp", "desc": "进入APP", "packageName": "com.jianshu.haruki", "findTag": "txt:首页-", "autoInstall": false, "autoUpdate": false, "wait": "1000", "failed": "exitPopup", "maxStep": "30", "children": [{ "type": "clickAndEnter", "desc": "点击进入推荐页面", "class": 1, "clickTag": "txt:首页-", "checkTag": "txt:推荐-", "root": "", "mode": "2", "failed": "exitPopup", "descendant": [], "duration": "500", "maxStep": "8", "beforeWait": "0", "afterWait": "0", "children": [{ "type": "traverse", "desc": "遍历“推荐”并随机选择一个标签", "class": 1, "tag": "txt:最新-", "failed": "exitPopup", "descendant": [-1, -1], "startIndex": "2", "lastIndex": "2", "retryCount": "0", "randomPick": true, "children": [{ "type": "click", "desc": "点击选中的标签", "class": "2", "mode": "2", "descendant": [], "beforeWait": "0", "afterWait": "3000", "target": "item" }, { "type": "loop", "desc": "阅读标签下的多篇文章", "class": "2", "minCount": "1", "maxCount": "4", "children": [{ "type": "scroll", "desc": "随机滚动页面", "class": 1, "direction": "up", "minDistance": "0.8", "maxDistance": "0.98", "minDuration": "500", "maxDuration": "500", "beforeWait": "2000", "afterWait": "3000", "minScrollCount": "1", "maxScrollCount": "3" }, { "type": "traverse", "desc": "从该页面中随机挑选一篇文章", "class": 1, "tag": "id:com.jianshu.haruki:id/recyclerView-", "failed": "exitPopup", "descendant": [], "startIndex": "0", "lastIndex": "0", "retryCount": "0", "randomPick": true, "clickable": true, "children": [{ "type": "clickAndEnter", "desc": "点击进入并阅读文章", "class": "2", "checkTag": "txt:说点什么吧-", "mode": "2", "failed": "", "descendant": [], "duration": "500", "maxStep": "5", "beforeWait": "0", "afterWait": "0", "target": "item", "children": [{ "type": "loop", "desc": "随机阅读一段时间", "class": 1, "minRunTime": "0.5", "maxRunTime": "1.2", "children": [{ "type": "scroll", "desc": "随机滚动文章阅读", "class": 1, "direction": "up", "minDistance": "0.05", "maxDistance": "0.5", "minDuration": "450", "maxDuration": "600", "beforeWait": "0", "afterWait": "1000", "minScrollCount": "1", "maxScrollCount": "1" }, { "type": "break", "desc": "若阅读完成则跳出循环", "class": "2", "breakTag": "txt:赞赏支持|txt:赞-", "failed": "exitPopup" }] }, { "type": "back2Page", "desc": "返回首页", "tag": "txt:推荐-", "root": "", "backFirst": "true", "failed": "", "duration": "500", "maxStep": "5", "beforeWait": "0", "afterWait": "0", "false": {} }], "false": { "type": "back2Page", "desc": "返回页面", "tag": "txt:推荐-", "root": "", "backFirst": "false", "failed": "", "duration": "500", "maxStep": "5", "beforeWait": "0", "afterWait": "0" } }, { "type": "break", "desc": "跳出循环", "class": 1 }] }] }, { "type": "break", "desc": "跳出循环", "class": 1 }], "clickable": false }], "false": { "type": "log", "desc": "日志", "logType": "warning", "info": ["string-进入推荐失败"] } }], "false": { "type": "log", "desc": "日志", "logType": "error", "info": ["string-进入app失败"] } }, { "type": "popup", "name": "exitPopupWithAD", "false": ["exitPopup", "dealAD"] }, { "type": "popup", "name": "exitPopup", "desc": "弹窗处理", "false": [], "dealItems": [{ "key": "txt^:开启系统通知|txt:新版本安装包已经准备好-", "value": { "type": "click", "desc": "点击控件", "class": 1, "tag": "txt:取消-", "mode": "2", "root": "", "failed": "", "maxStep": "5", "descendant": [], "duration": "500", "beforeWait": "0", "afterWait": "1000" } }, { "key": "txt:立即阅读-", "value": { "type": "traverse", "desc": "遍历容器", "class": "2", "descendant": [-1], "startIndex": "0", "lastIndex": "0", "randomPick": false, "clickable": true, "target": "view", "children": [{ "type": "click", "desc": "点击控件", "class": "2", "mode": "2", "descendant": [], "beforeWait": "0", "afterWait": "1000", "target": "item" }, { "type": "break", "desc": "跳出循环" }] } }, { "key": "txt:你还没有关注文章作者,是否同时关注TA-", "value": { "type": "prob", "desc": "概率", "prob": "80", "children": [{ "type": "click", "desc": "点击控件", "class": 1, "tag": "txt:关注作者-", "mode": "2", "root": "", "failed": "", "maxStep": "5", "descendant": [], "duration": "500", "beforeWait": "0", "afterWait": "1000" }], "false": { "type": "click", "desc": "点击控件", "class": 1, "tag": "txt:取消-", "mode": "2", "root": "", "failed": "", "maxStep": "5", "descendant": [], "duration": "500", "beforeWait": "0", "afterWait": "1000" } } }, { "key": "txt:以后再说|txt:不用打开|txt:我知道了|txt:知道了|id:com.jianshu.haruki:id/dialog_lucky_prize_close|txt:放弃下载|txt:看视频奖励翻倍-", "value": { "type": "click", "desc": "点击控件", "class": "2", "mode": "1", "descendant": [], "beforeWait": "0", "afterWait": "1000", "target": "view" } }] }, { "type": "ad", "desc": "广告处理", "enterWindowList": ["com.qq.e.ads.RewardvideoPortraitADActivity"], "enterTags": "", "breakTags": "txt:恭喜获得奖励-" }, { "type": "windowChange" }, { "type": "notification", "children": [] }], "desc": "根模块" }

编译运行

  1. 在网页端「移动端」/「自动构建脚本」点击右边的“编译”按钮,将自动构建编译成与自动构建名称相同的js脚本。
  2. 在网页端「移动端」/「移动端脚本」点击右边的“发布”按钮发布脚本。
  3. 在网页端「移动端」/「移动端脚本」点击右边的“运行”按钮,并选择设备,然后执行。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值