Last active
March 2, 2020 02:13
-
-
Save shanlanCoding/171e8ef3654bc20c935c3ab8b752a335 to your computer and use it in GitHub Desktop.
京东捡漏代码
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
alert("自动捡漏开启成功,请按下F12 -> console查看详情"); | |
console.info("1.将需要捡漏的商品,加入购物车,通常在电脑京东页面手速快点就可以达到"); | |
console.info("2.从购物车点击结算按钮,进入结算页面"); | |
console.info("3.打开F12,点击右上角的手机图标,进入手机模式,按下F5刷新网页,不出意外此时会进入手机订单结算页面"); | |
console.info("4.将本代码粘贴到Console内,按下回车键启动"); | |
var sleepNumber = (Math.floor(Math.random() * 8) + 11) * 1000; | |
var loopNum = 0; | |
var startTimer = new Date(); | |
var btnPayOnLine = document.querySelector("#payBtnList > div:nth-child(12) > a"); | |
btnPayOnLine.click(); | |
setInterval(function () { | |
console.clear(); | |
loopNum++; | |
btnPayOnLine.click(); | |
var noCommodityWindow = document.querySelector(".mod_alert_mask.show"); | |
if (noCommodityWindow) { | |
setTimeout(document.querySelector(".close").click(), 300); | |
} else { | |
myNotifincation(); | |
} | |
console.clear(); | |
var endTimer = new Date(); | |
var date3 = endTimer.getTime() - startTimer.getTime(); | |
var leave1 = date3 % (24 * 3600 * 1000); | |
var hours = Math.floor(leave1 / (3600 * 1000)); | |
var leave2 = leave1 % (3600 * 1000); | |
var minutes = Math.floor(leave2 / (60 * 1000)); | |
var leave3 = leave2 % (60 * 1000); | |
var seconds = Math.round(leave3 / 1000); | |
console.info("运行了:" + loopNum + "次,本次执行延迟" + sleepNumber + "毫秒\n总耗时:" + hours + "小时 " + minutes + " 分钟" + seconds + " 秒"); | |
}, sleepNumber); | |
})(); | |
function myNotifincation() { | |
Notification.requestPermission(function (status) { | |
console.log("发起Windows通知"); | |
var n = new Notification("京东自动捡漏成功", { | |
body: "京东自动捡漏成功,点击打开我的订单", | |
icon: "https://jjbcdn.zaoshu.so/favicons/jd.png" | |
} | |
); | |
n.onclick = function () { | |
window.open("https://order.jd.com/center/list.action", "_blank"); | |
n.close(); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment