|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
7 Q5 c: X5 G- |+ c2 R9 \: _, g D6 p1 R; d8 `
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
. W" t0 a B) ?0 v* a# M. l- // looping fetch
4 m2 d) C" M& P9 }! T; ~3 E! U0 i5 g1 t - var once = function(){0 R# O. U( `% s4 p( D# s$ F+ W0 j0 n
- // original author: https://v2ex.com/t/228164
. | m2 F9 T/ L( ^% D - (function(window, document) {1 u+ F; J/ u1 N
- var interval = 800;
$ u# e! J, W/ H, L8 { - var closeDelay = 200;7 i! m. V. {+ ~
- var index = 0;0 U/ `" r/ V( k# U+ O+ k4 G
- var couponLinks;
2 }1 ^* A" ~# H4 ?8 A - var getCoupon = function() {
^$ f W2 S0 D' P j0 Y1 e/ w - if (index >= couponLinks.length) {' t( F( S5 R3 J! M5 o
- console.log("领取完毕");! N2 a8 i0 ^! z, n7 b" {/ z- F
- window.once();" M) v3 q) T0 ^
- return;- v( R1 }9 B: q+ D$ n: j: [: i
- }' i1 b' b4 l" C" C! g
- var coponLink = couponLinks[index];# J: V- ^, x" p) b3 ^& p7 n2 G
- coponLink.click(); index++;7 K! Q0 g. N4 g- a- Y2 b: P Q
- console.log("领取 第" + index + " 张");/ V# D( n5 ?1 w+ ^% R1 C
- setTimeout(getCoupon, interval);
: \/ v- q- R6 S1 p - setTimeout(function() {5 g% U" m- a- Z' ~& n& _5 T! F
- var close = document.querySelector('.mui-dialog-close');
4 e2 c g- n f; j3 d# E8 V' b - if (close != null) close.click();
* j) Q% p1 R6 n1 a9 g1 v v' w - }, closeDelay);
( S/ X. V& t# q6 E* L& ^ - }6 d% g( y% r, @$ r
- var _scrollTop = 0;% G+ M3 a) N% N4 h! r
- var _scrollStep = document.documentElement.clientHeight;
, ?6 @* X6 `' q& i- p+ G - var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
; f# E: f. x4 C0 C- l+ n5 L, o' E. d - var autoScrollDown = setInterval(function() {* i* m4 P, l( o" ?$ q0 b
- _scrollTop += _scrollStep;
& Y6 g3 I, h6 } n& Q - if (_scrollTop > _maxScrollTop) {$ R" w2 f+ @( m$ f3 c! Y
- clearInterval(autoScrollDown);- Z5 {$ B* Y- a& K2 ~+ q% Q
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
1 _" o% L5 ^6 Y$ @# l5 R - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
) U' m- ?$ s& X5 p - getCoupon();
# \1 V$ O% S" U6 n4 `4 W9 o - } else {
, Z3 d8 P+ A' n5 G% W8 U - document.body.scrollTop = _scrollTop; ^0 T8 \9 q, _4 S% D" u
- }* v/ h6 O. k: k
- }, 500);4 m% a9 P: B( m$ z; C$ {) R, F4 P
- }) (window, document);
, t6 m3 u) F; G! \! A/ E. z- d - }
$ a0 r2 ~: W7 G- }. ]' P - once();
复制代码
5 R ?! R D# P" | 然后领光所有优惠卷了! 5 P- Z8 _% k @1 f4 h
重要提示:一定要先登录天猫再撸
6 z" n. V" n: A |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|