|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑 0 N7 S/ [" R' ]
+ r: J# m6 t n! Z& n4 g右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
2 k% E6 s+ i$ E- G- // looping fetch
$ u" I4 R0 h3 O7 b5 Q$ W - var once = function(){
* V2 \1 @1 M$ |( s2 t% P8 z3 K8 B - // original author: https://v2ex.com/t/228164
! k4 Q7 d$ J0 w' D- Q. d$ d1 Q - (function(window, document) {
2 G5 [5 p5 p: O2 s1 K. _6 l3 [ - var interval = 800;
5 v. P+ N) I( O. f - var closeDelay = 200;7 @) ~' K5 j K$ Y7 |. b5 `6 @
- var index = 0;+ t+ @/ p& M( l+ L- o; _$ y
- var couponLinks;
2 j: \& H, w4 W4 ` - var getCoupon = function() {
0 h( B' m, b( w" P O0 V - if (index >= couponLinks.length) {
" q3 i. H- |/ V7 }" K# d& } - console.log("领取完毕");" }' \! h" V/ A! T0 j
- window.once();; [, a. W3 m/ W
- return;! A4 B" S q: ?# [" }! ?
- }& T2 t+ f* Z/ j, ^! F J1 ]3 M. Y
- var coponLink = couponLinks[index];
% q. s7 X6 V2 N4 P4 ?5 d6 @ - coponLink.click(); index++;
% h3 ?+ I: O: m" \2 a, H8 } - console.log("领取 第" + index + " 张");
7 d) m6 W2 E6 s - setTimeout(getCoupon, interval);
4 U2 P1 | P5 h/ @) { - setTimeout(function() {
) l/ V5 L% Q: f2 Q9 R( T - var close = document.querySelector('.mui-dialog-close');
4 W7 A$ a5 k0 H8 X+ D2 G! o1 S8 r - if (close != null) close.click();7 H, ]. [7 ^( v2 h/ m( \: X+ A
- }, closeDelay);. M/ c' C1 s5 P, \
- }
9 Z1 k2 R: H' v M; Q - var _scrollTop = 0;
2 U: x2 l, T5 b8 l - var _scrollStep = document.documentElement.clientHeight;& X" s+ w N3 F1 z4 @
- var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
! P _1 X q! Q1 g1 C - var autoScrollDown = setInterval(function() {! s: q! l. g' D8 x6 Z7 A, C. ~
- _scrollTop += _scrollStep;" ^* T8 Y1 O4 e3 n" u, h5 C+ _
- if (_scrollTop > _maxScrollTop) {
+ v, f- {. E' i: @ - clearInterval(autoScrollDown);, W3 u: K5 s7 r: x V7 Y
- couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');; \9 ~- W- ^3 i( z+ `$ g7 ~
- console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
; R( m# Y# Y3 m0 c* Q. D- F - getCoupon();3 T. r _: u) N; t+ \
- } else {
3 F: x: A4 N- B5 N8 w6 Q" l) A - document.body.scrollTop = _scrollTop;
F% G! i+ r2 s, }/ K - }8 L( a) ?1 n* b4 a y) {
- }, 500);( E" [, R. O) W2 l) p+ }% Z
- }) (window, document);4 v* d7 I% k- d+ H! k
- }
' D# { q/ m) ?( t& ^/ {& n+ [7 u - once();
复制代码
$ a+ V: C& h; I* I/ v: {. c% n 然后领光所有优惠卷了! ) N% H# I, _* S& L
重要提示:一定要先登录天猫再撸 # Z4 L; B# t3 u) j* z8 X
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|