|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
$ S4 k+ k. e$ i& k
0 S3 O+ x5 c+ s3 q/ T% `右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。9 u' ]! ~$ n C! G! t' ^ @
- // looping fetch' Q5 ?3 u8 I: y! h }
- var once = function(){; k8 R) ?) H4 M! k" U7 w1 l
- // original author: https://v2ex.com/t/228164: b3 R) m0 f( i' l! e( L- ~
- (function(window, document) {
9 N- S. q% g; S5 r h4 }: l, ^0 f+ \ - var interval = 800;( q$ e; n+ y7 y( w
- var closeDelay = 200;1 R( `0 Y9 @5 |$ w/ _
- var index = 0;" P7 ~8 B" l4 O6 R. c
- var couponLinks;
" f' T, d0 D& j& Q) m - var getCoupon = function() {
1 Q& X+ G. S4 F' I; y" b& U9 z0 W - if (index >= couponLinks.length) {
& s; E* j2 M D( C( k, @ - console.log("领取完毕");- g3 X( Z. R E
- window.once();% U( M$ \6 Q: C) x+ H" N: k4 o
- return;
% q' _+ y$ q( p, Q - }/ W* J1 w# w9 `* \- Q# ]) R
- var coponLink = couponLinks[index];5 H9 z/ ~: Q1 E+ ?, ?4 A
- coponLink.click(); index++;8 m3 ?+ L, E0 U4 g: ]) W
- console.log("领取 第" + index + " 张");
* c6 V! ]% t2 d - setTimeout(getCoupon, interval);
9 e$ m. t: v( ~( y; K7 J# h - setTimeout(function() {
" f7 l* T3 m8 A& P$ U; n, i5 {* |9 \% W - var close = document.querySelector('.mui-dialog-close');
! x3 y" e; [. A/ Y - if (close != null) close.click();8 w6 D" v% Y4 T- C4 F
- }, closeDelay);
2 M1 ^: ]6 o6 [, `/ \" i" } - }1 W& h8 I! v) j; E* @2 v2 Z
- var _scrollTop = 0;7 h" L* w; G- {# i7 t* n2 c
- var _scrollStep = document.documentElement.clientHeight;/ G$ ~; I9 g# @; ^* W& G0 k
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;- U# i' m5 X9 Y# a( }) s! s
- var autoScrollDown = setInterval(function() {+ G) s" S& j$ j0 w
- _scrollTop += _scrollStep;) i% O6 o( j1 \3 K# |
- if (_scrollTop > _maxScrollTop) {, B' _- x$ p% e' a, @
- clearInterval(autoScrollDown);* y* I: }9 e$ Z0 Y2 {
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');5 v0 H1 G/ R' @
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
l4 S+ u3 z( u4 Y6 A- c6 h - getCoupon();
/ z6 r- {6 [1 a5 i" |( y* c! s - } else {
- P2 O9 v/ y7 G' ]! X" ~ - document.body.scrollTop = _scrollTop;7 u# G( i3 L' O" R2 h2 v
- }
: A8 \ b' Z; B/ y0 u - }, 500);4 B( u I. Z$ L0 q- Q8 _4 r4 A
- }) (window, document);
& g: m9 S0 p4 `' Z+ b" f4 c - }7 v- U7 R& s& ~/ y3 I
- once();
复制代码 ) Q$ z0 z& m1 ^7 G j
然后领光所有优惠卷了! 0 \ r, n: B4 C+ Y) S% N
重要提示:一定要先登录天猫再撸
. X9 H# T) ]* }: {4 c2 |. v |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|