|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑 9 U& X; x2 `& r$ o8 J- M) d
8 D: |; I2 k% o: C右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
5 s: Q4 ~* X$ j' l, n/ S- // looping fetch) t3 U7 g/ M% Y! \/ P$ {5 _- n
- var once = function(){
) c9 z/ i/ Z+ Q - // original author: https://v2ex.com/t/228164$ k( g8 \, ]7 J: l
- (function(window, document) {
0 S6 A3 g5 a) A) y2 p - var interval = 800;
+ X* B: x! b( J# p. X2 n% o( ~' J- J - var closeDelay = 200;
9 I' J! L; a- r* w3 s - var index = 0;
6 a. t! f! i( C - var couponLinks;
% a0 _5 r7 }4 v, ^3 U9 M/ t - var getCoupon = function() {
! w' h/ Q. E/ w6 K. I - if (index >= couponLinks.length) {
. [) `1 f7 I& W& o - console.log("领取完毕");; i5 @2 a; E( J3 n+ j( ?
- window.once();* t8 M W& B- U! m! c1 M( {
- return;& k4 u) {2 B& z
- }
8 o5 s3 {6 y( {2 t3 N( | E5 h - var coponLink = couponLinks[index];+ L( r5 T. ~ K7 ~5 v5 l1 S
- coponLink.click(); index++;
4 N* B4 U5 C. [7 y% b - console.log("领取 第" + index + " 张");
0 [ r9 S8 S N& c7 ]; v - setTimeout(getCoupon, interval);5 o) r( d0 Y) {; G1 T; z3 [3 V' e! L
- setTimeout(function() {5 |7 |% Q0 w- J2 g% U1 }
- var close = document.querySelector('.mui-dialog-close');
4 b( _$ F) p2 a, N8 f1 G' e- m - if (close != null) close.click();
5 J9 H5 z/ u; y. z - }, closeDelay);
. ~3 }5 n. t7 u: A* H - }- Y' U! ~. G3 X2 o$ u/ E4 ?
- var _scrollTop = 0;
+ [! k3 A2 n& H8 |$ y ^ - var _scrollStep = document.documentElement.clientHeight;9 l8 I$ H" K0 e4 N+ ]* H
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
4 x& D; j- d# e( ^# y$ N - var autoScrollDown = setInterval(function() {
' u1 c% h9 o$ F6 Z% _: Q5 e - _scrollTop += _scrollStep;" v; ?- ]3 N/ L* S, M0 x
- if (_scrollTop > _maxScrollTop) {
: A1 F. |5 N) C- }0 U - clearInterval(autoScrollDown);3 \. M7 `3 s# i/ z v
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
& p: _- ^9 {6 R% A0 d - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");2 |, c+ O$ w) L6 r5 y
- getCoupon();& I+ F2 r6 w( w" n& ]9 b$ J+ V* K
- } else {$ b- M7 h/ E7 Z) H+ D; @
- document.body.scrollTop = _scrollTop;
' m: l5 h. ~3 T5 ` - }% X2 l' Z5 J- Z- ^
- }, 500);6 B/ F( X# f# p" o
- }) (window, document);1 q3 A1 ]# P# r2 Z3 T4 A. o. t
- }5 p/ }- ^; K- g' e/ x
- once();
复制代码 ! F" ]% ?+ ]$ u- F
然后领光所有优惠卷了! ) Y8 f) G. X$ C2 u1 x5 A
重要提示:一定要先登录天猫再撸
0 R# M @+ [4 k1 A5 { |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|