// ==UserScript== // @name 【京东双十一养红包】 京东全品类优惠券 京东内部优惠券 优惠30%以上 2019.10.23加速版 // @namespace https://www.49zhe.com/ // @version 6.30 // @description 通过淘宝客返利网站,查询商家设置的隐藏优惠券,上万款内部优惠券等你免费领取、让您享受更多优惠! // @author Taobao // @include http*://item.jd.com/* // @require https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; $(document).ready(function() { var url = window.location.host; var href = window.location.href; var name = ''; var html = ''; if (url.indexOf('jd.com') > 0) { var name = $.trim($('.sku-name').text()); var html = '领取优惠券'; html =html + '双11养红包'; $('#choose-btns').append(html); } if (href.indexOf('happy.m.jd.com/babelDiy/GZWVJFLMXBQVEBDQZWMY/XJf8bH6oXDWSgS91daDJzXh9bU7') >= 0) { $('
任务开始......
').insertAfter(".logo"); var message = '使用方法:\r\n'; message = message + '1、首先在手机端京东APP内开启活动\r\n'; message = message + '2、点击下方的确定按钮'; alert(message); start(); } }); let productList = [], shopList = [], apiurl = "https://api.m.jd.com/client.action"; function autoPost(id, type) { fetch(`${apiurl}?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(`${apiurl}?${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); $("#message").html(`商品总任务数:${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); $("#message").html(`商铺总任务数:${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); $("#message").html(`好玩互动:${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); $("#message").html(`视频直播:${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); if (leng - 1 == index) { alert('任务全部做完了!快去手机端升级红包吧!') $("#message").html(`任务全部做完了!快去手机端升级红包吧`); } }, index * 1000) })(i) } } })();