Greasy Fork

Greasy Fork is available in English.

2018小米搶折價卷

2018雙十一自動搶折價卷

目前为 2018-11-07 提交的版本,查看 最新版本

// ==UserScript==
// @name         2018小米搶折價卷
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  2018雙十一自動搶折價卷
// @author       You
// @match        https://event.mi.com/tw/sales2018/super-sales-day
// @include      https://event.mi.com/tw/sales2018/*
// @grant        none
// @require http://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==

(function() {
    'use strict';
    function correct_time(){
    var flag = false;
	var d = new Date();
    var hours = d.getHours();
    var min = d.getMinutes();
    var sec = d.getSeconds();
    if((hours == 20 && min <=2) || ( hours == 19 && min == 59 && sec == 59)){
        flag = true;
    }
    return flag
    }
    function checkForMoniDisplayChange () {
        if(correct_time()){
            $(".J_couponArea").click();
        }
    }
$(".J_couponArea").removeAttr("disabled");
window.setInterval (checkForMoniDisplayChange, 10);


})();