|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑 # H- U4 t; y p8 `. F; y6 Z4 V
7 D& }8 u* U' R* m4 _! l0 w0 ~" I
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。4 l! ?! ^* h( M( Z3 m
- // looping fetch' ~# ~8 O' H. K$ P7 y; Z
- var once = function(){
+ x q" c- Y! v' x- l" s! c* s - // original author: https://v2ex.com/t/228164. m) \! W( h6 Q$ \" | ` C
- (function(window, document) {
$ M$ F& _# Z/ D& g) n w* `% c - var interval = 800;- @8 m( p& Y& U8 j
- var closeDelay = 200;
5 O! X, P* J& @. j' C, c - var index = 0;
/ N* s; F6 S4 T5 K) _ - var couponLinks;1 J! t$ `) N" x5 l7 o6 h
- var getCoupon = function() {% z/ q+ {1 j- Q. k
- if (index >= couponLinks.length) {
1 z9 f+ B$ O+ W7 b& @6 c$ R - console.log("领取完毕");+ I! a+ i- w5 e7 D* X3 b" I! m
- window.once();1 h, X4 q l' R" x x+ q% c9 Y! t
- return; @0 P; U' _3 [* Y# [- d7 L
- }/ Y5 t2 a! g. ]+ `5 `8 ?
- var coponLink = couponLinks[index];
Z f5 A6 {( S$ R - coponLink.click(); index++;( ]+ t" h; S. I0 u* e$ t5 @6 b
- console.log("领取 第" + index + " 张");
. x% S; O4 W4 b2 ? - setTimeout(getCoupon, interval);
0 ?7 y; F* ?, z+ ^- a3 a" i - setTimeout(function() {+ q# c( B/ k% _7 `5 q+ x+ p
- var close = document.querySelector('.mui-dialog-close'); u% X1 D7 f3 N2 t7 C
- if (close != null) close.click();6 J6 x: u: o( U8 e7 S
- }, closeDelay);2 W6 } I* @. F+ J1 f# N7 J
- }% Y0 B/ ?& H2 d2 r3 x1 P; b$ c) j
- var _scrollTop = 0;, L8 K1 F& p) n$ E3 ?% W
- var _scrollStep = document.documentElement.clientHeight;
+ ]$ t3 p- Z A) y4 u9 ]4 ? - var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
4 n1 z7 g( y: S7 O _- B/ h - var autoScrollDown = setInterval(function() {1 H! v u9 Q9 w, N# ]
- _scrollTop += _scrollStep;5 P& S1 @3 h+ I" n* @- Y
- if (_scrollTop > _maxScrollTop) {( d0 C9 Y, l7 n, U5 B
- clearInterval(autoScrollDown);
5 O) S% J& P5 x. a8 H - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
) l3 l6 ?6 c \1 D; |. g" k - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");9 x. a* [2 ?, O9 t) C3 j
- getCoupon();
7 D" w, } A& [ - } else {7 M _, }% E Y4 L
- document.body.scrollTop = _scrollTop;2 L A1 E8 P b& O8 s- N
- }6 ]0 _5 Z( d9 a) I: A- R. J
- }, 500);* H& U+ d6 E9 U% d0 x
- }) (window, document);
, Q9 {! W5 ]9 ^% [/ k - }' Q: ]( b7 Y" [; s
- once();
复制代码 $ b e y# R: e5 G# K! E4 i5 i
然后领光所有优惠卷了!
+ i$ W. _) V. i- @, D: v重要提示:一定要先登录天猫再撸
2 v; l. ?; @/ |5 f7 s6 K* z6 d( a |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|