本帖最后由 riskstar 于 2015-10-15 14:53 编辑 # I( ~' l( L! \8 i$ ]% @$ ^
/ B Y4 \6 z$ b) x; f右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。# J. w! ~6 T1 e6 x5 G; x W0 J
- // looping fetch
8 X, U; n5 q$ Y& ]6 m: R% O! e - var once = function(){/ J' d$ a) X j. h- P
- // original author: https://v2ex.com/t/228164
* l2 o2 O, Q. t, W J6 r - (function(window, document) {
% [* v4 Z5 j2 X y& |2 N - var interval = 800;. U- ?0 v b5 A5 |- l
- var closeDelay = 200;+ u( `2 l: Z, a' W' g, d7 y
- var index = 0;! o1 v$ S+ N! z' b+ D5 q" W
- var couponLinks;
! I9 k3 d: I" ?: \8 ~ - var getCoupon = function() {( S- o* j) |) X% l5 u
- if (index >= couponLinks.length) {0 x0 P* y. t( f) u, a, s# T- ~; ]
- console.log("领取完毕");
- k) S& P w$ i8 }7 i8 }4 } - window.once();4 i2 F" V1 C8 b% }; \3 H+ L x( V7 V
- return;
2 W5 J5 b, J& v r+ b - }
. a9 W$ e6 p8 }" g, G2 \ - var coponLink = couponLinks[index];6 p% q+ a: P, A* G: j5 Y
- coponLink.click(); index++;/ H9 s% L, u" E1 v# n' M2 X
- console.log("领取 第" + index + " 张");
. i" o2 R( A9 W$ E: x" s - setTimeout(getCoupon, interval);5 i; g/ c* T+ m0 t) K6 U
- setTimeout(function() { h: E2 T: L O4 X' b' }
- var close = document.querySelector('.mui-dialog-close');% N" u0 L, A( p6 B( r
- if (close != null) close.click();
6 g5 L' R; {8 n) G3 x8 Q4 S - }, closeDelay);
# d( q8 l% I0 w/ z3 [ - }
! y9 I7 B: L3 Z; u - var _scrollTop = 0;: a0 X$ \. M/ R, M3 O
- var _scrollStep = document.documentElement.clientHeight;
3 P- ^9 h$ h6 ~ - var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;+ y) S. B f2 E1 c0 m& G* z
- var autoScrollDown = setInterval(function() {! y1 ~2 }( e4 z, Q; } L( v. z
- _scrollTop += _scrollStep;6 U5 V5 X9 O0 p1 k
- if (_scrollTop > _maxScrollTop) {
0 j5 ^$ D1 S, f- ? - clearInterval(autoScrollDown);
" e5 {6 |, v1 ]( C- ~( [( j$ } - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');8 l7 u# o" r6 @5 Q2 l
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");9 i! U k7 L( I9 e
- getCoupon();
* G5 ?; @% A# [& `* x - } else {# z2 p% h% w9 _+ y- M
- document.body.scrollTop = _scrollTop;
" O/ ^* r4 Q* d* E& S8 j. q - }
, Z! ~0 H: n2 y3 n+ M - }, 500);( b' w5 M+ \' z c
- }) (window, document);
* l* w5 c2 t6 n& y - }5 q+ A! X- X" }
- once();
复制代码
2 v1 L) S- r$ D; i5 i8 T4 @: z 然后领光所有优惠卷了!
: h& r1 Z @, z% O重要提示:一定要先登录天猫再撸 7 U3 [; M6 Y4 d0 S8 P
|