// ==UserScript== // @name OurBits // @namespace https://gist.github.com/janlay/d2e136be5940348bb7aee4d9c6b87b5a // @version 2.1.2 // @author janlay // @loginURL https://ourbits.club/ // @updateURL https://gist.github.com/janlay/d2e136be5940348bb7aee4d9c6b87b5a/raw/ourbits.js // @expire 604800e3 // @domain ourbits.club // ==/UserScript== const endpoint = 'https://ourbits.club/'; exports.run = async function(param) { const { status, data } = await axios.get(`${endpoint}attendance.php`); if (status != 200) throw '访问失败'; if (/未登录/.test(data)) throw '未登录'; const re = /已连续签到 (\d+)<.+?(\d+)/; if (!re.test(data)) return '今日已签'; const [_, days, points] = data.match(re); return `+${points} (${days}天)`; }; exports.check = async function(param) { var { data } = await axios.get(`${endpoint}index.php`); return /欢迎回来/.test(data); };