|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
4 I2 C2 l$ ^* }- o; k E1 H! D$ x0 Y4 A- `- w& u: o1 `' K
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。0 m! P( X' U5 \. F9 F+ @, J c- y7 f
- // looping fetch; m) s; Q7 [4 H
- var once = function(){& Q! `, O$ _/ U; Z1 g
- // original author: https://v2ex.com/t/2281642 f+ t& \7 Q, j( b2 l6 [" s- J
- (function(window, document) {
+ P- K6 Z0 a' H, C" d/ y8 H - var interval = 800;1 ?7 i, V$ ~: `1 g$ f
- var closeDelay = 200;
0 @3 @" I, n$ }# W+ ~4 A. t - var index = 0;
" R7 i; W* _1 l& F - var couponLinks;
7 U5 }1 i! U. `! X - var getCoupon = function() {
& n- r3 p I% P4 I# |+ a. j - if (index >= couponLinks.length) {
) w7 q5 ~9 M# W3 E - console.log("领取完毕");
0 K. ]0 \! T, T7 V, \ - window.once();
. X' A/ x$ _( U - return;# n4 d$ e0 D& l1 l( l
- }) X8 H& c6 d2 r7 h7 |0 q3 A* j% E
- var coponLink = couponLinks[index];8 T1 F# W' {6 I& e
- coponLink.click(); index++;4 E( ^/ p7 q c; t. W
- console.log("领取 第" + index + " 张");
# K" t8 R: C2 N8 I - setTimeout(getCoupon, interval);: T; o# J4 N/ _- A
- setTimeout(function() {9 Q/ L; u6 S. V& t1 T" i* a
- var close = document.querySelector('.mui-dialog-close');2 p5 V' f( \/ v, Y9 j( T+ F! }
- if (close != null) close.click();
0 z5 I* x" W- J* T6 K! _ - }, closeDelay);
& l$ |/ f/ b/ B( v9 Z! s/ \ - }2 R$ x: o7 Z x `" X) c T
- var _scrollTop = 0;
+ k4 ~- p) {% n, Z j' [! X - var _scrollStep = document.documentElement.clientHeight;' H: i: n2 V. P/ s7 M8 a2 P
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
3 g' T- a9 J8 m j - var autoScrollDown = setInterval(function() {
; a% b( |; h! L7 \ - _scrollTop += _scrollStep;
. ]- I5 z7 t1 d - if (_scrollTop > _maxScrollTop) {
! H1 D1 p6 F' r+ H: a6 m0 H - clearInterval(autoScrollDown);) w0 S; L8 ^7 A i. R
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');9 W4 R2 s$ \# m; s6 Z
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
w" T5 a/ O1 X% i; b$ K - getCoupon();4 C# o9 j; J4 p/ G
- } else {$ G0 E* T( B& U; n8 S
- document.body.scrollTop = _scrollTop;7 c" C5 E# L& W2 ~2 \! L
- }
7 \) E. d4 H6 W2 { - }, 500);
) x" B% @* x% H% h2 J; R3 O0 T - }) (window, document);
) U. Q# I& B' @: x4 u6 E8 j. O - }1 ?( ^: S6 T j8 D& A9 s
- once();
复制代码 . |+ w( `) o4 F! t/ R1 b( V
然后领光所有优惠卷了!
; A' y* g, _( i& [重要提示:一定要先登录天猫再撸
% R/ A9 j' Z+ l# j. e7 n& ^ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|