|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
+ V$ F9 x" O6 y8 F! f/ g8 T3 C6 d! t3 t& W- K! K+ d' y
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
4 ^6 k. u) `, Y- X$ L- z4 K- // looping fetch8 ~! u: L4 K6 ?0 v8 O+ M
- var once = function(){
7 Q$ C# w. u+ Q, e K: m( H - // original author: https://v2ex.com/t/2281645 u- ~; `% B. i8 c1 I2 ^1 K2 L
- (function(window, document) {
5 z, E4 `+ B$ x1 Y. H; ^+ z - var interval = 800;4 o$ b% V, f8 H" Y+ H
- var closeDelay = 200;
* U0 A/ o- r! M! u4 T2 I' e8 w1 U - var index = 0;
% Y7 ~8 y! U+ A9 N! @' D - var couponLinks;( H- G9 p/ @$ N% w# [* M: H; L
- var getCoupon = function() {$ r% Y5 i3 c# s) \+ m- }$ l0 O
- if (index >= couponLinks.length) {: k6 L+ `$ k% B- H m4 v, S
- console.log("领取完毕");7 C% m9 |+ e' L3 g A
- window.once();
/ U6 e) |0 w# ~( M5 P" @ - return;! z; s! K6 {5 ?) w8 r' \0 g5 l
- }
4 {0 V% k' \3 O: Y - var coponLink = couponLinks[index];* @+ ]0 u7 E8 n5 l
- coponLink.click(); index++;& p+ h+ C3 u; j( u5 ^9 r: g
- console.log("领取 第" + index + " 张");
8 w; ^0 e. U+ s( W - setTimeout(getCoupon, interval);
. @8 i) ~) R o! a6 Z+ j - setTimeout(function() {" v0 Z3 ^# _2 l- ]
- var close = document.querySelector('.mui-dialog-close');
4 A F! M) k7 N" | - if (close != null) close.click();
" r( q: m: [: k ?: a5 Q8 H1 D( j - }, closeDelay);* m k3 m. w6 K% R/ h: [( q0 y
- }" N) H, S% ^" _/ Q$ F0 ^# X( t
- var _scrollTop = 0;( C, o, P$ @/ s5 V; b% v
- var _scrollStep = document.documentElement.clientHeight;
9 r2 K5 O3 w! x; c$ |$ N - var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
5 } c K' n' l" F i+ x - var autoScrollDown = setInterval(function() {
0 D# N: s+ ?: y$ C5 Z - _scrollTop += _scrollStep;! h5 M7 q% y) @ F: ~9 x4 M7 e
- if (_scrollTop > _maxScrollTop) {
3 }3 n/ u- C, c- h; y7 r! k - clearInterval(autoScrollDown);
. @# L4 b( A/ x% u - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
" A% ~' L1 G8 c9 b' I - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
|4 v! D8 V A6 R* j6 ] - getCoupon();
% {+ w+ ~3 m% u. @ - } else {
/ `# H7 H* K7 h - document.body.scrollTop = _scrollTop;
. J2 @2 O4 p/ D7 h& O - }
1 J' V' x0 E# \3 v# ~# A& n" M5 E - }, 500);2 {) J8 n- I) ]) X$ x: }
- }) (window, document);
" z% U( `# U# [9 }( [( } - }+ e' ]- q8 ~0 \
- once();
复制代码 9 T9 f: L4 j7 F7 n! a7 \$ [2 g
然后领光所有优惠卷了! ) b. C" g$ t: a" t( s" {4 R$ _/ ^+ o
重要提示:一定要先登录天猫再撸
P" j/ }4 b" b |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|