MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / getNotice

Function getNotice

hqcsh.js:339–358  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

337}
338//===============================================获取远程通知========================================
339async function getNotice() {
340 try {
341 const urls = [
342 "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json",
343
344 ];
345 let notice = null;
346 for (const url of urls) {
347 const options = { url, headers: { "User-Agent": "" }, };
348 const result = await httpRequest(options);
349 if (result && "notice" in result) {
350 notice = result.notice.replace(/\\n/g, "\n");
351 break;
352 }
353 }
354 if (notice) { $.DoubleLog(notice); }
355 } catch (e) {
356 console.log(e);
357 }
358}
359//==============================================获取远程版本=================================================
360function getVersion(scriptUrl, timeout = 3 * 1000) {
361 return new Promise((resolve) => {

Callers

nothing calls this directly

Calls 3

httpRequestFunction · 0.70
DoubleLogMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected