// ==UserScript== // @name bilibili自动签到 // @namespace wyz // @version 1.0.0 // @author wyz // @crontab * * once * * // @grant GM_xmlhttpRequest // @grant GM_notification // ==/UserScript== GM_xmlhttpRequest({ method: 'GET', url: 'https://api.bilibili.com/x/web-interface/nav', timeout: 2000, onload: function (xhr) { if (xhr.status == 200) { if (xhr.response.code == 0) { GM_notification('哔哩哔哩自动签到成功'); } else if (xhr.response.code == -101) { GM_notification({ title: 'bilibili自动签到 - ScriptCat', text: '哔哩哔哩签到失败,账号未登录,请先登录', }); } } } }); GM_xmlhttpRequest({ method: 'GET', url: 'https://api.live.bilibili.com/sign/doSign', timeout: 2000, onload: function (xhr) { if (xhr.status == 200) { if (xhr.response.code == 0) { GM_notification('哔哩哔哩直播自动签到成功'); } else if (xhr.response.code == -101) { GM_notification({ title: 'bilibili自动签到 - ScriptCat', text: '哔哩哔哩签到失败,账号未登录,请先登录', }); } } }, ontimeout: function () { } });