From d2a65ee0fe934f1645644df261dc0b4f1d1c1cd1 Mon Sep 17 00:00:00 2001 From: xream Date: Mon, 20 May 2024 17:38:49 +0800 Subject: [PATCH] chore: demo.js --- scripts/demo.js | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/scripts/demo.js b/scripts/demo.js index 018ef47..d000fd7 100644 --- a/scripts/demo.js +++ b/scripts/demo.js @@ -96,40 +96,7 @@ function operator(proxies = [], targetPlatform, context) { // }) // 4. 一个比较折腾的方案: 在脚本操作中, 把内容同步到另一个 gist - - // async function operator(proxies = []) { - // const $ = $substore - // const GITHUB_TOKEN = 'ghp_xxxxxxxxxxxxxxxxxxxxx' - // const GIST_NAME = 'share' - // const FILENAME = 'mihomo.yaml' - // let files = {} - // let content = await produceArtifact({ - // type: 'subscription', - // subscription: {}, - // content: 'proxies:\n' + proxies.map((proxy) => ' - ' + JSON.stringify(proxy) + '\n').join(''), - // platform: 'ClashMeta', - // }) - // const manager = new ProxyUtils.Gist({ - // token: GITHUB_TOKEN, - // key: GIST_NAME, - // }); - // files[encodeURIComponent(FILENAME)] = { - // content, - // }; - // const res = await manager.upload(files); - // let body = {}; - // try { - // body = JSON.parse(res.body); - // // eslint-disable-next-line no-empty - // } catch (e) {} - // const raw_url = - // body.files[encodeURIComponent(FILENAME)]?.raw_url; - // console.log(raw_url) - // const new_url = raw_url?.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1'); - // console.log(new_url) - // $.notify('🌍 Sub-Store', `更新到 Gist: ${new_url}`); - // return proxies - // } + // 见 https://t.me/zhetengsha/1428 // // YAML // ProxyUtils.yaml.load('YAML String')