@@ -63760,8 +63760,8 @@ const Get = async (key, pass) => {
6376063760 const s = await r.text();
6376163761 return Space_1.default.API.AES.Decrypt(s, pass);
6376263762};
63763- const Put = async (s, pass) => {
63764- const info = await Space_1.default.API.NPMUpload(Space_1.default.API.AES.Encrypt(s, pass));
63763+ const Put = async (s, pass, time ) => {
63764+ const info = await Space_1.default.API.NPMUpload(Space_1.default.API.AES.Encrypt(s, pass), time );
6376563765 if (info.success)
6376663766 return info.key;
6376763767 return null;
@@ -63803,7 +63803,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
6380363803 * ==========================================================================
6380463804*/
6380563805const Space_1 = __webpack_require__(7619);
63806- async function NPMUpload(file) {
63806+ async function NPMUpload(file, time ) {
6380763807 let notify = 1;
6380863808 if (typeof file === "string") {
6380963809 const blob = new Blob([Buffer.from(file)], { type: "text/plain" });
@@ -63818,7 +63818,7 @@ async function NPMUpload(file) {
6381863818 const GITHUB_REPO = set.GITHUB_REPO;
6381963819 const GITHUB_BRANCH = set.GITHUB_BRANCH;
6382063820 const NPM_PKG = set.NPM_PKG;
63821- const message = Date.now();
63821+ const message = time || Date.now();
6382263822 const url = `https://api.github.com/repos/${GITHUB_REPO}/contents/${fileName}?ref=${GITHUB_BRANCH}`;
6382363823 const fileSha = await fetch(url, {
6382463824 method: "GET",
@@ -67221,6 +67221,7 @@ async function update(that) {
6722167221 if (item.errorTime > 0) {
6722267222 return;
6722367223 }
67224+ const index = sub.indexOf(item);
6722467225 const feed = await Space_1.default.API.XML2JSON(item.url);
6722567226 try {
6722667227 if (feed.items[0]?.pubDate != item.lastUpdateTime) {
@@ -67233,7 +67234,7 @@ async function update(that) {
6723367234 lastPost: feed.items[0]?.title,
6723467235 lastLink: feed.items[0]?.link,
6723567236 lastUpdateTime: feed.items[0]?.pubDate,
67236- lastPostView: await page(feed.items[0]?.title, feed.items[0]?.content)
67237+ lastPostView: await page(feed.items[0]?.title, feed.items[0]?.content, index )
6723767238 };
6723867239 sub = sub.filter((it) => it.url !== item.url);
6723967240 sub.push(rss);
@@ -67271,14 +67272,14 @@ async function update(that) {
6727167272 }
6727267273 return sub;
6727367274}
67274- async function page(tittle , content) {
67275+ async function page(title , content, index = 0 ) {
6727567276 content = content.replace(/<img.*?>/g, "");
6727667277 const html = `<html lang="en">
6727767278 <head>
6727867279 <meta charset="UTF-8">
6727967280 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6728067281 <meta name="viewport" content="width=device-width, initial-scale=1.0">
67281- <title>${tittle }</title>
67282+ <title>${title }</title>
6728267283 <style>
6728367284 article{
6728467285 margin: 0 auto;
@@ -67288,12 +67289,15 @@ async function page(tittle, content) {
6728867289 </head>
6728967290 <body>
6729067291 <article>
67291- <h1>${tittle }</h1>
67292+ <h1>${title }</h1>
6729267293 ${content}
6729367294 </article>
6729467295 </body>
6729567296 </html>`;
67296- const key = await Space_1.default.API.NPMData.Put(html, "RssView");
67297+ const key = Date.now();
67298+ setTimeout(async () => {
67299+ await Space_1.default.API.NPMData.Put(html, "RssView", key);
67300+ }, 30000 * index);
6729767301 return "https://" + WORKERROUTE.replace("/*", '') + "/rss-view/" + key;
6729867302}
6729967303async function last(that) {
@@ -68940,7 +68944,9 @@ const RSS = async (that) => {
6894068944 }
6894168945 }
6894268946 if (that.args.k == "update") {
68947+ await ctx.reply("Trying to update...");
6894368948 await Space_1.default.Helpers.RSS.update();
68949+ await ctx.reply("Update Done.");
6894468950 }
6894568951 if (that.args.k == "last") {
6894668952 await Space_1.default.Helpers.RSS.last(that);
0 commit comments