|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
* g4 v- R; F4 i. ?6 _
) X3 O% b8 [1 W% h6 L! ?& I右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。8 l1 }" D5 F2 W' K/ e1 Y* L5 c
- // looping fetch& K- |$ S8 B3 S! g z( s
- var once = function(){- e: R# n K( I/ w' C3 p
- // original author: https://v2ex.com/t/228164
$ {' ]0 o' O/ L8 e$ b- B: h0 c - (function(window, document) {
8 E$ R8 |* n. B4 U7 y( T: X4 M" | - var interval = 800;! s- u8 ^ B# [) C' Y
- var closeDelay = 200;
. u4 O; z% h9 @1 r( s6 L7 ? - var index = 0;
* O2 c2 w, \' H' j3 t" [. t - var couponLinks;
3 \- i6 y( f% e1 e6 z, b - var getCoupon = function() {. O7 L9 b* b6 Y
- if (index >= couponLinks.length) {
) r k6 j n$ E% X2 A5 [6 S; o - console.log("领取完毕");7 B) H7 N! ~6 x2 H2 k$ T# ^- c2 z. F
- window.once();$ R, ~( ?0 |" s' B0 {$ r g
- return;
7 v6 E( V. z- ^% @ - }
: {+ h( ^: |" c# s - var coponLink = couponLinks[index];" R4 T5 I) ^: O! P: `
- coponLink.click(); index++;$ d( X" D: I3 Z0 G8 g' L, Q- C
- console.log("领取 第" + index + " 张");5 x& ~( B2 }' O1 }6 `" K3 Y& e" S, S- ~, O
- setTimeout(getCoupon, interval);& e( T) m7 ?8 f
- setTimeout(function() {/ w- I4 C0 P: h7 R6 j& u+ G% m2 s
- var close = document.querySelector('.mui-dialog-close');/ @: A2 V8 n1 u8 H! X
- if (close != null) close.click();
6 b- _- U: O+ |; R+ f - }, closeDelay);3 G% L, r: F6 ?8 S, N
- }4 M7 v! V# s$ Y. C, W2 w
- var _scrollTop = 0;
' C. ~( c$ w- Q0 t6 J! s6 u - var _scrollStep = document.documentElement.clientHeight;
3 h/ P7 F' Q0 U" x3 V4 m - var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
* N: ^; m3 A. O - var autoScrollDown = setInterval(function() {
/ O4 |" M0 z: \ N - _scrollTop += _scrollStep;3 Q* x7 C/ ]8 B/ B4 X
- if (_scrollTop > _maxScrollTop) {
% W! {3 U3 T8 q2 Q5 _2 d+ G+ `0 H - clearInterval(autoScrollDown);0 f h% E5 b+ J6 L9 X0 ]! v# L
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
: g/ s# m& e* }' h' Q - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
5 ?5 W' J7 ]0 p& {4 o K - getCoupon();
. P* {; H3 }4 P" B( |0 ~ - } else {
% G: x9 R- C2 V$ y; L! u, x - document.body.scrollTop = _scrollTop;; j+ a3 d7 Q# {* J
- }( ?8 O. \0 ~7 r1 I* f
- }, 500);
/ k$ P9 n" n2 i! F! E. p* B8 f - }) (window, document);
; {, S! | m3 o& B - }" e9 q7 d% }+ F7 |1 Y. |; J! J1 M
- once();
复制代码 3 | `1 H! L. W# B6 J' V
然后领光所有优惠卷了! % D7 H" R# O/ J5 D9 V
重要提示:一定要先登录天猫再撸
) k3 I$ ?7 Q/ w% b: K |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|