|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
8 S9 ?( i$ e+ A" p( D; c# j4 p7 i D; E6 J( P# d$ j
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
/ K i1 j y6 P5 I3 L% n- // looping fetch' t- F6 E) N9 C$ [6 u5 O0 d
- var once = function(){
# R6 a/ i9 d9 g3 G! T0 q. J - // original author: https://v2ex.com/t/2281641 q9 V8 U0 Y! u) M: I; X2 f0 q
- (function(window, document) {7 n. p! a* ^5 B p
- var interval = 800;: F- E2 [( t5 K) e/ p" u, n- G8 w
- var closeDelay = 200;
+ s& m4 s! h* X; w. O) m8 j8 u - var index = 0;& @6 O! [8 l* s$ Q0 N' M) q! I5 z
- var couponLinks;
7 @- \ g) M! C4 x! u- I- u - var getCoupon = function() {
1 _8 Y8 }. B! R; | - if (index >= couponLinks.length) {
" o+ t; Q" f8 N9 ^: V z! V - console.log("领取完毕");
( Q8 y- T$ `" ^ p; w! k( C- f! p - window.once();! t. l+ r+ ?( N
- return;* e D3 ~7 B' Y. Z
- }
+ {( N, v/ p1 v( b: L/ {, u - var coponLink = couponLinks[index];% M# P" P8 c+ Q" e4 W a! S1 }1 U
- coponLink.click(); index++;
0 z& ^1 e, O" g# G. M - console.log("领取 第" + index + " 张");
, c! ^' G7 b: t - setTimeout(getCoupon, interval);, c! O/ X8 i' ^: K0 w3 Y
- setTimeout(function() {
6 |) Z; U/ T0 k9 X' h/ U - var close = document.querySelector('.mui-dialog-close');
" A6 c+ F, @: | - if (close != null) close.click();* b. `- R3 ^3 Y+ x, U' |& h3 I% m
- }, closeDelay);
8 T9 o, c4 Y3 e1 D l( W - }
9 \; b* q3 V. n8 S - var _scrollTop = 0;
+ d# F7 m3 y O5 m& ]8 d; p - var _scrollStep = document.documentElement.clientHeight;7 [; l! U$ n- c! D1 P
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
8 F6 E/ a: ~7 z+ c G& A4 @ - var autoScrollDown = setInterval(function() {
* g6 T7 G: P5 e( s - _scrollTop += _scrollStep;& Y' Y, _8 a2 |. E7 ?
- if (_scrollTop > _maxScrollTop) {0 s3 {) V( N- F5 @2 h: g' v& D1 x
- clearInterval(autoScrollDown);5 e, y9 u$ u F) G# c% J1 I) E" p
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');# m( b0 M, B( H
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");* ~/ r! j- H4 m' P) v
- getCoupon();
$ }0 _5 B* r! T C! r0 V" ~2 z - } else {
. K0 z3 R4 V0 v4 D) p - document.body.scrollTop = _scrollTop;8 ~( i8 f _, _/ I
- }
! y" _" {- k% ~ - }, 500);" z) \ O4 A4 l- h3 d0 _- H5 @; s
- }) (window, document);; y. F6 L* D- L% d! o' x0 {
- }- s; a8 C' O$ X ] J. e
- once();
复制代码
/ v" @% ?2 D* U+ H/ F8 X 然后领光所有优惠卷了! ( p7 w5 a8 F/ |; ~( S/ B% l
重要提示:一定要先登录天猫再撸 + K' Y% U! H( M
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|