|
|
本帖最后由 riskstar 于 2015-10-15 14:53 编辑 6 d- s% b9 |/ [5 M7 s$ i
: @8 x9 c7 {: D* d. P% o) d右键,审查元素 点击 Console ,然后复制下面代码在空白处后按回车,即可。如果到时候有优惠的商品,就不用担心了。
2 R: j5 {5 E% b9 M* Y3 Q( n- // looping fetch
2 o( a1 R! K$ D - var once = function(){
& m& b c5 i; b4 d* f2 Q N - // original author: https://v2ex.com/t/228164
' Y! a( p5 |8 _4 K9 W - (function(window, document) {
4 Y) P$ S+ O- m% ?* S - var interval = 800;/ H2 N8 A' N0 K
- var closeDelay = 200;. q m" R, r! a3 \* U- \0 c) P/ [8 [, N
- var index = 0;
, G" [' A, a( L+ c7 k- L( i$ M0 X - var couponLinks;
7 q" W' ]% j& G5 g1 D, Q1 C, `. j - var getCoupon = function() {
8 J/ s1 x* E% g - if (index >= couponLinks.length) {
' _, f# _0 h$ T+ o0 @$ _8 z& Z& A1 ^' | t - console.log("领取完毕");: [4 c! F6 k4 i2 ?/ u6 x4 C1 k7 \
- window.once();0 O( p, V$ f* y7 M
- return;- e. G/ r5 g0 p2 B0 E/ e/ z
- }( ?4 o4 a" i; J1 ?
- var coponLink = couponLinks[index];6 Y0 T$ ~% ]3 [0 \
- coponLink.click(); index++;
+ O) e" l0 T# D7 y/ a; K; p - console.log("领取 第" + index + " 张");
3 }' \6 K3 R; R - setTimeout(getCoupon, interval);
" f% t, C$ T: I1 v7 [8 e - setTimeout(function() {$ Z* a7 P1 \3 i$ [) y
- var close = document.querySelector('.mui-dialog-close');
6 y3 j" V0 k6 Z* P5 ?% x" G8 v2 P - if (close != null) close.click();
! Q) D' ^' c& ?* t7 J" u y3 D1 g - }, closeDelay);8 G9 Z- V3 n9 X, A( _% H
- }& ]) R( n, k/ Y9 w$ A: u- G
- var _scrollTop = 0;
2 _$ [; I. ^- S2 k& N0 O4 G - var _scrollStep = document.documentElement.clientHeight;
! K# W) w8 o( a- B/ ~6 g! q - var _maxScrollTop = document.body.clientHeight - document.documentElement.clientHeight;
1 H$ M" X* o. `0 m - var autoScrollDown = setInterval(function() {: L- L( U+ }' P! x/ L! i8 z
- _scrollTop += _scrollStep; {7 y4 D' S$ C
- if (_scrollTop > _maxScrollTop) {
% S. T0 {1 }2 h/ s - clearInterval(autoScrollDown);
0 h3 s6 b, l4 m; e" a4 U; Q - couponLinks = document.querySelectorAll('.mui-act-item-yhqbtn');
$ U0 _' J+ }- W - console.log("总共:" + couponLinks.length + "条张优惠券待领取...");
+ J. }- \: O8 B, {' x# s* D - getCoupon(); P& F2 f7 q5 x6 p, x% D ?
- } else {" a* R' }) ~: q6 P7 X
- document.body.scrollTop = _scrollTop;: B4 x8 ~4 o* _9 ?5 n' b6 C
- }& m* b* ^* }2 n5 P$ S9 J- s& r
- }, 500);6 {3 E0 l* I: O: L. Y
- }) (window, document);
# }1 O0 q* E" L. o+ ` - }
% N& p9 F. B" W/ ~7 z; v! Z9 H$ }5 C - once();
复制代码
$ I/ q, r4 u$ {# U% }8 d8 X# U/ | 然后领光所有优惠卷了! $ U( F2 e; M- C
重要提示:一定要先登录天猫再撸
' G8 k& ]- k8 M6 j |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|