|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
+ m$ {0 P) o3 A* E+ w4 p+ u& h. J- j) Q" l; m9 N( C* n
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。; p. d' \3 ?- L! g
- // looping fetch
. U" k$ z; V7 r7 r; l - var once = function(){
# ^0 G) }) [1 f, ?8 q6 Q i! O- t* G9 S - // original author: https://v2ex.com/t/228164
# L; w l$ T5 k: Y - (function(window, document) {9 D; q' }9 p4 V
- var interval = 800;! z+ I: ~5 f, [/ |
- var closeDelay = 200;
. ?( q Y3 e" p1 Z8 a( [1 I: c - var index = 0;
! E+ {4 @* x' ~$ S6 S. P - var couponLinks;
* \2 k! C) V7 E/ T6 w1 A I - var getCoupon = function() {' Z: V% i6 f5 R8 }- E% _+ Q
- if (index >= couponLinks.length) {
0 h9 S. k3 Y+ n& X& V- A - console.log("领取完毕");1 {" a1 X; Q( V0 z/ W n `8 d7 r
- window.once();
) U1 F+ e, D6 v; W# W - return;
) E" _7 C2 O/ x$ I4 B* V3 x8 Z% k - }
9 r6 ], b; [7 q - var coponLink = couponLinks[index];
( @5 X% v8 K: d, L - coponLink.click(); index++;$ O& F; j. G+ G; C) E% J
- console.log("领取 第" + index + " 张");
/ R: U* ]( ~) }! y- O6 l - setTimeout(getCoupon, interval);
1 \3 ^1 `% c9 } - setTimeout(function() {
) r u, t8 L" \% i" I: l - var close = document.querySelector('.mui-dialog-close');
5 M6 i, h( W+ l; u: | - if (close != null) close.click();
6 C! p* w S& t7 o' S( o7 g" j - }, closeDelay);
$ [2 j4 |- I" m5 Y; F- ~2 D - }* s/ x+ \! e7 c- S
- var _scrollTop = 0; _- ~4 A$ H( x% H5 }7 i6 G
- var _scrollStep = document.documentElement.clientHeight;1 V" U+ [% b, _5 t5 O6 o
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
% ]/ \; N6 ?, s2 ~$ w# t - var autoScrollDown = setInterval(function() {
1 [( B) x! k* n4 A; u9 q8 e6 O - _scrollTop += _scrollStep;
* }0 A; g8 p% [. V [* S" ^) x( h - if (_scrollTop > _maxScrollTop) {
$ T! S9 _6 }! N- D4 z: k q - clearInterval(autoScrollDown);
$ T5 h7 h4 h; U2 U8 X Y: ? - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
1 G* ?/ x: |3 |, S+ g. x4 J - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");' Q( ]3 f) I7 P: m# t( X
- getCoupon();1 i X. m) Z' `6 X: ?
- } else {) T3 o8 K! M% B; a
- document.body.scrollTop = _scrollTop;
9 H/ {, t! ]$ |" G - }
. ^4 F/ c% i( A# j" p, v) E3 o4 ~ - }, 500);
) x% g9 i! r! v( o; n - }) (window, document);. a+ z6 E8 M" ^& l
- }
3 _, @3 y! Q1 V/ o( ^% t - once();
复制代码
' {; I, }; @1 E8 B, ^4 T2 t 然后领光所有优惠卷了!
$ A5 c8 S! M, r3 q% |* m \重要提示:一定要先登录天猫再撸
% C8 l5 a* ~6 C. @ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|