1
0
Fork 0

feat: auto refresh when mcbbs return 504

master
502647092 2021-03-13 08:56:31 +00:00
parent bbea25c48f
commit 03d72246f7
1 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name 圈云盒子顶帖器
// @namespace https://circlecloud.ltd/
// @version 0.1.1
// @version 0.1.2
// @description 自动顶贴
// @author MiaoWoo
// @match https://www.mcbbs.net/forum-server-1.html**
@ -52,10 +52,13 @@
}).then(r => r.json())
}
async function main() {
if (document.getElementsByTagName('h1')[0].innerText.startsWith(504)) {
return refresh()
}
let params = location.href.split('?')[1]?.split('&').map(s => s.split('=')).reduce((pre, cur, index) => { pre[cur[0]] = cur[1]; return pre }, {}) || {}
nextPage = document.getElementById('autopbn')
post('alive', { type: 'servers' })
let servers = await readServers()
post('alive', { type: 'servers' })
if (store.lastPostServer != servers[25].tid) {
await post('updateServers', servers)
}