|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
8 p$ h7 |, C' {5 q7 D* ^; J1 T6 m3 N. x3 M# I( B2 e6 ^ N( C8 b
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。' R* F8 z6 V, i0 s# n: Y
- // looping fetch
" _& I# r0 D4 s: } k$ x# q - var once = function(){1 A3 O; d% \0 j$ g2 p' G: ~
- // original author: https://v2ex.com/t/228164
& u8 n/ K5 J( i& Q: F: r - (function(window, document) {' d/ U' s1 q. S/ _- `
- var interval = 800;; C* e0 H7 z T, E$ r
- var closeDelay = 200;& D" |2 o$ {' L+ l" \8 q0 C
- var index = 0;6 c) M) h! [4 h! k
- var couponLinks;
' V4 Z" D7 S# h4 `* `6 H - var getCoupon = function() {
% e6 h& j- y: A( L - if (index >= couponLinks.length) {/ d, i& h& {3 F4 y3 J9 H3 j
- console.log("领取完毕");0 J, \' t3 R1 q
- window.once();
6 l0 p7 d( `' o& W - return;
' H. z; i8 x( H) C, }3 u5 I - }+ @8 K4 D8 D- A3 \) j
- var coponLink = couponLinks[index];5 m0 E+ c3 O4 E1 K0 M' A0 C
- coponLink.click(); index++;& q4 _; ?: a7 D" d* i( _9 v
- console.log("领取 第" + index + " 张");
8 s& L/ ?, |3 m9 a4 T - setTimeout(getCoupon, interval);
9 X" Y5 y7 f* O - setTimeout(function() {
( U% W* n( F. ?6 H5 p* K1 ? - var close = document.querySelector('.mui-dialog-close');6 |: c" x: Q# \# D" J, \
- if (close != null) close.click();
% ?* N# X1 s( W: w4 ~6 F - }, closeDelay);
3 v' {2 J: n, K6 s - }8 e7 K3 u$ s7 {( J2 [6 Y
- var _scrollTop = 0;
- C( Z' I( Z) \! @# l - var _scrollStep = document.documentElement.clientHeight;" Q( ~- O" T- {4 h% r7 q) k
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;( f9 ?) p, h8 q: @. O# m
- var autoScrollDown = setInterval(function() {+ [7 q( E1 |- B
- _scrollTop += _scrollStep;
7 `) C) F2 {; ?- ^ - if (_scrollTop > _maxScrollTop) {* R U8 b+ Q+ ?2 I0 C0 X
- clearInterval(autoScrollDown);
! S! Y. R. K) K - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');1 K0 N: l! R% ?
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");$ r1 G1 d+ n! h, m5 V" O2 [" f' N
- getCoupon();+ [- Y3 m$ n: X c1 L3 L2 {
- } else {
: k# y8 z% s' L - document.body.scrollTop = _scrollTop;
" K" f& s* T$ n% P. P - }, X8 ~) Y7 H8 ?- k! z5 U
- }, 500);0 \; t3 w/ ?5 C6 P' S1 d
- }) (window, document);( d- C1 g+ [; U. `
- }
8 E) L/ z6 f6 ^ - once();
复制代码 * k/ }+ i$ U2 b3 _5 C6 t/ G
然后领光所有优惠卷了!
% b+ _ u/ _3 p( Y3 V" W o; V! t重要提示:一定要先登录天猫再撸
$ s; v6 O! ?6 L' C t |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|