|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
: ]1 a2 T z/ ?+ B3 o4 o. e) n' G; @
% T2 s! P- Q P右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
c0 f) G5 \, m+ Z5 @3 r- // looping fetch9 {7 L+ q [0 R( z
- var once = function(){' Z3 j$ J1 R0 \# E. \
- // original author: https://v2ex.com/t/228164
* t+ r) m( C$ t" G) S' `0 K* V$ M - (function(window, document) {
. k( z, f3 c3 a$ l7 J - var interval = 800;
. ]# _9 W! Z- z9 `9 O - var closeDelay = 200;
" g7 r9 @ I- g0 Y7 [) j4 F" T - var index = 0;9 @: ]/ B7 y& S
- var couponLinks;
" n7 b/ L$ R! @/ R* ~ - var getCoupon = function() {$ P: N3 A+ }7 N* y* b$ I6 C
- if (index >= couponLinks.length) {
2 T: A& k; v( H - console.log("领取完毕");4 |0 ?/ q3 q5 L: Z+ t
- window.once();* ~+ r R5 B1 ~# o3 Y% [6 R- G
- return;! [$ y% |2 a+ r5 E, D
- }
1 ]5 ]3 P8 c" U! d( o& T - var coponLink = couponLinks[index];
3 ]/ f& s2 f- J) y - coponLink.click(); index++;
: e& {* B8 @/ a. R* q y3 ^ - console.log("领取 第" + index + " 张");# ^6 }6 M% m# S5 n1 I* {: x, Z% M
- setTimeout(getCoupon, interval);* U) ^: I: [! y. f1 S
- setTimeout(function() {2 v, g* j! s+ ^9 N+ L+ q6 q) I. S0 i
- var close = document.querySelector('.mui-dialog-close');
9 R& e$ O$ H/ T% P% Y0 J/ u - if (close != null) close.click();9 |& r, r$ R$ k9 j' \! k
- }, closeDelay);
0 G0 j- S, }- H* ^. P* A - }3 U5 S2 Q9 |) k3 f% X& m6 J
- var _scrollTop = 0;
/ P1 o; v0 k! f2 e# q' z4 K% j - var _scrollStep = document.documentElement.clientHeight;' ~' V6 j4 g9 g( k
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
, |! ~" x* a/ y - var autoScrollDown = setInterval(function() {
* Z6 Z, N' q$ }2 _* U; o - _scrollTop += _scrollStep;
! Z4 \8 r7 u+ A9 m% Y - if (_scrollTop > _maxScrollTop) {4 o- F5 a& ]: o( k) G
- clearInterval(autoScrollDown);
! ^! S5 f4 `( [- l6 t - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
) Q1 h1 c% _% a* S - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");2 X5 r7 E1 l6 s& H* c
- getCoupon();" r2 s6 D; a9 b- J, g
- } else {
6 l3 {1 \& c% \+ Z) @ - document.body.scrollTop = _scrollTop;+ u" Z2 `( @: f0 I% n7 b9 c
- }
: a7 Z7 h% ]8 ^2 T - }, 500);/ }& f4 m- x& x# q
- }) (window, document);
/ g: n% W$ l# l - }
& z( m/ \% |2 s7 D% T- O; r! z! { - once();
复制代码
% c; x I5 e/ `3 i" F& P7 ~$ ^ 然后领光所有优惠卷了!
9 y+ \2 q9 C+ q. c" b重要提示:一定要先登录天猫再撸 3 e* B# g( r7 }
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|