|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
8 n/ z8 K1 H& ~, ~
! P3 r# e W3 ^右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
8 ] A: |( I9 q4 ?- // looping fetch" s8 q! F9 ~3 K
- var once = function(){5 d( @5 Z1 G A) ]1 S
- // original author: https://v2ex.com/t/228164" R# g* e# C3 D8 P* J7 a6 V
- (function(window, document) {
) X' j2 }2 |$ f' Z3 p - var interval = 800;+ p' I4 h% o: t3 X4 N$ v
- var closeDelay = 200;
6 ^- y6 M3 N2 D* `; C* v- m+ [ - var index = 0;: n* H0 m1 T7 P- I( |5 T3 O
- var couponLinks;
0 v" {+ h$ f0 e5 W8 g; {" j - var getCoupon = function() {
( X! }2 T! R% _! H. J - if (index >= couponLinks.length) {
8 o" h7 ^" q9 n$ q8 U5 M {, @ - console.log("领取完毕");' E: I" K7 f7 N' i+ F/ @
- window.once();
, _+ Q5 Z8 M% n9 ]1 N$ X5 w' g# r3 _ - return;1 _) |, q/ v8 K
- }. x4 Q4 V J# i3 z9 \1 u
- var coponLink = couponLinks[index];
; _0 s% v Q8 Z) R+ r4 F, Z - coponLink.click(); index++;5 @! o$ r+ m% k2 V6 C: k; ?; p
- console.log("领取 第" + index + " 张");5 b" a* o: C' X s6 W
- setTimeout(getCoupon, interval);8 w S& X+ N5 V7 h# S9 p8 c& j6 d
- setTimeout(function() {& S1 D0 {# `6 G/ z3 ]) E% l0 _
- var close = document.querySelector('.mui-dialog-close');7 z3 R0 ?9 F9 y
- if (close != null) close.click();
: ^( c/ Y6 n2 K5 n - }, closeDelay);% ?# Q$ r1 v! T' U/ h6 {
- }( D# {/ e. `) l7 i" _/ F; ]5 P& J
- var _scrollTop = 0;
8 r6 U3 O' u: K" [8 r2 j4 y2 Y8 i5 i# @' e - var _scrollStep = document.documentElement.clientHeight;/ ]1 s# E/ L5 U' K. i
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;; x3 Z5 j/ L. g' H# h: c* l
- var autoScrollDown = setInterval(function() {+ [ ?1 ^5 |6 _! I& j
- _scrollTop += _scrollStep;
1 ] p" C, Z* @- J7 B* A$ a( Y% h5 O - if (_scrollTop > _maxScrollTop) {) d) U, P7 r1 g( Y9 j1 O* N
- clearInterval(autoScrollDown);; R5 { J D" x( f3 H3 Y6 F
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
& O' U+ U' m9 X6 b2 {* ? - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
; x2 r, }( n( }, S5 V - getCoupon();
( ?0 ?7 I* D5 S9 V& H9 c - } else {5 E8 w' J) G0 {7 v% e7 G3 T0 ^) ^! i! F
- document.body.scrollTop = _scrollTop;9 G; L! b( f& w- f
- }/ g" S) \$ Q! ?, }6 D
- }, 500);/ k: h* v. C$ `8 i% _
- }) (window, document);5 j$ j. o, A# A. W
- }
8 l$ s3 r! {+ z( Q5 T% Y3 [9 I1 T8 x - once();
复制代码 / j2 m6 G( t8 \& R! U
然后领光所有优惠卷了! ! }3 @( x: J& R0 A, ^, g' j& {
重要提示:一定要先登录天猫再撸
: |! U5 Q+ k) p/ e. R# T; _ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|