|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑
% L: g5 ~# h/ g0 p! ^7 D
" [0 P ?8 Y+ ?; M% e9 v& Q( x- g) f; @右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
+ R9 i- I$ e( X0 x/ ~- // looping fetch
; H! D" ?& ]8 W - var once = function(){4 [; T! r* `" i/ N
- // original author: https://v2ex.com/t/228164. |& D; E! `0 h* L
- (function(window, document) {
( j8 V8 D( k" z& j - var interval = 800;
7 M+ u" Y7 u% C- I( m - var closeDelay = 200;* |0 h6 j" @3 R8 W; a1 S7 E
- var index = 0;
% c' X7 R9 q! l" l3 }6 z - var couponLinks;9 F% l, e4 c' K6 X" [# U+ B0 \
- var getCoupon = function() {: r8 C2 Y( z5 j, I& I" U
- if (index >= couponLinks.length) {
% P4 j/ {5 y- ^7 r, L% c% b - console.log("领取完毕");0 m `$ ~+ C/ O% q$ |
- window.once();
2 G8 m6 v9 S6 V! I& f) L - return;& h) K- G! j! n9 e( I1 O
- }4 p7 p/ B- `# K
- var coponLink = couponLinks[index];
$ @% W* C# T& p) F: O - coponLink.click(); index++;& j0 T" R j9 G) |- i3 i
- console.log("领取 第" + index + " 张");
2 x0 X5 T1 N: X& o. { - setTimeout(getCoupon, interval);+ b( j& l9 s/ Z6 }
- setTimeout(function() {6 X& J" i! g0 K! E
- var close = document.querySelector('.mui-dialog-close');& E9 F0 z: s& W1 T' f6 r, _0 V" N
- if (close != null) close.click();
, q3 K X1 A) K+ P1 a. _* u& B - }, closeDelay);/ r0 }: |' F$ U/ `# o" F* @* j- t
- }
/ I4 @$ A- X; B/ u( q0 { - var _scrollTop = 0;
4 h2 b* I. I9 a0 A( y - var _scrollStep = document.documentElement.clientHeight;& w9 M3 m+ \: e, g
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
" e+ ?5 l/ L! _; D) K' N. g$ I - var autoScrollDown = setInterval(function() {
, f& ?! M8 b, \9 Q1 Y0 @8 i - _scrollTop += _scrollStep;
5 g- O% z( U; Z! T1 j! r - if (_scrollTop > _maxScrollTop) {
- q) T) A9 z# B, U& z1 D - clearInterval(autoScrollDown);# q6 U7 T8 i8 R
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
2 ?/ u# r# O. K/ A' U: P - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");5 I H ~2 d; e+ I! k8 ? g4 k m' l
- getCoupon();
" O0 i& k9 J0 H' i - } else {& }' Z2 l. _1 Z0 W
- document.body.scrollTop = _scrollTop;, y9 H2 K, J+ ]7 F2 A5 I& F
- }
- H+ B5 i9 Y# n+ u2 b4 _% v - }, 500);
0 _/ a$ C' }' c. ^ - }) (window, document);
3 F5 k+ Z" d# I/ g) L# ]7 U - }' H# j1 O9 K, U
- once();
复制代码
( z2 g. m' \: W1 l5 F2 b$ J 然后领光所有优惠卷了!
1 [+ O: d5 i8 } F5 p重要提示:一定要先登录天猫再撸
" Q) m0 m& }# u z; Z |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|