本帖最后由 riskstar 于 2015-10-15 14:53 编辑
7 U8 O1 H, a+ c) `# }( b0 B# E. i2 l1 M, ~0 F! }, d# |% D6 e
右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
2 y" S$ }8 C! K- u7 V, c( T- // looping fetch) j6 P( l3 {: A% X# n6 ?
- var once = function(){
3 `7 `8 d; V3 z/ @$ P7 N# o# E - // original author: https://v2ex.com/t/228164
1 F4 \4 ^' z9 C$ E! u/ u; O7 E - (function(window, document) {
$ I' B; d' o# Z) @ - var interval = 800;' a) z2 x; p4 b j% y3 H
- var closeDelay = 200;8 H+ n, Z3 O. u0 x
- var index = 0;
$ J5 t+ Q2 n% c$ g# | - var couponLinks;
" [8 d$ V5 Q5 J - var getCoupon = function() {! I6 R' H/ s, S
- if (index >= couponLinks.length) {
8 c- p- _/ u/ e: ^0 c - console.log("领取完毕");: r! G+ G* `( M1 a
- window.once();
3 f9 t( g# v `1 Q6 W - return;; Y* Y, j( c: n+ G8 B4 r9 \/ q; {. S
- }
2 z! _0 r, T& i/ M* T - var coponLink = couponLinks[index];, {5 u# O4 C9 k5 q
- coponLink.click(); index++;
3 G2 ?( B" b. y, l+ X2 M - console.log("领取 第" + index + " 张");& `, w/ f! K0 H& m) d8 G' h6 I
- setTimeout(getCoupon, interval);
% U' W! C6 J5 K9 ~4 i - setTimeout(function() {# j* E. P. Z4 K3 J
- var close = document.querySelector('.mui-dialog-close');9 ^4 d% @ ]- ~5 M2 ?
- if (close != null) close.click();
w( J# v' {! c" g) f4 j - }, closeDelay);( y9 ^, U! N8 ]) Q/ d4 M
- }
0 R2 J( n% [7 l$ ~8 T8 K - var _scrollTop = 0;
/ F' N4 o, E2 Z) O# ] n: V$ a - var _scrollStep = document.documentElement.clientHeight;9 ]2 B* `4 p9 C+ U& |8 I1 v' J
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;6 u0 w5 Y, @, b
- var autoScrollDown = setInterval(function() {& b4 M, O2 ] m x
- _scrollTop += _scrollStep;: T# `5 U/ m7 ?" B$ ], I+ @$ w
- if (_scrollTop > _maxScrollTop) {
+ g) g0 F3 @# {3 O - clearInterval(autoScrollDown);
2 U- y/ F7 B c$ \ - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
0 @$ J" l5 r) q/ a/ W. ~; r& q - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
$ q2 r. |5 ~( Q( a7 g) |5 ?! q% J - getCoupon();
+ u b/ X- o U4 }; ?# B - } else {
) v: }/ J* m4 c( |* g/ _ - document.body.scrollTop = _scrollTop;/ V5 z0 {% s: m- X% A
- }
% A8 g% o; A. p# B( e; _2 t - }, 500);
/ J# y Q8 R$ m" X! P - }) (window, document);
9 ^, ^6 q9 \0 a - }: J- ?; M' j) ^ o, h9 G
- once();
复制代码 1 r; q7 ?9 H6 \) ?" b7 y% z/ Q# ?
然后领光所有优惠卷了!
: A# Y( @, U( X# C4 H3 I) @重要提示:一定要先登录天猫再撸
% b% M9 s- {9 K( W |