|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
% n- c; h2 g2 r( ]% u. m8 E4 \8 v* R Q2 R; F
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
- Z; X) J6 f! R6 k) Z& p- // looping fetch
) R2 e. W! z& e* k - var once = function(){5 _, \ }1 r0 x& b; ?8 t
- // original author: https://v2ex.com/t/2281642 k7 g S) L1 ]# X/ ^3 V* b1 m
- (function(window, document) {
, a" x2 @: O- z2 W: \8 M" e - var interval = 800;
0 ]: ^! w+ Q7 ~) V" q - var closeDelay = 200;( N: Y3 w. C9 M0 Z3 M: z
- var index = 0;
: M" ]7 T3 Y; W' `0 w# c - var couponLinks;
& H. `' e# X4 u% ]8 [0 p - var getCoupon = function() {
) ~* Q+ q3 P' j Z( x- |* y - if (index >= couponLinks.length) {
$ g$ S2 X4 l$ a3 K: X# [ - console.log("领取完毕");+ Q5 k: P' c6 ^% p& y$ V. N
- window.once();
9 \1 F5 z7 i; v, E) y1 } - return;
# Q5 g, z) w a/ f/ g* C: h - }2 O' W2 O- G: F' h" e9 b' `% O
- var coponLink = couponLinks[index];
3 i+ R: J/ l8 V3 S8 m - coponLink.click(); index++;
8 x( X% j& f \3 c9 Y+ r+ @% K% q - console.log("领取 第" + index + " 张");
5 g4 ~9 E+ H5 |$ x6 s - setTimeout(getCoupon, interval);
; [" W( x) r& g. d - setTimeout(function() {
S$ c7 u3 Y; k% f7 F, t3 A! i6 d - var close = document.querySelector('.mui-dialog-close');7 @1 X3 l! r5 B% Q8 l k8 G
- if (close != null) close.click();
/ t/ K& t8 n4 |+ O/ y - }, closeDelay);
7 e# Y1 d5 ?1 @7 G - }% `: L/ |; j& k" n
- var _scrollTop = 0;
4 J3 g" L1 ~' a. ] - var _scrollStep = document.documentElement.clientHeight;
* X7 k I! q. `1 ? N/ x - var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
' g" b: \# _2 Q( y5 O @ F. r - var autoScrollDown = setInterval(function() {/ [) S* l; A9 V2 V: X
- _scrollTop += _scrollStep;9 ], }: W j; {: D7 @
- if (_scrollTop > _maxScrollTop) {2 m3 }" B% G0 w9 g5 P
- clearInterval(autoScrollDown);
; j- ~# l1 d9 g4 u2 l+ |! |4 y - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
6 J9 ?& Q5 N! \# g - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");/ G. c2 g+ d2 y3 Z
- getCoupon();
5 e9 y$ c( ~# D \) q - } else {3 U6 X b: K# n# X; }3 T, I
- document.body.scrollTop = _scrollTop;
% `! Z! k2 M9 A+ c* m - }" T* {' i- f! n) l0 V
- }, 500);
# c$ E9 y5 I8 @' F6 _( S! |$ M - }) (window, document);
7 \' B" a$ y! z" N$ o - }1 |" {+ x' I; E4 U7 C( u9 e
- once();
复制代码
* `8 X# S4 `5 Q. q! s 然后领光所有优惠卷了!
/ J8 b2 R6 E+ _" V" Z! V; r重要提示:一定要先登录天猫再撸
# v4 n4 J( _. Z0 s; L* [) S! X& N |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|