|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑 5 j! E N$ N7 `/ Q, ]( f' G g0 e
5 k9 J; F' y% e+ N* l5 F/ i
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
# q; s3 a. @7 r( d3 M+ A8 j) T% }, j- // looping fetch
/ S. \5 v/ B" F2 k; ^' S) t - var once = function(){
' C a& |# M% ^! T k+ U. q/ i0 l - // original author: https://v2ex.com/t/228164: C; \4 y g9 j& s* |$ d/ L, k
- (function(window, document) {& U+ i) u5 t& N. U- O4 Z
- var interval = 800;4 R/ f: I& d. E9 F4 h" h' B
- var closeDelay = 200;
- w' Z3 X) x7 s2 X( F9 U2 L2 I+ t - var index = 0;
' r. }$ G9 Y! I/ y5 K! h$ k; g+ A - var couponLinks;* H# G( ~: ^1 W/ p3 P
- var getCoupon = function() {( M9 u' l6 T, K8 E R, @% r; m& ~
- if (index >= couponLinks.length) {
$ t7 c! }; G/ i! D - console.log("领取完毕");
( ^+ D4 U' k* Y - window.once();. B: X9 g$ b% p
- return;
" |- @0 O9 W. g+ p3 ~) h n7 f - }
% w- M' L3 q, b, N" O - var coponLink = couponLinks[index];9 A7 @' T0 J0 q% o
- coponLink.click(); index++;# c; l' y0 k; y- u' ]# V
- console.log("领取 第" + index + " 张");
9 O3 Q( q: f2 K ]' O/ k: b - setTimeout(getCoupon, interval); n* b8 g+ x8 G" }6 G
- setTimeout(function() {. M; V/ b( |& _ G+ f6 A& z! J
- var close = document.querySelector('.mui-dialog-close');
0 } [: ?$ G2 g. g: D5 Y - if (close != null) close.click();& e1 u7 X7 `, {( L: z# Q/ _5 K
- }, closeDelay);
+ y/ X) {; a" R0 S7 T - }
: ~; r9 `& {( O; S9 U9 x - var _scrollTop = 0;( {. c9 A: {9 z2 z! O) u
- var _scrollStep = document.documentElement.clientHeight;2 Q- J6 ?* M) `0 s1 u# i
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;0 b$ W* b" q# ]# M$ i6 @1 {+ K
- var autoScrollDown = setInterval(function() {
; H8 K& q0 c( A+ ~. r& H7 q - _scrollTop += _scrollStep;
3 f6 s6 Z$ g& m - if (_scrollTop > _maxScrollTop) {
. A+ F) E! S( v; |! u+ a( } - clearInterval(autoScrollDown);; K3 r+ c4 @ h; \4 G3 F1 G3 L) W; {
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');2 V4 c* M/ [/ E, V
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");5 x. k& \7 _& t6 C) N& G$ O2 v8 r
- getCoupon();
) h! g+ f! l4 H: K; v2 _ - } else {* V3 w* w: `2 U2 b
- document.body.scrollTop = _scrollTop;1 b8 E' f" E, I/ O7 \
- }: s1 s V' S% d3 S# U8 }
- }, 500);8 }) j' C U2 i( U R+ @# w" w& a
- }) (window, document);) _5 `& I* x# y' w/ F, Q1 i7 j
- }' w, ^- m* F7 T% i+ f2 l5 b9 ]: T
- once();
复制代码
: D4 |1 [/ l( y& K. q 然后领光所有优惠卷了! 6 E$ y, g3 r$ }. b
重要提示:一定要先登录天猫再撸 ' v: k9 D* c* o8 ~
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|