|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑 ) x/ h" d Y( J% o' d% R
. @* P$ w' v5 U+ b# i右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。6 W$ {' U/ G+ t
- // looping fetch4 T( J9 ?7 s2 e/ a3 C" B* O! t
- var once = function(){
7 |. x+ [1 U# F3 @9 W# d& N' G - // original author: https://v2ex.com/t/228164, o5 `" M2 R0 U- |4 |
- (function(window, document) {$ H% t' e& y$ u8 f5 m! w P4 C
- var interval = 800;! S/ M0 }% h8 f' F5 p) O D) n
- var closeDelay = 200;
4 m1 Q& c+ F) P, e4 i9 y9 g2 ]/ J+ K - var index = 0;, X- |3 J0 @3 h: j4 [ v! T9 x
- var couponLinks;
# @& k u* C( _/ C* y - var getCoupon = function() {6 h% c+ ^5 d! r1 T! F; z# F
- if (index >= couponLinks.length) {
' e& k; d. Q* y8 X - console.log("领取完毕");! F/ W5 l" @7 _ j% u
- window.once();: U g1 z, K; c0 T e* ]
- return;' T1 y O+ Z7 F5 w
- }' F0 E6 y/ L5 c) C4 w0 W
- var coponLink = couponLinks[index];) U! r' ?' n* y" n0 h
- coponLink.click(); index++;
9 I: W( d. _/ L& W4 J - console.log("领取 第" + index + " 张");
) _6 k7 B2 v6 C8 C$ I - setTimeout(getCoupon, interval);
9 [5 ^9 z$ F' {; V9 X5 @ W - setTimeout(function() {
- m' ]* ~& C& U" {4 S - var close = document.querySelector('.mui-dialog-close');
" ]( M0 n$ B- Z( K9 S5 q - if (close != null) close.click();) T+ N9 ?; d2 ^, p8 S
- }, closeDelay);1 r, S5 t K# T5 p
- }
. @0 O) z& {6 `3 |( _4 f( d) F - var _scrollTop = 0;
7 i, x! s; s$ y- v' W2 V - var _scrollStep = document.documentElement.clientHeight;4 P4 X9 G6 X& J
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
B0 M5 z; h) ? - var autoScrollDown = setInterval(function() {
( {* w' _5 q A# {5 k - _scrollTop += _scrollStep;
1 i5 B+ N3 {; P7 h - if (_scrollTop > _maxScrollTop) {" f# H4 s7 i4 k! V$ O
- clearInterval(autoScrollDown);
/ t* V5 T2 x* ]: @7 j - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
9 n' V z7 s: l, ~8 U - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");7 n+ D4 M- a; C" p5 v
- getCoupon();
; s( _) p& l8 ?$ i7 x% S - } else {# Q9 w. i- l& d* j7 H4 Q8 Q M6 Q3 b% C
- document.body.scrollTop = _scrollTop;7 e3 X; O* i& D" C. l5 B& |
- }
5 H- ^) o7 r1 M9 @5 V' m - }, 500);
" N2 {) O: i) K1 a5 x2 q5 f/ a - }) (window, document);
- [ w) \4 y2 ]4 J" S$ Y/ P( K - }
9 m5 u" U6 s& j; y6 ~& `! E4 g - once();
复制代码 # W: s) k' ~% R. Y8 e+ ~
然后领光所有优惠卷了! / W+ a9 ^7 C% n8 D9 `
重要提示:一定要先登录天猫再撸 + _7 Z; K. I2 [+ R5 Q6 f/ l
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|