MCPcopy Create free account
hub / github.com/XIU2/UserScript / qianDaoStatus_

Function qianDaoStatus_

V2ex-Enhanced.user.js:262–277  ·  view source on GitHub ↗
(timeNow)

Source from the content-addressed store, hash-verified

260
261 // 后台获取签到状态(并判断是否需要签到)
262 function qianDaoStatus_(timeNow) {
263 GM_xmlhttpRequest({
264 url: location.origin + '/mission/daily',
265 method: 'GET',
266 timeout: 5000,
267 onload: function (response) {
268 let html = ShowPager.createDocumentByString(response.responseText);
269 if (html.querySelector('input[value^="领取"]')) { // 还没有签到...
270 qianDao_(null, timeNow); // 后台签到
271 } else { // 已经签到了...
272 console.info('[V2EX 增强] 已经签过到了。')
273 GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较
274 }
275 }
276 });
277 }
278
279
280 // 替换为 sov2ex 搜索,代码来自 v2ex-plus 扩展:https://github.com/sciooga/v2ex-plus (懒得重复造轮子了~

Callers 1

qianDaoFunction · 0.85

Calls 1

qianDao_Function · 0.85

Tested by

no test coverage detected