Greasy Fork

Greasy Fork is available in English.

洛谷自动签到

只要登陆过洛谷,下一次打开chrome即可自动签到(仅支持最新版chrome:登陆过洛谷重启浏览器可以保持登陆状态的)

目前为 2019-12-10 提交的版本。查看 最新版本

// ==UserScript==
// @name         洛谷自动签到
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  只要登陆过洛谷,下一次打开chrome即可自动签到(仅支持最新版chrome:登陆过洛谷重启浏览器可以保持登陆状态的)
// @author       spicy_chicken(bossbaby)
// @match        *://*
// @match        *://www.luogu.org/*
// @match        *://www.luogu.com.cn/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var http = new XMLHttpRequest();
    http.open('GET', 'https://www.luogu.com.cn/index/ajax_punch');
    http.send();
    http.onreadystatechange = function () {
        if (http.readyState == 4) {
            var res=http.responseText;
            res=JSON.parse(res);
            console.log(res["code"]+"-"+res["message"]);
            if(res["code"]==200)
                console.log("签到成功");
            else console.log("签到失败");
        }
    };
})();