|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑 1 m; q, k. V5 k* O$ `
4 H) A. U9 d" I, y" d0 E. T右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。2 q6 I5 G7 L9 p+ [0 ]0 ^
- // looping fetch
! i3 d$ k, j; O; @/ j- t: s; T - var once = function(){
. H Q% ^6 p: P; Y C* s - // original author: https://v2ex.com/t/228164( Q1 i2 y# j9 ^- m- X" G* n( N
- (function(window, document) {" p" t( x- \0 s0 L4 \9 `+ w6 S' ~, d
- var interval = 800;
7 b& ~' c# s/ a - var closeDelay = 200;
1 v0 y0 g; d6 ^/ E# P( b8 Q - var index = 0;! Z* p( y4 g1 A" ]. s3 c
- var couponLinks;1 H) |. q) P- _$ p# z0 i' K8 i
- var getCoupon = function() {. G4 W( `7 t% d. [5 M- D& j
- if (index >= couponLinks.length) {
) _4 U) u1 [' \; I6 z; g8 t3 s5 F - console.log("领取完毕");
' w8 k# [# }$ R8 _6 \0 C* N1 n - window.once();
$ q# E9 P7 h% e7 P$ ]: \4 W - return;6 P. X7 M& g# P2 v2 I+ E4 R+ S- ~
- }% w2 T% w2 i1 N- O1 J4 M
- var coponLink = couponLinks[index];
3 c& o* n# r8 ?, E: x - coponLink.click(); index++;
* u8 F( y8 z( X* O - console.log("领取 第" + index + " 张");4 w* b. Y' `+ Y* O0 v6 R
- setTimeout(getCoupon, interval);
2 d5 h+ q3 x) M$ F% b. L6 k - setTimeout(function() {% D2 ^/ y: P$ _$ i
- var close = document.querySelector('.mui-dialog-close');
6 H7 f4 g: s, r3 C3 K" _ - if (close != null) close.click();
' Z* L2 U) d6 i% K; J8 O, G - }, closeDelay);
$ S# V7 j9 ]* c6 q - }6 P1 W& Q) U0 |
- var _scrollTop = 0;
. n. d2 a4 ^! V# J9 f - var _scrollStep = document.documentElement.clientHeight;/ K5 Z* f& ~# h
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
! o3 Q% k- S7 x! p! j: C/ B) U - var autoScrollDown = setInterval(function() {
5 S- ?5 g- Z% a/ T& O" ?6 q- a - _scrollTop += _scrollStep;
3 b1 a3 e. q* r4 `5 } - if (_scrollTop > _maxScrollTop) {* @+ F- |0 d: N/ `2 S
- clearInterval(autoScrollDown);. n! C. l/ g0 O( U
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');4 F5 U9 u2 z2 S! \
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
5 H g! L4 y b% ] - getCoupon();. w$ }: j% }4 x! K
- } else {* b/ a- R1 t2 x+ T; i
- document.body.scrollTop = _scrollTop;" c& g6 x, \" F* t; M7 O
- }
$ q" j2 a, M# V# P8 @; j - }, 500);
; u, X7 y( D3 j8 ^2 v - }) (window, document);
/ G! w- h- X( A) q/ V4 l9 _% d - }
0 y4 ]/ `- p; L$ Y" b3 q - once();
复制代码 2 _! G* B$ J5 x
然后领光所有优惠卷了!
8 q( E$ t# |+ m& j. w重要提示:一定要先登录天猫再撸
" `/ @# n2 k% \* F! z! C3 G( a |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|