修身养性,知行合一

  • 首页
  • 爱码
    • 系统
    • 数据库
    • JavaScript
    • CSharp
    • Python
  • 生活
    • 文化
    • 美食
  • 杂谈
  • 关于
修身养性,知行合一
码字,杂谈
  1. 首页
  2. 爱码
  3. 前端
  4. JavaScript
  5. 正文

双十一 京东养红包攻略

2019年10月25日 3382点热度 0人点赞 0条评论

又到双十一,现在的双十一早已过了前几年的“真实惠”,现在商家趋于大同,各种限制政策让我们耗尽功夫。

今年的京东推出了养红包,开始觉得很麻烦,昨天无意中看见了一个脚本,试了一下,还比较好用,贴出来分享一下。

使用方法:

1、浏览器进入京东,并登录
2、登录后打开https://happy.m.jd.com/babelDiy/GZWVJFLMXBQVEBDQZWMY/XJf8bH6oXDWSgS91daDJzXh9bU7/index.html ,对,就是这个链接,直接点击即可。(注意,这个链接真的需要登录后再打开)
3、按下F12,复制粘贴脚本,并按下回车,脚本会自动奔跑。(脚本见下)
4、脚本奔跑的时候会有状态提示,如果跑完了,可以到手机APP的活动页面查看一下是否完成。
5、如果手机端查看任务有未完成情况,请重复步骤第3步,也就是再跑一遍脚本。(我跑了两边就全部完成了。)

脚本:

let productList = [],
    shopList = [],
    url = "https://api.m.jd.com/client.action";
function autoPost(id, type) {
    fetch(`${url}?timestamp=${new Date().getTime()}`, {
        method: "POST",
        mode: "cors",
        credentials: "include",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        body: `functionId=raisepacket_collectScore&body={"type":${type},"ext":"${id}","appsign":1,"msgsign":2}&client=wh5`
    }).then(function (response) {
        return response.json()
    }).then(function (res) {
        console.log(res.data.biz_msg)
    })
}
function start() {
    fetch(`${url}?${new Date().getTime()}`, {
        method: "POST",
        mode: "cors",
        credentials: "include",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        body: 'functionId=raisepacket_getShopAndProductList&body=&client=wh5'
    }).then(function (response) {
        return response.json()
    }).then(function (res) {
        productList = res.data.result.productList;
        shopList = res.data.result.shopList;
        console.log(`获取到任务,商品:${productList.length}商品:${shopList.length}`);
        autoProductTask()
    })
}
function autoProductTask() {
    for (let i = 0, leng = productList.length; i < leng; i++) {
        (function (index) {
            setTimeout(() => {
                let item = productList[index];
                autoPost(item['id'], 4);
                console.log(`商品总任务数:${leng}当前任务数:${index+1}`);
                if (leng - 1 == index) {
                    autoShopTask()
                }
            }, index * 1500)
        })(i)
    }
}
function autoShopTask() {
    for (let i = 0, leng = shopList.length; i < leng; i++) {
        (function (index) {
            setTimeout(() => {
                let item = shopList[index];
                autoPost(item['id'], 2);
                console.log(`商铺总任务数:${leng}当前任务数:${index+1}`);
                if (leng - 1 == index) {
                    autoPlay()
                }
            }, index * 1500)
        })(i)
    }
}
function autoPlay() {
    for (let i = 0, leng = 4; i < leng; i++) {
        (function (index) {
            setTimeout(() => {
                autoPost(0, 5);
                console.log(`好玩互动:${leng}当前任务数:${index+1}`);
                if (leng - 1 == index) {
                    autoInteract()
                }
            }, index * 1000)
        })(i)
    }
}
function autoInteract() {
    for (let i = 0, leng = 4; i < leng; i++) {
        (function (index) {
            setTimeout(() => {
                autoPost(0, 10);
                console.log(`视频直播:${leng}当前任务数:${index+1}`);
                if (leng - 1 == index) {
                    autoShopping()
                }
            }, index * 1000)
        })(i)
    }
}
function autoShopping() {
    for (let i = 0, leng = 3; i < leng; i++) {
        (function (index) {
            setTimeout(() => {
                autoPost(0, 3);
                console.log(`精彩会场:${leng}当前任务数:${index+1}`)
            }, index * 1000)
        })(i)
    }
}
start();

快去养红包吧。

本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可
标签: JavaScript
最后更新:2019年10月26日

jeremyjone

这个人很懒,什么都没留下

打赏 点赞
< 上一篇
下一篇 >

文章评论

取消回复

文章目录
  • 使用方法:
  • 脚本:
最新 热点 随机
最新 热点 随机
node-sass 的安装 解决端口被占的问题 vue3 组件 Props 的声明方式 给 div 添加选中状态 请求的取消 rgb 颜色小数兼容问题
Qt lnk1158 无法运行rc.exe 的解决方案 关于 vue3 的 onMounted 获取不到 ref MySql的BLOB格式 npm查看全局安装的包 Windows Server 配置域内机器自动登录 美化 Windows Terminal(升级版)

(っ•̀ω•́)っ✎⁾⁾ 开心每一天

COPYRIGHT © 2021 jeremyjone.com. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS

京ICP备19012859号-1

京公网安备 11010802028585号