本帖最后由 riskstar 于 2015-10-15 14:53 编辑 $ ]# X5 ~$ }. d U4 G& I8 o/ H( k
, }2 _$ ]+ o# W! C7 u右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。/ G9 i' O) `6 A% d' z6 P0 U0 P. M
- // looping fetch& x3 J6 }& C3 F
- var once = function(){
: \: z( D' a, F - // original author: https://v2ex.com/t/2281644 X) H0 Z6 ?& \$ U
- (function(window, document) {/ C5 J$ z. n. G+ v5 c8 P7 F
- var interval = 800;1 n% K( A* T& ?8 T. A" Z3 J! {5 l
- var closeDelay = 200;5 I) K0 X& S% D$ `/ i
- var index = 0;/ W7 f' S5 q5 d _% K& Z
- var couponLinks;& Z- V" ^3 K4 z# M
- var getCoupon = function() {# ?9 o& h5 P$ @; n K
- if (index >= couponLinks.length) {
- b) C* B( }3 r! Y; X7 S - console.log("领取完毕");
/ x) |) V3 b' w; W$ {& L- o - window.once();8 o9 ]5 H0 Z3 F+ w! z
- return;
; {" q9 x; |( J& _& q5 X - }, ~7 v( U1 i, B( ^; N% L0 u
- var coponLink = couponLinks[index];
" c: j: L! u+ ]9 v0 h' h$ y6 V/ q+ Y - coponLink.click(); index++;. }' J6 |1 s( r
- console.log("领取 第" + index + " 张");7 S9 ^4 X) ?6 |" _- e! Z
- setTimeout(getCoupon, interval);
c& f. \6 c8 v5 p - setTimeout(function() {# Y0 H5 e h" R, |' \6 p/ s
- var close = document.querySelector('.mui-dialog-close');
" i. i& E6 Q4 y* t( A - if (close != null) close.click();1 ?8 o2 Z0 L q2 U: n7 x
- }, closeDelay);4 J" J& z9 q" k7 q$ l9 s
- }# f$ X) M# N) f# ?2 L, D
- var _scrollTop = 0;
) ?, e M, R9 f# U9 @ - var _scrollStep = document.documentElement.clientHeight;
- p Z7 g+ ?; t2 [ - var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
' k* }$ s- j& q - var autoScrollDown = setInterval(function() {' q8 m6 S2 F4 r/ F; W9 F
- _scrollTop += _scrollStep;: F4 z% f: c! k" l
- if (_scrollTop > _maxScrollTop) {
' D6 V2 B# ^# C9 ^ - clearInterval(autoScrollDown);3 Q+ V! b, k) \( n: E
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');& O1 V1 p1 W' P4 b0 s
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");) F6 G0 ~9 `% N: \4 m' g. K, ]! k
- getCoupon();
: `0 Q! p% b9 R9 r9 F( p7 H) c - } else {
, }" `1 [, N, K+ W - document.body.scrollTop = _scrollTop;
+ E r1 F, m' b9 a - }
( K; Y, G) Y* F1 g4 } - }, 500);
6 G0 [1 |" t2 j! N1 C' } - }) (window, document);, M5 J3 j; ?4 E* Z, R, P
- }
6 t6 U; X2 v4 \+ u+ J4 ^ - once();
复制代码 + E, u7 A! T0 s9 y, q
然后领光所有优惠卷了!
+ h6 O' o+ w2 t2 \6 f* ]/ V重要提示:一定要先登录天猫再撸
1 }% @! d2 d: y& r) ` |