MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / getNotice

Function getNotice

jlqc.js:438–459  ·  view source on GitHub ↗

* 获取远程通知

()

Source from the content-addressed store, hash-verified

436 * 获取远程通知
437 */
438async 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}
460function ts10() {
461 return Math.round(new Date().getTime() / 1000).toString();
462}

Callers

nothing calls this directly

Calls 3

httpRequestFunction · 0.70
DoubleLogFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected