本帖最后由 riskstar 于 2015-10-15 14:53 编辑 # ^' |- z0 {. v6 _3 G% O5 Z
7 S! ~8 h" N" D4 W; {- l% u- W8 t
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
% @1 I! v) |; c1 b- // looping fetch
# p$ i1 t$ I) ~" C - var once = function(){
4 j- w, W' G7 r - // original author: https://v2ex.com/t/228164" W2 a. s, c( A) T- k$ y3 P
- (function(window, document) {
2 S% I9 t. s3 _2 u: i7 ?3 o - var interval = 800;
! M; u% g9 h8 z4 T, ]! d - var closeDelay = 200;
- ^0 v. L" p" c8 q0 {( W - var index = 0;7 N% R% D9 v, K0 G8 ?
- var couponLinks;
: f! d; Q+ o4 | - var getCoupon = function() {4 W! C& n% I4 }8 y$ p% {
- if (index >= couponLinks.length) {+ W$ ~, Q7 e' k( r e3 q6 Z
- console.log("领取完毕");# C5 ^9 x% i& n; f" |
- window.once();5 L1 C/ B4 B' P% R1 R
- return;
, B- k u* i9 z5 u+ v' } - }
: Q% v& ]( F( j/ g - var coponLink = couponLinks[index];
4 f9 K+ F3 n" o6 _ - coponLink.click(); index++; j& s1 r6 ?* m, s5 m
- console.log("领取 第" + index + " 张");
7 }( @: y1 n( s* K - setTimeout(getCoupon, interval);
( j* x$ h* Y. O - setTimeout(function() { Z* `& P& x0 G! D" a7 M6 K; y/ ~! r! M
- var close = document.querySelector('.mui-dialog-close');
0 C p# k4 [/ P1 f* n, l - if (close != null) close.click();
; L, c7 g9 a$ c! b - }, closeDelay);9 M! d% O: ~: f( M
- }: P. C1 y. E$ c* R
- var _scrollTop = 0;
9 y" A* G% w1 G7 d% B - var _scrollStep = document.documentElement.clientHeight;4 C& U: L* C1 D1 H4 ?& |
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
: K$ [* Q+ F( w' N - var autoScrollDown = setInterval(function() {! y' y. ^$ J, K$ k- g# J) x
- _scrollTop += _scrollStep;& P" D3 c' c2 N% O
- if (_scrollTop > _maxScrollTop) {; [- l3 A0 Z& o# @1 k
- clearInterval(autoScrollDown);
, J, A& \& Z8 i, ^ C - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');- X# ~' T$ j9 v' f T
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
! h; m" G, S1 T2 I# H - getCoupon();
" }+ H, Q! s" v9 H0 g( n: O& b - } else {) b d6 t+ F) z& l9 [: s! B; L" }
- document.body.scrollTop = _scrollTop;, G2 T& i b1 w+ T6 b. A7 q
- }% \* i {0 B9 U
- }, 500);
( o0 ?: N# I, w3 N6 L - }) (window, document);
7 L+ P* e6 @( f+ A - }( E+ M4 f- g3 u% f8 q4 y
- once();
复制代码 / D% L2 r. k* ^7 n; d
然后领光所有优惠卷了!
# J5 g- R! N/ a6 f; W% U重要提示:一定要先登录天猫再撸
' j, I, z- M0 e9 p |