* 获取远程通知
()
| 436 | * 获取远程通知 |
| 437 | */ |
| 438 | async function getNotice() { |
| 439 | try { |
| 440 | const urls = [ |
| 441 | "https://cdn.jsdelivr.net/gh/smallfawn/Note@main/Notice.json", |
| 442 | "https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/Note/main/Notice.json", |
| 443 | "https://fastly.jsdelivr.net/gh/smallfawn/Note@main/Notice.json", |
| 444 | "https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json", |
| 445 | ]; |
| 446 | let notice = null; |
| 447 | for (const url of urls) { |
| 448 | const options = { url, headers: { "User-Agent": "" }, }; |
| 449 | const result = await httpRequest(options); |
| 450 | if (result && "notice" in result) { |
| 451 | notice = result.notice.replace(/\\n/g, "\n"); |
| 452 | break; |
| 453 | } |
| 454 | } |
| 455 | if (notice) { DoubleLog(notice); } |
| 456 | } catch (e) { |
| 457 | console.log(e); |
| 458 | } |
| 459 | } |
| 460 | function ts10() { |
| 461 | return Math.round(new Date().getTime() / 1000).toString(); |
| 462 | } |
nothing calls this directly
no test coverage detected