抢座位

华东交大抢座位

As of 11.09.2019. See ბოლო ვერსია.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         抢座位
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  华东交大抢座位
// @author       LinkerH
// @match        *://lib2.ecjtu.edu.cn/*
// @grant        none

// @grant        GM_xmlhttpRequest
// ==/UserScript==

(function() {
   // window.onload = function(){
    abc(111);//括号里面是座位号
    function abc(id){
        			var myDate = new Date();


        		    if(myDate.getMinutes()>=58&&myDate.getHours()>=23)
        		       setTimeout(function(){
                           abc(id);rob("13","40","19","40","2019-"+(myDate.getUTCMonth()+1)+"-"+(myDate.getDate()+1),id);rob("08","00","13","00","2019-"+(myDate.getUTCMonth()+1)+ (myDate.getDate()+1),id);
                       },1000)
                    else
                        setTimeout(function(){console.log(myDate.getSeconds()),abc(id)},1000)

        	}



 function rob(hour,min,eHour,emin,edate,id)
    {
    var timeStart_hour = hour;
    var timeStart_min = min ;
    var timeEnd_hour = eHour;
    var timeEnd_min = emin;
    var date = edate;
    var devId = 100531923 + id;      // 加号后面的数字是座位号
        /*
            A区 :100531923
            B区: 100532081
            C区: 100532223
            D区:100532383
         */

    //const $ = window.jQuery;
    //
    $.ajax({
        type:"get",
        url:"http://lib2.ecjtu.edu.cn/ClientWeb/pro/ajax/reserve.aspx?dialogid=&dev_id="+ devId +"&lab_id=&kind_id=&room_id=&type=dev&prop=&test_id=&term=&number=&classkind=&test_name=0&start="+date+"+"+ timeStart_hour +"%3A"+timeStart_min+"&end="+date+"+"+timeEnd_hour+"%3A"+timeEnd_min+"&start_time="+timeStart_hour + timeStart_min+"&end_time="+timeEnd_hour+timeEnd_min +"&up_file=&memo=&memo=&act=set_resv&_=1568034058992",
        success: function(msg){console.log(msg)},
        error: function(){console.log("预约失败")}
    })
    }
   // }
    // Your code here...
})();