diff --git a/lib/errors/index.test.ts b/lib/errors/index.test.ts index 2dae632b4..8f83e711c 100644 --- a/lib/errors/index.test.ts +++ b/lib/errors/index.test.ts @@ -5,7 +5,7 @@ import app from '@/app'; import { config } from '@/config'; describe('error', () => { - it(`error`, async () => { + it('error', async () => { const response = await app.request('/test/error'); expect(response.status).toBe(503); const text = await response.text(); @@ -14,7 +14,7 @@ describe('error', () => { }); describe('httperror', () => { - it(`httperror`, async () => { + it('httperror', async () => { const response = await app.request('/test/httperror'); expect(response.status).toBe(503); const text = await response.text(); @@ -23,11 +23,11 @@ describe('httperror', () => { }); describe('RequestInProgressError', () => { - it(`RequestInProgressError with retry`, async () => { + it('RequestInProgressError with retry', async () => { const responses = await Promise.all([app.request('/test/slow'), app.request('/test/slow')]); expect(new Set(responses.map((r) => r.status))).toEqual(new Set([200, 200])); }); - it(`RequestInProgressError`, async () => { + it('RequestInProgressError', async () => { const responses = await Promise.all([app.request('/test/slow4'), app.request('/test/slow4')]); expect(new Set(responses.map((r) => r.status))).toEqual(new Set([200, 503])); expect(new Set(responses.map((r) => r.headers.get('cache-control')))).toEqual(new Set([`public, max-age=${config.cache.routeExpire}`, `public, max-age=${config.requestTimeout / 1000}`])); @@ -37,7 +37,7 @@ describe('RequestInProgressError', () => { }); describe('config-not-found-error', () => { - it(`config-not-found-error`, async () => { + it('config-not-found-error', async () => { const response = await app.request('/test/config-not-found-error'); expect(response.status).toBe(503); const text = await response.text(); @@ -46,7 +46,7 @@ describe('config-not-found-error', () => { }); describe('invalid-parameter-error', () => { - it(`invalid-parameter-error`, async () => { + it('invalid-parameter-error', async () => { const response = await app.request('/test/invalid-parameter-error'); expect(response.status).toBe(503); const text = await response.text(); @@ -55,7 +55,7 @@ describe('invalid-parameter-error', () => { }); describe('captcha-error', () => { - it(`captcha-error`, async () => { + it('captcha-error', async () => { const response = await app.request('/test/captcha-error'); expect(response.status).toBe(503); const text = await response.text(); diff --git a/lib/middleware/access-control.test.ts b/lib/middleware/access-control.test.ts index 40674096e..ec6c11f6b 100644 --- a/lib/middleware/access-control.test.ts +++ b/lib/middleware/access-control.test.ts @@ -15,7 +15,7 @@ afterEach(() => { }); describe('access-control', () => { - it(`access key`, async () => { + it('access key', async () => { const key = '1L0veRSSHub'; const code = md5('/test/2' + key); process.env.ACCESS_KEY = key; diff --git a/lib/middleware/filter-engine.test.ts b/lib/middleware/filter-engine.test.ts index e68e60c1e..e0c2158b8 100644 --- a/lib/middleware/filter-engine.test.ts +++ b/lib/middleware/filter-engine.test.ts @@ -10,7 +10,7 @@ afterEach(() => { }); describe('filter-engine', () => { - it(`filter RE2 engine ReDoS attack`, async () => { + it('filter RE2 engine ReDoS attack', async () => { const app = (await import('@/app')).default; const response = await app.request('/test/1?filter=abc(%3F%3Ddef)'); @@ -18,7 +18,7 @@ describe('filter-engine', () => { expect(await response.text()).toMatch(/RE2JSSyntaxException/); }); - it(`filter Regexp engine backward compatibility`, async () => { + it('filter Regexp engine backward compatibility', async () => { process.env.FILTER_REGEX_ENGINE = 'regexp'; const app = (await import('@/app')).default; @@ -27,7 +27,7 @@ describe('filter-engine', () => { expect(response.status).toBe(200); }); - it(`filter Regexp engine test config`, async () => { + it('filter Regexp engine test config', async () => { process.env.FILTER_REGEX_ENGINE = 'somethingelse'; const app = (await import('@/app')).default; diff --git a/lib/middleware/header.test.ts b/lib/middleware/header.test.ts index 71f18dbbd..4578d8da2 100644 --- a/lib/middleware/header.test.ts +++ b/lib/middleware/header.test.ts @@ -17,7 +17,7 @@ afterAll(() => { }); describe('header', () => { - it(`header`, async () => { + it('header', async () => { const app = (await import('@/app')).default; const { config } = await import('@/config'); const response = await app.request('/test/1'); @@ -32,7 +32,7 @@ describe('header', () => { expect(response.headers.get('x-rsshub-route')).toBe('/test/:id/:params?'); }); - it(`etag`, async () => { + it('etag', async () => { const app = (await import('@/app')).default; const response = await app.request('/test/1', { headers: { diff --git a/lib/middleware/parameter.test.ts b/lib/middleware/parameter.test.ts index 69f3000e3..c602a901d 100644 --- a/lib/middleware/parameter.test.ts +++ b/lib/middleware/parameter.test.ts @@ -11,7 +11,7 @@ const { default: app } = await import('@/app'); const parser = new Parser(); describe('filter', () => { - it(`filter`, async () => { + it('filter', async () => { const response = await app.request('/test/1?filter=Description4|Title5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(2); @@ -19,13 +19,13 @@ describe('filter', () => { expect(parsed.items[1].title).toBe('Title5'); }); - it(`filter filter_case_sensitive default`, async () => { + it('filter filter_case_sensitive default', async () => { const response = await app.request('/test/1?filter=description4|title5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(0); }); - it(`filter filter_case_sensitive=false`, async () => { + it('filter filter_case_sensitive=false', async () => { const response = await app.request('/test/1?filter=description4|title5&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(2); @@ -33,35 +33,35 @@ describe('filter', () => { expect(parsed.items[1].title).toBe('Title5'); }); - it(`filter_title`, async () => { + it('filter_title', async () => { const response = await app.request('/test/1?filter_title=Description4|Title5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(1); expect(parsed.items[0].title).toBe('Title5'); }); - it(`filter_title filter_case_sensitive=false`, async () => { + it('filter_title filter_case_sensitive=false', async () => { const response = await app.request('/test/1?filter_title=description4|title5&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(1); expect(parsed.items[0].title).toBe('Title5'); }); - it(`filter_description`, async () => { + it('filter_description', async () => { const response = await app.request('/test/1?filter_description=Description4|Title5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(1); expect(parsed.items[0].title).toBe('Title4'); }); - it(`filter_description filter_case_sensitive=false`, async () => { + it('filter_description filter_case_sensitive=false', async () => { const response = await app.request('/test/1?filter_description=description4|title5&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(1); expect(parsed.items[0].title).toBe('Title4'); }); - it(`filter_author`, async () => { + it('filter_author', async () => { const response = await app.request('/test/1?filter_author=DIYgod4|DIYgod5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(2); @@ -69,13 +69,13 @@ describe('filter', () => { expect(parsed.items[1].title).toBe('Title5'); }); - it(`filter_author filter_case_sensitive default`, async () => { + it('filter_author filter_case_sensitive default', async () => { const response = await app.request('/test/1?filter_author=diygod4|diygod5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(0); }); - it(`filter_author filter_case_sensitive=false`, async () => { + it('filter_author filter_case_sensitive=false', async () => { const response = await app.request('/test/1?filter_author=diygod4|diygod5&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(2); @@ -83,7 +83,7 @@ describe('filter', () => { expect(parsed.items[1].title).toBe('Title5'); }); - it(`filter_category`, async () => { + it('filter_category', async () => { const response = await app.request('/test/filter?filter_category=Category0|Category1'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(2); @@ -91,13 +91,13 @@ describe('filter', () => { expect(parsed.items[1].title).toBe('Filter Title2'); }); - it(`filter_category filter_case_sensitive default`, async () => { + it('filter_category filter_case_sensitive default', async () => { const response = await app.request('/test/filter?filter_category=category0|category1'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(0); }); - it(`filter_category filter_case_sensitive=false`, async () => { + it('filter_category filter_case_sensitive=false', async () => { const response = await app.request('/test/filter?filter_category=category0|category1&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(2); @@ -105,14 +105,14 @@ describe('filter', () => { expect(parsed.items[1].title).toBe('Filter Title2'); }); - it(`filter_category filter_case_sensitive=false category string`, async () => { + it('filter_category filter_case_sensitive=false category string', async () => { const response = await app.request('/test/filter?filter_category=category3&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(1); expect(parsed.items[0].title).toBe('Filter Title3'); }); - it(`filter_category illegal_category`, async () => { + it('filter_category illegal_category', async () => { const response = await app.request('/test/filter-illegal-category?filter_category=CategoryIllegal'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(1); @@ -120,7 +120,7 @@ describe('filter', () => { expect(parsed.items[0].categories?.[0]).toBe('CategoryIllegal'); }); - it(`filter_time`, async () => { + it('filter_time', async () => { const response = await app.request('/test/current_time?filter_time=25'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(2); @@ -128,7 +128,7 @@ describe('filter', () => { expect(parsed.items[1].title).toBe('Title2'); }); - it(`filterout`, async () => { + it('filterout', async () => { const response = await app.request('/test/1?filterout=Description4|Title5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(3); @@ -137,7 +137,7 @@ describe('filter', () => { expect(parsed.items[2].title).toBe('Title3'); }); - it(`filterout filter_case_sensitive default`, async () => { + it('filterout filter_case_sensitive default', async () => { const response = await app.request('/test/1?filterout=description4|title5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(5); @@ -146,7 +146,7 @@ describe('filter', () => { expect(parsed.items[2].title).toBe('Title3'); }); - it(`filterout filter_case_sensitive=false`, async () => { + it('filterout filter_case_sensitive=false', async () => { const response = await app.request('/test/1?filterout=description4|title5&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(3); @@ -155,7 +155,7 @@ describe('filter', () => { expect(parsed.items[2].title).toBe('Title3'); }); - it(`filterout_title`, async () => { + it('filterout_title', async () => { const response = await app.request('/test/1?filterout_title=Description4|Title5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(4); @@ -165,7 +165,7 @@ describe('filter', () => { expect(parsed.items[3].title).toBe('Title4'); }); - it(`filterout_title filter_case_sensitive=false`, async () => { + it('filterout_title filter_case_sensitive=false', async () => { const response = await app.request('/test/1?filterout_title=description4|title5&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(4); @@ -175,7 +175,7 @@ describe('filter', () => { expect(parsed.items[3].title).toBe('Title4'); }); - it(`filterout_description`, async () => { + it('filterout_description', async () => { const response = await app.request('/test/1?filterout_description=Description4|Title5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(4); @@ -185,7 +185,7 @@ describe('filter', () => { expect(parsed.items[3].title).toBe('Title5'); }); - it(`filterout_description filter_case_sensitive=false`, async () => { + it('filterout_description filter_case_sensitive=false', async () => { const response = await app.request('/test/1?filterout_description=description4|title5&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(4); @@ -195,7 +195,7 @@ describe('filter', () => { expect(parsed.items[3].title).toBe('Title5'); }); - it(`filterout_author`, async () => { + it('filterout_author', async () => { const response = await app.request('/test/1?filterout_author=DIYgod4|DIYgod5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(3); @@ -204,7 +204,7 @@ describe('filter', () => { expect(parsed.items[2].title).toBe('Title3'); }); - it(`filterout_author filter_case_sensitive default`, async () => { + it('filterout_author filter_case_sensitive default', async () => { const response = await app.request('/test/1?filterout_author=diygod4|diygod5'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(5); @@ -213,7 +213,7 @@ describe('filter', () => { expect(parsed.items[2].title).toBe('Title3'); }); - it(`filterout_author filter_case_sensitive=false`, async () => { + it('filterout_author filter_case_sensitive=false', async () => { const response = await app.request('/test/1?filterout_author=diygod4|diygod5&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(3); @@ -222,7 +222,7 @@ describe('filter', () => { expect(parsed.items[2].title).toBe('Title3'); }); - it(`filterout_category`, async () => { + it('filterout_category', async () => { const response = await app.request('/test/filter?filterout_category=Category0|Category1'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(6); @@ -231,7 +231,7 @@ describe('filter', () => { expect(parsed.items[2].title).toBe('Title2'); }); - it(`filterout_category filter_case_sensitive default`, async () => { + it('filterout_category filter_case_sensitive default', async () => { const response = await app.request('/test/filter?filterout_category=category0|category1'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(8); @@ -241,7 +241,7 @@ describe('filter', () => { expect(parsed.items[3].title).toBe('Title1'); }); - it(`filterout_category filter_case_sensitive=false`, async () => { + it('filterout_category filter_case_sensitive=false', async () => { const response = await app.request('/test/filter?filterout_category=category0|category1&filter_case_sensitive=false'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(6); @@ -250,14 +250,14 @@ describe('filter', () => { expect(parsed.items[2].title).toBe('Title2'); }); - it(`filter combination`, async () => { + it('filter combination', async () => { const response = await app.request('/test/filter?filter_title=Filter&filter_description=Description1'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(1); expect(parsed.items[0].title).toBe('Filter Title1'); }); - it(`filterout combination`, async () => { + it('filterout combination', async () => { const response = await app.request('/test/filter?filterout_title=Filter&filterout_description=Description1'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(4); @@ -266,7 +266,7 @@ describe('filter', () => { }); describe('limit', () => { - it(`limit`, async () => { + it('limit', async () => { const response = await app.request('/test/1?limit=3'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(3); @@ -289,16 +289,16 @@ describe('sorted', () => { }); describe('tgiv', () => { - it(`tgiv`, async () => { + it('tgiv', async () => { const response = await app.request('/test/1?tgiv=test'); const parsed = await parser.parseString(await response.text()); - expect(parsed.items[0].link).toBe(`https://t.me/iv?url=https%3A%2F%2Fgithub.com%2FDIYgod%2FRSSHub%2Fissues%2F1&rhash=test`); - expect(parsed.items[1].link).toBe(`https://t.me/iv?url=https%3A%2F%2Fgithub.com%2FDIYgod%2FRSSHub%2Fissues%2F2&rhash=test`); + expect(parsed.items[0].link).toBe('https://t.me/iv?url=https%3A%2F%2Fgithub.com%2FDIYgod%2FRSSHub%2Fissues%2F1&rhash=test'); + expect(parsed.items[1].link).toBe('https://t.me/iv?url=https%3A%2F%2Fgithub.com%2FDIYgod%2FRSSHub%2Fissues%2F2&rhash=test'); }); }); describe('empty', () => { - it(`empty`, async () => { + it('empty', async () => { const response1 = await app.request('/test/empty'); expect(response1.status).toBe(503); expect(await response1.text()).toMatch(/Error: this route is empty/); @@ -311,7 +311,7 @@ describe('empty', () => { }); describe('allow_empty', () => { - it(`allow_empty`, async () => { + it('allow_empty', async () => { const response = await app.request('/test/allow_empty'); expect(response.status).toBe(200); const parsed = await parser.parseString(await response.text()); @@ -320,7 +320,7 @@ describe('allow_empty', () => { }); describe('wrong_path', () => { - it(`wrong_path`, async () => { + it('wrong_path', async () => { const response = await app.request('/wrong'); expect(response.status).toBe(404); expect(response.headers.get('cache-control')).toBe(`public, max-age=${config.cache.routeExpire}`); @@ -329,7 +329,7 @@ describe('wrong_path', () => { }); describe('fulltext_mode', () => { - it(`fulltext`, async () => { + it('fulltext', async () => { const response = await app.request('/test/1?mode=fulltext'); expect(response.status).toBe(200); const parsed = await parser.parseString(await response.text()); @@ -338,7 +338,7 @@ describe('fulltext_mode', () => { }); describe('complicated_description', () => { - it(`complicated_description`, async () => { + it('complicated_description', async () => { const response = await app.request('/test/complicated'); expect(response.status).toBe(200); const parsed = await parser.parseString(await response.text()); @@ -359,7 +359,7 @@ describe('complicated_description', () => { }); describe('multimedia_description', () => { - it(`multimedia_description`, async () => { + it('multimedia_description', async () => { const response = await app.request('/test/multimedia'); expect(response.status).toBe(200); const parsed = await parser.parseString(await response.text()); @@ -375,7 +375,7 @@ describe('multimedia_description', () => { }); describe('sort', () => { - it(`sort`, async () => { + it('sort', async () => { const response = await app.request('/test/sort'); expect(response.status).toBe(200); const parsed = await parser.parseString(await response.text()); @@ -387,7 +387,7 @@ describe('sort', () => { }); describe('mess parameter', () => { - it(`date`, async () => { + it('date', async () => { const response = await app.request('/test/mess'); expect(response.status).toBe(200); const parsed = await parser.parseString(await response.text()); @@ -397,7 +397,7 @@ describe('mess parameter', () => { }); describe('opencc', () => { - it(`opencc`, async () => { + it('opencc', async () => { const response = await app.request('/test/opencc?opencc=t2s'); const parsed = await parser.parseString(await response.text()); expect(parsed.items[0].title).toBe('小可爱'); @@ -406,7 +406,7 @@ describe('opencc', () => { }); describe('brief', () => { - it(`brief`, async () => { + it('brief', async () => { const response = await app.request('/test/brief?brief=100'); const parsed = await parser.parseString(await response.text()); expect(parsed.items[0].title).toBe('小可愛'); @@ -417,7 +417,7 @@ describe('brief', () => { }); describe('multi parameter', () => { - it(`filter before limit`, async () => { + it('filter before limit', async () => { const response = await app.request('/test/filter-limit?filterout_title=2&limit=2'); const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(2); diff --git a/lib/middleware/parameter.ts b/lib/middleware/parameter.ts index d3b31692c..07e70e098 100644 --- a/lib/middleware/parameter.ts +++ b/lib/middleware/parameter.ts @@ -414,7 +414,7 @@ const middleware: MiddlewareHandler = async (ctx, next) => { } } } else { - throw new Error(`Invalid parameter brief. Please check the doc https://docs.rsshub.app/guide/parameters#shu-chu-jian-xun`); + throw new Error('Invalid parameter brief. Please check the doc https://docs.rsshub.app/guide/parameters#shu-chu-jian-xun'); } } // some parameters are processed in `anti-hotlink.js` diff --git a/lib/registry.test.ts b/lib/registry.test.ts index a66edacf6..dfbdde572 100644 --- a/lib/registry.test.ts +++ b/lib/registry.test.ts @@ -5,7 +5,7 @@ import { config } from '@/config'; describe('registry', () => { // root - it(`/`, async () => { + it('/', async () => { const response = await app.request('/'); expect(response.status).toBe(200); expect(response.headers.get('content-type')).toBe('text/html; charset=UTF-8'); diff --git a/lib/routes/163/music/artist-songs.ts b/lib/routes/163/music/artist-songs.ts index d60905d33..3ebf5cb07 100644 --- a/lib/routes/163/music/artist-songs.ts +++ b/lib/routes/163/music/artist-songs.ts @@ -24,7 +24,7 @@ export const route: Route = { async function handler(ctx) { const id = ctx.req.param('id'); - const { data } = await got(`https://music.163.com/api/v1/artist/songs`, { + const { data } = await got('https://music.163.com/api/v1/artist/songs', { headers: { Referer: 'https://music.163.com/', }, diff --git a/lib/routes/163/news/special.ts b/lib/routes/163/news/special.ts index 70b969f8f..ea7d1948c 100644 --- a/lib/routes/163/news/special.ts +++ b/lib/routes/163/news/special.ts @@ -52,49 +52,49 @@ async function handler(ctx) { let type; switch (selectedType) { case 1: - type = `BD21K0DLwangning`; // 轻松一刻 + type = 'BD21K0DLwangning'; // 轻松一刻 break; case 2: - type = `CICMICLUwangning`; // 槽值 + type = 'CICMICLUwangning'; // 槽值 break; case 3: - type = `CICMOMBLwangning`; // 人间 + type = 'CICMOMBLwangning'; // 人间 break; case 4: - type = `CICMPVC5wangning`; // 大国小民 + type = 'CICMPVC5wangning'; // 大国小民 break; case 5: - type = `CICMLCOUwangning`; // 三三有梗 + type = 'CICMLCOUwangning'; // 三三有梗 break; case 6: - type = `D551V75Cwangning`; // 数读 + type = 'D551V75Cwangning'; // 数读 break; case 7: - type = `D55253RHwangning`; // 看客 + type = 'D55253RHwangning'; // 看客 break; case 8: - type = `D553A53Lwangning`; // 下划线 + type = 'D553A53Lwangning'; // 下划线 break; case 9: - type = `D553PGHQwangning`; // 谈心社 + type = 'D553PGHQwangning'; // 谈心社 break; case 10: - type = `CICMS5BIwangning`; // 哒哒 + type = 'CICMS5BIwangning'; // 哒哒 break; case 11: - type = `CQ9UDVKOwangning`; // 胖编怪聊 + type = 'CQ9UDVKOwangning'; // 胖编怪聊 break; case 12: - type = `CQ9UJIJNwangning`; // 曲一刀 + type = 'CQ9UJIJNwangning'; // 曲一刀 break; case 13: - type = `BD284UM8wangning`; // 今日之声 + type = 'BD284UM8wangning'; // 今日之声 break; case 14: - type = `CICMMGBHwangning`; // 浪潮 + type = 'CICMMGBHwangning'; // 浪潮 break; case 15: - type = `D5543R68wangning`; // 沸点 + type = 'D5543R68wangning'; // 沸点 break; default: break; diff --git a/lib/routes/2023game/index.ts b/lib/routes/2023game/index.ts index 2c10cfb5b..c5f412936 100644 --- a/lib/routes/2023game/index.ts +++ b/lib/routes/2023game/index.ts @@ -41,7 +41,7 @@ async function handler(ctx: Context): Promise { const response = await got(currentUrl); const $ = load(response.data as any); - let selector = `.news`; + let selector = '.news'; if (tab !== 'all') { selector = `#${tab} > ${selector}`; } diff --git a/lib/routes/3kns/index.tsx b/lib/routes/3kns/index.tsx index b2f9eb7fa..f4ee6449c 100644 --- a/lib/routes/3kns/index.tsx +++ b/lib/routes/3kns/index.tsx @@ -82,7 +82,7 @@ async function handler(ctx: Context): Promise { const response = await got(currentUrl); const $ = load(response.data as any); - const selector = `form .newItem`; + const selector = 'form .newItem'; const items: DataItem[] = $(selector) .toArray() .map((item) => { diff --git a/lib/routes/4gamers/tag.ts b/lib/routes/4gamers/tag.ts index c9dba110e..c10e916ce 100644 --- a/lib/routes/4gamers/tag.ts +++ b/lib/routes/4gamers/tag.ts @@ -32,7 +32,7 @@ async function handler(ctx) { const tag = ctx.req.param('tag'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25; - const { data: response } = await got(`https://www.4gamers.com.tw/site/api/news/by-tag`, { + const { data: response } = await got('https://www.4gamers.com.tw/site/api/news/by-tag', { searchParams: { tag, pageSize: limit, diff --git a/lib/routes/4kup/popular.ts b/lib/routes/4kup/popular.ts index b55d89e13..4f1e71018 100644 --- a/lib/routes/4kup/popular.ts +++ b/lib/routes/4kup/popular.ts @@ -49,7 +49,7 @@ function getPeriodConfig(period) { } return { url: `${SUB_URL}most-view/`, - range: `all`, + range: 'all', title: `${SUB_NAME_PREFIX} - Most views`, }; } diff --git a/lib/routes/50forum/zhuanjia.ts b/lib/routes/50forum/zhuanjia.ts index 580a50683..c5687eb29 100644 --- a/lib/routes/50forum/zhuanjia.ts +++ b/lib/routes/50forum/zhuanjia.ts @@ -64,7 +64,7 @@ async function handler() { ) ); return { - title: `中国经济50人论坛专家文章`, + title: '中国经济50人论坛专家文章', link: 'https://www.50forum.org.cn/portal/list/index.html?id=6', description: '中国经济50人论坛专家文章', item: out, diff --git a/lib/routes/8kcos/utils.ts b/lib/routes/8kcos/utils.ts index 237317eae..ee3f03fed 100644 --- a/lib/routes/8kcos/utils.ts +++ b/lib/routes/8kcos/utils.ts @@ -7,7 +7,7 @@ export const SUB_NAME_PREFIX = '8KCosplay'; export const SUB_URL = 'https://www.8kcosplay.com'; export const getPosts = async (limit: number, options?: { categories?: number; tags?: number }) => { - const data = await ofetch(`https://www.8kcosplay.com/wp-json/wp/v2/posts`, { + const data = await ofetch('https://www.8kcosplay.com/wp-json/wp/v2/posts', { query: { per_page: limit, _embed: '', @@ -26,7 +26,7 @@ export const getPosts = async (limit: number, options?: { categories?: number; t export const getCategoryInfo = (category: string) => cache.tryGet(`8kcosplay:category:${category}`, async () => { - const data = await ofetch(`https://www.8kcosplay.com/wp-json/wp/v2/categories`, { + const data = await ofetch('https://www.8kcosplay.com/wp-json/wp/v2/categories', { query: { slug: category, }, @@ -45,7 +45,7 @@ export const getCategoryInfo = (category: string) => export const getTagInfo = (tag: string) => cache.tryGet(`8kcosplay:tag:${tag}`, async () => { - const data = await ofetch(`https://www.8kcosplay.com/wp-json/wp/v2/tags`, { + const data = await ofetch('https://www.8kcosplay.com/wp-json/wp/v2/tags', { query: { slug: tag, }, diff --git a/lib/routes/acg17/post.ts b/lib/routes/acg17/post.ts index c3bd077cd..2db840a31 100644 --- a/lib/routes/acg17/post.ts +++ b/lib/routes/acg17/post.ts @@ -32,7 +32,7 @@ async function handler() { const response = await got(`${host}/wp-json/wp/v2/posts?per_page=30`); const list = response.data; return { - title: `ACG17 - 全部文章`, + title: 'ACG17 - 全部文章', link: `${host}/blog`, description: 'ACG17 - 全部文章', item: list.map((item) => ({ diff --git a/lib/routes/aiea/index.ts b/lib/routes/aiea/index.ts index d7ad69f45..630e676f9 100644 --- a/lib/routes/aiea/index.ts +++ b/lib/routes/aiea/index.ts @@ -49,7 +49,7 @@ async function handler(ctx) { return await buildData({ link, url: link, - title: `%title%`, + title: '%title%', params: { title: 'AIEA Seminars', }, diff --git a/lib/routes/aijishu/index.ts b/lib/routes/aijishu/index.ts index 9371e5643..1184967c3 100644 --- a/lib/routes/aijishu/index.ts +++ b/lib/routes/aijishu/index.ts @@ -30,7 +30,7 @@ export const route: Route = { async function handler(ctx) { const { type, name = 'newest' } = ctx.req.param(); - const u = name === 'newest' ? `https://aijishu.com/` : `https://aijishu.com/${type}/${name}`; + const u = name === 'newest' ? 'https://aijishu.com/' : `https://aijishu.com/${type}/${name}`; const html = await got(u); const $ = load(html.data); diff --git a/lib/routes/aip/journal-pupp.ts b/lib/routes/aip/journal-pupp.ts index a6eb8dcaf..0e9cf10e5 100644 --- a/lib/routes/aip/journal-pupp.ts +++ b/lib/routes/aip/journal-pupp.ts @@ -11,7 +11,7 @@ import { puppeteerGet, renderDesc } from './utils'; const handler = async (ctx) => { const pub = ctx.req.param('pub'); const jrn = ctx.req.param('jrn'); - const host = `https://pubs.aip.org`; + const host = 'https://pubs.aip.org'; const jrnlUrl = `${host}/${pub}/${jrn}/issue`; if (!isValidHost(pub)) { throw new InvalidParameterError('Invalid pub'); diff --git a/lib/routes/aip/journal.ts b/lib/routes/aip/journal.ts index f958c3a5b..e561eba21 100644 --- a/lib/routes/aip/journal.ts +++ b/lib/routes/aip/journal.ts @@ -36,7 +36,7 @@ export const route: Route = { async function handler(ctx) { const pub = ctx.req.param('pub'); const jrn = ctx.req.param('jrn'); - const host = `https://pubs.aip.org`; + const host = 'https://pubs.aip.org'; const jrnlUrl = `${host}/${pub}/${jrn}/issue`; const { data: response } = await got.get(jrnlUrl); diff --git a/lib/routes/airchina/index.ts b/lib/routes/airchina/index.ts index dbe342e58..8f92d8b5f 100644 --- a/lib/routes/airchina/index.ts +++ b/lib/routes/airchina/index.ts @@ -36,8 +36,8 @@ async function handler() { const data = await buildData({ link, url: link, - title: `%title%`, - description: `%description%`, + title: '%title%', + description: '%description%', params: { title: '国航服务公告', description: '中国国际航空公司服务公告', diff --git a/lib/routes/alpinelinux/pkgs.ts b/lib/routes/alpinelinux/pkgs.ts index bcaf1c4aa..12a754649 100644 --- a/lib/routes/alpinelinux/pkgs.ts +++ b/lib/routes/alpinelinux/pkgs.ts @@ -14,7 +14,7 @@ export const route: Route = { path: '/pkgs/:name/:routeParams?', parameters: { name: 'Packages name', routeParams: 'Filters of packages type. E.g. branch=edge&repo=main&arch=armv7&maintainer=Jakub%20Jirutka' }, example: '/alpinelinux/pkgs/nodejs', - description: `Alpine Linux packages update`, + description: 'Alpine Linux packages update', handler, radar: [ { diff --git a/lib/routes/alternativeto/platform.ts b/lib/routes/alternativeto/platform.ts index 8d3e5d1df..56ab4cfb7 100644 --- a/lib/routes/alternativeto/platform.ts +++ b/lib/routes/alternativeto/platform.ts @@ -27,7 +27,7 @@ export const route: Route = { name: 'Platform Software', maintainers: ['JimenezLi'], handler, - description: `> routeParms can be copied from original site URL, example: \`/alternativeto/platform/firefox/license=free\``, + description: '> routeParms can be copied from original site URL, example: `/alternativeto/platform/firefox/license=free`', }; async function handler(ctx) { diff --git a/lib/routes/alternativeto/software.ts b/lib/routes/alternativeto/software.ts index 8a23ff78b..a9ab26484 100644 --- a/lib/routes/alternativeto/software.ts +++ b/lib/routes/alternativeto/software.ts @@ -27,7 +27,7 @@ export const route: Route = { name: 'Software Alternatives', maintainers: ['JimenezLi'], handler, - description: `> routeParms can be copied from original site URL, example: \`/alternativeto/software/cpp/license=opensource&platform=windows\``, + description: '> routeParms can be copied from original site URL, example: `/alternativeto/software/cpp/license=opensource&platform=windows`', }; async function handler(ctx) { diff --git a/lib/routes/annualreviews/index.ts b/lib/routes/annualreviews/index.ts index 632905078..4ab89193f 100644 --- a/lib/routes/annualreviews/index.ts +++ b/lib/routes/annualreviews/index.ts @@ -37,7 +37,7 @@ async function handler(ctx) { const id = ctx.req.param('id'); const rootUrl = 'https://www.annualreviews.org'; - const apiRootUrl = `https://api.crossref.org`; + const apiRootUrl = 'https://api.crossref.org'; const feedUrl = `${rootUrl}/r/${id}_rss`; const currentUrl = `${rootUrl}/toc/${id}/current`; diff --git a/lib/routes/apnews/sitemap.ts b/lib/routes/apnews/sitemap.ts index 1abf1fec0..48f68db25 100644 --- a/lib/routes/apnews/sitemap.ts +++ b/lib/routes/apnews/sitemap.ts @@ -61,7 +61,7 @@ async function handler(ctx) { .find(String.raw`news\:publication_date`) .text() ); - const lastmod = timezone(parseDate($(e).find(`lastmod`).text()), -4); + const lastmod = timezone(parseDate($(e).find('lastmod').text()), -4); const language = LANGUAGE_MAP.get( $(e) .find(String.raw`news\:language`) diff --git a/lib/routes/apple/podcast.ts b/lib/routes/apple/podcast.ts index ecca6a797..ffaaaeec0 100644 --- a/lib/routes/apple/podcast.ts +++ b/lib/routes/apple/podcast.ts @@ -37,7 +37,7 @@ async function handler(ctx) { const { id, region } = ctx.req.param(); const numericId = id.match(/id(\d+)/)?.[1]; const baseUrl = 'https://podcasts.apple.com'; - const link = `${baseUrl}/${region || `cn`}/podcast/${id}`; + const link = `${baseUrl}/${region || 'cn'}/podcast/${id}`; const response = await ofetch(link); diff --git a/lib/routes/baidu/tieba/forum.tsx b/lib/routes/baidu/tieba/forum.tsx index 8ba4ab809..9c001b7e5 100644 --- a/lib/routes/baidu/tieba/forum.tsx +++ b/lib/routes/baidu/tieba/forum.tsx @@ -34,7 +34,7 @@ async function handler(ctx) { const params = { kw: encodeURIComponent(kw) }; ctx.req.path.includes('good') && (params.tab = 'good'); cid && (params.cid = cid); - const { data } = await got(`https://tieba.baidu.com/f`, { + const { data } = await got('https://tieba.baidu.com/f', { headers: { Referer: 'https://tieba.baidu.com/', }, diff --git a/lib/routes/baidu/tieba/user.ts b/lib/routes/baidu/tieba/user.ts index a5a9288e4..d757866eb 100644 --- a/lib/routes/baidu/tieba/user.ts +++ b/lib/routes/baidu/tieba/user.ts @@ -21,7 +21,7 @@ export const route: Route = { name: '用户帖子', maintainers: ['igxlin', 'nczitzk'], handler, - description: `用户 ID 可以通过打开用户的主页后查看地址栏的 \`un\` 字段来获取。`, + description: '用户 ID 可以通过打开用户的主页后查看地址栏的 `un` 字段来获取。', }; async function handler(ctx) { diff --git a/lib/routes/bendibao/news.ts b/lib/routes/bendibao/news.ts index c97c77a9f..e9ed29131 100644 --- a/lib/routes/bendibao/news.ts +++ b/lib/routes/bendibao/news.ts @@ -59,7 +59,7 @@ async function handler(ctx) { const title = $('title') .text() - .replace(/-爱上本地宝,生活会更好/, '') + `焦点资讯`; + .replace(/-爱上本地宝,生活会更好/, '') + '焦点资讯'; let items = $('ul.focus-news li') .toArray() diff --git a/lib/routes/bestblogs/feeds.ts b/lib/routes/bestblogs/feeds.ts index 151f2b1e5..95ea2614b 100644 --- a/lib/routes/bestblogs/feeds.ts +++ b/lib/routes/bestblogs/feeds.ts @@ -100,8 +100,8 @@ async function handler(ctx) { })); return { - title: `Bestblogs.dev`, - link: `https://www.bestblogs.dev/feeds`, + title: 'Bestblogs.dev', + link: 'https://www.bestblogs.dev/feeds', item: items, }; } diff --git a/lib/routes/bilibili/cache.ts b/lib/routes/bilibili/cache.ts index e4add3e22..5d71a3798 100644 --- a/lib/routes/bilibili/cache.ts +++ b/lib/routes/bilibili/cache.ts @@ -196,7 +196,7 @@ const getUserInfoFromLiveID = (liveID) => { const getVideoNameFromId = (aid, bvid) => { const key = `bili-videoname-from-id-${bvid || aid}`; return cache.tryGet(key, async () => { - const { data } = await got(`https://api.bilibili.com/x/web-interface/view`, { + const { data } = await got('https://api.bilibili.com/x/web-interface/view', { searchParams: { aid: aid || undefined, bvid: bvid || undefined, diff --git a/lib/routes/bilibili/check-cookie.ts b/lib/routes/bilibili/check-cookie.ts index f320751b6..f9886cf76 100644 --- a/lib/routes/bilibili/check-cookie.ts +++ b/lib/routes/bilibili/check-cookie.ts @@ -19,17 +19,17 @@ async function handler() { }; } - const response = await ofetch(`https://api.bilibili.com/x/web-interface/nav`, { + const response = await ofetch('https://api.bilibili.com/x/web-interface/nav', { headers: { - Referer: `https://space.bilibili.com/1/`, + Referer: 'https://space.bilibili.com/1/', Cookie: cookie as string, }, }); const isResponseValid = response.code === 0 && !!response.data.mid; - const subtitleResponse = await ofetch(`https://api.bilibili.com/x/player/wbi/v2?bvid=BV1iU411o7R2&cid=1550543560`, { + const subtitleResponse = await ofetch('https://api.bilibili.com/x/player/wbi/v2?bvid=BV1iU411o7R2&cid=1550543560', { headers: { - Referer: `https://www.bilibili.com/video/BV1iU411o7R2`, + Referer: 'https://www.bilibili.com/video/BV1iU411o7R2', Cookie: cookie, }, }); diff --git a/lib/routes/bilibili/followings-article.ts b/lib/routes/bilibili/followings-article.ts index 1798fd935..84132dbb7 100644 --- a/lib/routes/bilibili/followings-article.ts +++ b/lib/routes/bilibili/followings-article.ts @@ -75,7 +75,7 @@ async function handler(ctx) { return { title: `${name} 关注专栏动态`, - link: `https://t.bilibili.com/?tab=64`, + link: 'https://t.bilibili.com/?tab=64', item: out, }; } diff --git a/lib/routes/bilibili/followings-dynamic.ts b/lib/routes/bilibili/followings-dynamic.ts index 879409655..6dc022692 100644 --- a/lib/routes/bilibili/followings-dynamic.ts +++ b/lib/routes/bilibili/followings-dynamic.ts @@ -212,7 +212,7 @@ async function handler(ctx) { return { title: `${name} 关注的动态`, - link: `https://t.bilibili.com`, + link: 'https://t.bilibili.com', description: `${name} 关注的动态`, item: items, }; diff --git a/lib/routes/bilibili/followings-video.ts b/lib/routes/bilibili/followings-video.ts index dd64b01bd..1e56db436 100644 --- a/lib/routes/bilibili/followings-video.ts +++ b/lib/routes/bilibili/followings-video.ts @@ -79,7 +79,7 @@ async function handler(ctx) { return { title: `${name} 关注视频动态`, - link: `https://t.bilibili.com/?tab=8`, + link: 'https://t.bilibili.com/?tab=8', item: out, }; } diff --git a/lib/routes/bilibili/hot-search.ts b/lib/routes/bilibili/hot-search.ts index a644a3dc7..ad759fff4 100644 --- a/lib/routes/bilibili/hot-search.ts +++ b/lib/routes/bilibili/hot-search.ts @@ -39,7 +39,7 @@ async function handler() { method: 'get', url, headers: { - Referer: `https://api.bilibili.com`, + Referer: 'https://api.bilibili.com', }, }); const trending = response?.data?.data?.trending; diff --git a/lib/routes/bilibili/manga-followings.ts b/lib/routes/bilibili/manga-followings.ts index 29af1585a..9d9248a83 100644 --- a/lib/routes/bilibili/manga-followings.ts +++ b/lib/routes/bilibili/manga-followings.ts @@ -47,7 +47,7 @@ async function handler(ctx) { const link = 'https://manga.bilibili.com/account-center'; const response = await got({ method: 'POST', - url: `https://manga.bilibili.com/twirp/bookshelf.v1.Bookshelf/ListFavorite?device=pc&platform=web`, + url: 'https://manga.bilibili.com/twirp/bookshelf.v1.Bookshelf/ListFavorite?device=pc&platform=web', json: { page_num: 1, page_size, order: 2, wait_free: 0 }, headers: { Referer: link, diff --git a/lib/routes/bilibili/popular.ts b/lib/routes/bilibili/popular.ts index 6398942ae..b03e7a00b 100644 --- a/lib/routes/bilibili/popular.ts +++ b/lib/routes/bilibili/popular.ts @@ -27,7 +27,7 @@ async function handler(ctx) { const embed = !ctx.req.param('embed'); const response = await got({ method: 'get', - url: `https://api.bilibili.com/x/web-interface/popular`, + url: 'https://api.bilibili.com/x/web-interface/popular', headers: { Referer: 'https://www.bilibili.com/', }, @@ -35,9 +35,9 @@ async function handler(ctx) { const list = response.data.data.list; return { - title: `bilibili 综合热门`, + title: 'bilibili 综合热门', link: 'https://www.bilibili.com', - description: `bilibili 综合热门`, + description: 'bilibili 综合热门', item: list && list.map((item) => ({ diff --git a/lib/routes/bilibili/user-bangumi.ts b/lib/routes/bilibili/user-bangumi.ts index 889fbae48..1be92613f 100644 --- a/lib/routes/bilibili/user-bangumi.ts +++ b/lib/routes/bilibili/user-bangumi.ts @@ -56,7 +56,7 @@ async function handler(ctx) { title: `[${item.new_ep.index_show}]${item.title}`, description: `${item.evaluate}
`, pubDate: new Date(item.new_ep.pub_time ?? Date.now()).toUTCString(), - link: `https://www.bilibili.com/bangumi/play/` + (item.new_ep.id ? `ep${item.new_ep.id}` : `ss${item.season_id}`), + link: 'https://www.bilibili.com/bangumi/play/' + (item.new_ep.id ? `ep${item.new_ep.id}` : `ss${item.season_id}`), })), }; } diff --git a/lib/routes/bilibili/video.ts b/lib/routes/bilibili/video.ts index 9448965ec..e98af3aa3 100644 --- a/lib/routes/bilibili/video.ts +++ b/lib/routes/bilibili/video.ts @@ -53,7 +53,7 @@ async function handler(ctx: Context) { const response = await got(`https://api.bilibili.com/x/space/wbi/arc/search?${params}`, { headers: { Referer: `https://space.bilibili.com/${uid}`, - origin: `https://space.bilibili.com`, + origin: 'https://space.bilibili.com', Cookie: cookie, }, }); diff --git a/lib/routes/bilibili/watchlater.ts b/lib/routes/bilibili/watchlater.ts index 2be2aee30..ab1688bca 100644 --- a/lib/routes/bilibili/watchlater.ts +++ b/lib/routes/bilibili/watchlater.ts @@ -49,7 +49,7 @@ async function handler(ctx) { const response = await got({ method: 'get', - url: `https://api.bilibili.com/x/v2/history/toview`, + url: 'https://api.bilibili.com/x/v2/history/toview', headers: { Referer: `https://space.bilibili.com/${uid}/`, Cookie: cookie, diff --git a/lib/routes/bloomberg/utils.ts b/lib/routes/bloomberg/utils.ts index b1ed65570..215c3b716 100644 --- a/lib/routes/bloomberg/utils.ts +++ b/lib/routes/bloomberg/utils.ts @@ -466,8 +466,8 @@ const nodeRenderers = { } return nextNode(node.content); }, - br: () => `
`, - hr: () => `
`, + br: () => '
', + hr: () => '
', ad: () => {}, blockquote: async (node, nextNode) => `
${await nextNode(node.content)}
`, quote: async (node, nextNode) => `
${await nextNode(node.content)}
`, diff --git a/lib/routes/bnu/dwxgb.ts b/lib/routes/bnu/dwxgb.ts index 4b67dc0bc..2a4b77eb2 100644 --- a/lib/routes/bnu/dwxgb.ts +++ b/lib/routes/bnu/dwxgb.ts @@ -26,7 +26,7 @@ export const route: Route = { name: '党委学生工作部', maintainers: ['Fatpandac'], handler, - description: `\`https://dwxgb.bnu.edu.cn/xwzx/tzgg/index.html\` 则对应为 \`/bnu/dwxgb/xwzx/tzgg`, + description: '`https://dwxgb.bnu.edu.cn/xwzx/tzgg/index.html` 则对应为 `/bnu/dwxgb/xwzx/tzgg', }; async function handler(ctx) { diff --git a/lib/routes/bnu/fe.ts b/lib/routes/bnu/fe.ts index 68ff77d12..c0a36c06f 100644 --- a/lib/routes/bnu/fe.ts +++ b/lib/routes/bnu/fe.ts @@ -18,7 +18,7 @@ export const route: Route = { name: '教育学部-培养动态', maintainers: ['etShaw-zh'], handler, - description: `\`https://fe.bnu.edu.cn/pc/cms1info/list/1/18\` 则对应为 \`/bnu/fe/18`, + description: '`https://fe.bnu.edu.cn/pc/cms1info/list/1/18` 则对应为 `/bnu/fe/18', }; async function handler(ctx) { diff --git a/lib/routes/c114/roll.ts b/lib/routes/c114/roll.ts index 12629867a..76fbc4b1a 100644 --- a/lib/routes/c114/roll.ts +++ b/lib/routes/c114/roll.ts @@ -12,7 +12,7 @@ export const handler = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 15; const rootUrl = 'https://www.c114.com.cn'; - const currentUrl = new URL(`news/roll.asp${original === 'true' ? `?o=true` : ''}`, rootUrl).href; + const currentUrl = new URL(`news/roll.asp${original === 'true' ? '?o=true' : ''}`, rootUrl).href; const { data: response } = await got(currentUrl, { responseType: 'buffer', diff --git a/lib/routes/caixin/blog.ts b/lib/routes/caixin/blog.ts index 89d61546f..0a35b557d 100644 --- a/lib/routes/caixin/blog.ts +++ b/lib/routes/caixin/blog.ts @@ -25,7 +25,7 @@ export const route: Route = { name: '用户博客', maintainers: [], handler, - description: `通过提取文章全文,以提供比官方源更佳的阅读体验.`, + description: '通过提取文章全文,以提供比官方源更佳的阅读体验.', }; async function handler(ctx) { @@ -94,7 +94,7 @@ async function handler(ctx) { const items = await Promise.all(posts.map((item) => cache.tryGet(item.link, () => parseBlogArticle(item)))); return { - title: `财新博客 - 全部`, + title: '财新博客 - 全部', link: 'https://blog.caixin.com', // description: introduce, // image: avatar, diff --git a/lib/routes/caixin/latest.ts b/lib/routes/caixin/latest.ts index 1c1a0ac73..b5df8b1e2 100644 --- a/lib/routes/caixin/latest.ts +++ b/lib/routes/caixin/latest.ts @@ -29,7 +29,7 @@ export const route: Route = { maintainers: ['tpnonthealps'], handler, url: 'caixin.com/', - description: `说明:此 RSS feed 会自动抓取财新网的最新文章,但不包含 FM 及视频内容。订阅用户可根据文档设置环境变量后,在url传入\`fulltext=\`以解锁全文。`, + description: '说明:此 RSS feed 会自动抓取财新网的最新文章,但不包含 FM 及视频内容。订阅用户可根据文档设置环境变量后,在url传入`fulltext=`以解锁全文。', }; async function handler(ctx) { diff --git a/lib/routes/caixin/namespace.ts b/lib/routes/caixin/namespace.ts index b00547f4e..504b3d0ad 100644 --- a/lib/routes/caixin/namespace.ts +++ b/lib/routes/caixin/namespace.ts @@ -3,6 +3,7 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: '财新博客', url: 'caixin.com', - description: `> 网站部分内容需要付费订阅,RSS 仅做更新提醒,不含付费内容。若需要得到付费内容全文,请使用订阅账户在手机网页版登录,然后设置\`CAIXIN_COOKIE\`为至少包含cookie中的以下字段: \`SA_USER_UID\`, \`SA_USER_UNIT\`, \`SA_USER_DEVICE_TYPE\`, \`USER_LOGIN_CODE\``, + description: + '> 网站部分内容需要付费订阅,RSS 仅做更新提醒,不含付费内容。若需要得到付费内容全文,请使用订阅账户在手机网页版登录,然后设置`CAIXIN_COOKIE`为至少包含cookie中的以下字段: `SA_USER_UID`, `SA_USER_UNIT`, `SA_USER_DEVICE_TYPE`, `USER_LOGIN_CODE`', lang: 'zh-CN', }; diff --git a/lib/routes/caixin/utils-fulltext.ts b/lib/routes/caixin/utils-fulltext.ts index 3d1b01da0..e17c54b6b 100644 --- a/lib/routes/caixin/utils-fulltext.ts +++ b/lib/routes/caixin/utils-fulltext.ts @@ -34,7 +34,7 @@ export async function getFulltext(url: string) { const sigValueHex = hextob64(sig.sign()); const isWeekly = url.includes('weekly'); - const res = await ofetch(`https://gateway.caixin.com/api/newauth/checkAuthByIdJsonp`, { + const res = await ofetch('https://gateway.caixin.com/api/newauth/checkAuthByIdJsonp', { query: { type: 1, page: isWeekly ? 0 : 1, diff --git a/lib/routes/castbox/namespace.ts b/lib/routes/castbox/namespace.ts index d7b35eda6..cf504e0f6 100644 --- a/lib/routes/castbox/namespace.ts +++ b/lib/routes/castbox/namespace.ts @@ -3,5 +3,5 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: 'Castbox', url: 'castbox.fm', - description: `Castbox is a podcast distribution network and producer.`, + description: 'Castbox is a podcast distribution network and producer.', }; diff --git a/lib/routes/cau/ele.ts b/lib/routes/cau/ele.ts index 99d251040..38dd4e692 100644 --- a/lib/routes/cau/ele.ts +++ b/lib/routes/cau/ele.ts @@ -26,7 +26,7 @@ export const route: Route = { maintainers: ['shengmaosu'], handler, url: 'ciee.cau.edu.cn/col/col26712/index.html', - description: `#### 信电学院 {#zhong-guo-nong-ye-da-xue-yan-zhao-wang-tong-zhi-gong-gao-xin-dian-xue-yuan}`, + description: '#### 信电学院 {#zhong-guo-nong-ye-da-xue-yan-zhao-wang-tong-zhi-gong-gao-xin-dian-xue-yuan}', }; async function handler() { diff --git a/lib/routes/cbirc/index.ts b/lib/routes/cbirc/index.ts index 41a1bbfdc..1f6d8e3bd 100644 --- a/lib/routes/cbirc/index.ts +++ b/lib/routes/cbirc/index.ts @@ -4,69 +4,69 @@ import got from '@/utils/got'; const categories = { jgdt: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '监管动态', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=915,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=915,pageIndex=1,pageSize=18.json', title: '监管动态', }, ggtz: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '公告通知', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=925,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=925,pageIndex=1,pageSize=18.json', title: '公告通知', }, zcfg: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '政策法规', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=926,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=926,pageIndex=1,pageSize=18.json', title: '政策法规', }, zcjd: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '政策解读', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=916,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=916,pageIndex=1,pageSize=18.json', title: '政策解读', }, zqyj: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '征求意见', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=951,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=951,pageIndex=1,pageSize=18.json', title: '征求意见', }, xzxk: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '行政许可', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=930,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=930,pageIndex=1,pageSize=18.json', title: '行政许可', }, xzcf: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '行政处罚', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=931,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=931,pageIndex=1,pageSize=18.json', title: '行政处罚', }, xzjgcs: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '行政监管措施', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=932,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=932,pageIndex=1,pageSize=18.json', title: '行政监管措施', }, gzlw: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '工作论文', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=934,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=934,pageIndex=1,pageSize=18.json', title: '工作论文', }, jrzgyj: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '金融监管研究', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=935,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=935,pageIndex=1,pageSize=18.json', title: '金融监管研究', }, tjxx: { - baseUrl: `http://www.cbirc.gov.cn`, + baseUrl: 'http://www.cbirc.gov.cn', description: '统计信息', - link: `http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=954,pageIndex=1,pageSize=18.json`, + link: 'http://www.cbirc.gov.cn/cn/static/data/DocInfo/SelectDocByItemIdAndChild/data_itemId=954,pageIndex=1,pageSize=18.json', title: '统计信息', }, }; @@ -101,7 +101,7 @@ async function handler(ctx) { method: 'get', url: cat.link, headers: { - Referer: `http://www.cbirc.gov.cn`, + Referer: 'http://www.cbirc.gov.cn', }, }); return resp.data; diff --git a/lib/routes/cctv/xwlb.ts b/lib/routes/cctv/xwlb.ts index 9d8856f6b..c22da3512 100644 --- a/lib/routes/cctv/xwlb.ts +++ b/lib/routes/cctv/xwlb.ts @@ -44,7 +44,7 @@ export const route: Route = { maintainers: ['zengxs'], handler, url: 'tv.cctv.com/lm/xwlb', - description: `新闻联播内容摘要。`, + description: '新闻联播内容摘要。', }; async function handler(ctx) { diff --git a/lib/routes/chaping/banner.ts b/lib/routes/chaping/banner.ts index e26ecb272..662a3c162 100644 --- a/lib/routes/chaping/banner.ts +++ b/lib/routes/chaping/banner.ts @@ -28,7 +28,7 @@ export const route: Route = { }; async function handler() { - const rootUrl = `https://chaping.cn/`; + const rootUrl = 'https://chaping.cn/'; const response = await got({ method: 'get', url: rootUrl, diff --git a/lib/routes/chsi/hotnews.ts b/lib/routes/chsi/hotnews.ts index e0d54ea8c..9caef413c 100644 --- a/lib/routes/chsi/hotnews.ts +++ b/lib/routes/chsi/hotnews.ts @@ -67,7 +67,7 @@ async function handler() { ); return { - title: `中国研究生招生信息网 - 热点`, + title: '中国研究生招生信息网 - 热点', link: host, description: '中国研究生招生信息网 - 热点', item: items, diff --git a/lib/routes/chsi/kydt.ts b/lib/routes/chsi/kydt.ts index 830fbee1b..862ff9176 100644 --- a/lib/routes/chsi/kydt.ts +++ b/lib/routes/chsi/kydt.ts @@ -65,7 +65,7 @@ async function handler() { ); return { - title: `中国研究生招生信息网 - 考研动态`, + title: '中国研究生招生信息网 - 考研动态', link: `${host}/kyzx/kydt/`, description: '中国研究生招生信息网 - 考研动态', item: items, diff --git a/lib/routes/chub/characters.ts b/lib/routes/chub/characters.ts index ae237a85f..df1bebf56 100644 --- a/lib/routes/chub/characters.ts +++ b/lib/routes/chub/characters.ts @@ -71,7 +71,7 @@ async function handler() { link: `${hostURL}/${item.fullPath}`, author: String(item.fullPath.split('/', 1)), enclosure_url: item.max_res_url, - enclosure_type: `image/png`, + enclosure_type: 'image/png', category: item.topics, })), }; diff --git a/lib/routes/civitai/discussions.ts b/lib/routes/civitai/discussions.ts index 200574e1b..9006f4946 100644 --- a/lib/routes/civitai/discussions.ts +++ b/lib/routes/civitai/discussions.ts @@ -70,7 +70,7 @@ async function handler(ctx) { return { title: `Civitai model ${params.modelId} discussions`, - link: `https://civitai.com/`, + link: 'https://civitai.com/', item: items, }; } diff --git a/lib/routes/civitai/models.ts b/lib/routes/civitai/models.ts index 06cafbe50..d1a75ada0 100644 --- a/lib/routes/civitai/models.ts +++ b/lib/routes/civitai/models.ts @@ -28,7 +28,7 @@ export const route: Route = { }; async function handler() { - const { data } = await got(`https://civitai.com/api/v1/models`, { + const { data } = await got('https://civitai.com/api/v1/models', { searchParams: { limit: 20, sort: 'Newest', @@ -45,8 +45,8 @@ async function handler() { })); return { - title: `Civitai latest models`, - link: `https://civitai.com/`, + title: 'Civitai latest models', + link: 'https://civitai.com/', item: items, }; } diff --git a/lib/routes/cnblogs/common.ts b/lib/routes/cnblogs/common.ts index c0dfee69e..3e7be2671 100644 --- a/lib/routes/cnblogs/common.ts +++ b/lib/routes/cnblogs/common.ts @@ -28,7 +28,7 @@ export const route: Route = { maintainers: ['hujingnb'], handler, url: 'www.cnblogs.com/pick', - description: `在博客园主页的分类出可查看所有类型。例如,go 的分类地址为: \`https://www.cnblogs.com/cate/go/\`, 则: [\`/cnblogs/cate/go\`](https://rsshub.app/cnblogs/cate/go)`, + description: '在博客园主页的分类出可查看所有类型。例如,go 的分类地址为: `https://www.cnblogs.com/cate/go/`, 则: [`/cnblogs/cate/go`](https://rsshub.app/cnblogs/cate/go)', }; async function handler(ctx) { diff --git a/lib/routes/cncf/reports.ts b/lib/routes/cncf/reports.ts index 7e7e2890b..16785af22 100644 --- a/lib/routes/cncf/reports.ts +++ b/lib/routes/cncf/reports.ts @@ -47,7 +47,7 @@ async function handler() { ); return { - title: `CNCF - Reports`, + title: 'CNCF - Reports', link: url, item: items, }; diff --git a/lib/routes/cntheory/paper.tsx b/lib/routes/cntheory/paper.tsx index ea3758051..4d63c0459 100644 --- a/lib/routes/cntheory/paper.tsx +++ b/lib/routes/cntheory/paper.tsx @@ -23,7 +23,7 @@ export const route: Route = { name: '学习时报', maintainers: ['nczitzk'], handler, - description: `如订阅 **第 A1 版:国内大局**,路由为 [\`/cntheory/paper/国内大局\`](https://rsshub.app/cntheory/paper/国内大局)。`, + description: '如订阅 **第 A1 版:国内大局**,路由为 [`/cntheory/paper/国内大局`](https://rsshub.app/cntheory/paper/国内大局)。', }; async function handler(ctx) { diff --git a/lib/routes/comic-fuz/magazine.ts b/lib/routes/comic-fuz/magazine.ts index 0d6c09072..37268378d 100644 --- a/lib/routes/comic-fuz/magazine.ts +++ b/lib/routes/comic-fuz/magazine.ts @@ -30,7 +30,7 @@ export const route: Route = { const { id } = ctx.req.param(); const baseUrl = 'https://comic-fuz.com'; const openUrl = `${baseUrl}/magazine/${id}`; - const imgUrl = `https://img.comic-fuz.com`; + const imgUrl = 'https://img.comic-fuz.com'; const response = await ofetch(openUrl, { headers: { diff --git a/lib/routes/comic-fuz/manga.ts b/lib/routes/comic-fuz/manga.ts index 341e85f95..c6df1c73b 100644 --- a/lib/routes/comic-fuz/manga.ts +++ b/lib/routes/comic-fuz/manga.ts @@ -30,7 +30,7 @@ export const route: Route = { const { id } = ctx.req.param(); const baseUrl = 'https://comic-fuz.com'; const openUrl = `${baseUrl}/manga/${id}`; - const imgUrl = `https://img.comic-fuz.com`; + const imgUrl = 'https://img.comic-fuz.com'; const response = await ofetch(openUrl, { headers: { diff --git a/lib/routes/coolapk/hot.ts b/lib/routes/coolapk/hot.ts index 13b21508e..85b622c05 100644 --- a/lib/routes/coolapk/hot.ts +++ b/lib/routes/coolapk/hot.ts @@ -58,11 +58,11 @@ const getLinkAndTitle = (type, period) => { statDays: '30days', }, }; - link = `#/feed/coolPictureList?statDays=` + trans[period].statDays + `&listType=statFavNum&buildCard=1&title=` + trans[period].description + `&page=1`; + link = '#/feed/coolPictureList?statDays=' + trans[period].statDays + '&listType=statFavNum&buildCard=1&title=' + trans[period].description + '&page=1'; res.title = '酷图榜-' + trans[period].description; } else { - link = `#/feed/statList?statType=` + periods[period].statType + `&sortField=` + types[type].sortField + `&title=` + periods[period].description + `&page=1`; - res.title = types[type].title + `-` + periods[period].description; + link = '#/feed/statList?statType=' + periods[period].statType + '&sortField=' + types[type].sortField + '&title=' + periods[period].description + '&page=1'; + res.title = types[type].title + '-' + periods[period].description; } res.link = baseURL + encodeURIComponent(link); return res; @@ -129,7 +129,7 @@ async function handler(ctx) { return { title, link: 'https://www.coolapk.com/', - description: `热榜-` + title, + description: '热榜-' + title, item: out, }; } diff --git a/lib/routes/coolapk/huati.ts b/lib/routes/coolapk/huati.ts index 5a21aeb3a..37731016f 100644 --- a/lib/routes/coolapk/huati.ts +++ b/lib/routes/coolapk/huati.ts @@ -44,7 +44,7 @@ async function handler(ctx) { } return { title: `酷安话题-${tag}`, - link: `https://www.coolapk.com/`, + link: 'https://www.coolapk.com/', description: `酷安话题-${tag}`, item: out, }; diff --git a/lib/routes/coolapk/utils.ts b/lib/routes/coolapk/utils.ts index 865b063bb..9ae9bc841 100644 --- a/lib/routes/coolapk/utils.ts +++ b/lib/routes/coolapk/utils.ts @@ -88,13 +88,13 @@ const parseDynamic = async (item) => { const result = await ofetch(itemUrl, { headers: getHeaders(), }); - const message = `

` + result.data?.message.split('\n').join('
') + `

`; + const message = '

' + result.data?.message.split('\n').join('
') + '

'; const picArr = item.picArr.filter(Boolean).map((i) => ``); // 若无图片,item.picArr=[""] return message + picArr.join(''); }); } else { const picArr = item.picArr.filter(Boolean).map((i) => ``); - description = `

` + item.message + `

` + picArr.join(''); + description = '

' + item.message + '

' + picArr.join(''); } const $ = load('
' + description + '
'); title = $('.title-filter').text().trim(); // no need to perform substring because it's will be handled by RSSHub 'TITLE_LENGTH_LIMIT' @@ -103,7 +103,7 @@ const parseDynamic = async (item) => { if (type === 17) { const keys = item.extra_key.split(','); - description += `

` + item.vote.message_title + ` 已选${keys.length}项

`; + description += '

' + item.vote.message_title + ` 已选${keys.length}项

`; for (const i of item.vote.options) { if (keys.includes(String(i.id))) { description += `

${i.title}√

`; diff --git a/lib/routes/cpta/handler.ts b/lib/routes/cpta/handler.ts index 8c4e753c9..c2eb80e6f 100644 --- a/lib/routes/cpta/handler.ts +++ b/lib/routes/cpta/handler.ts @@ -121,12 +121,12 @@ export const route: Route = { { title: '中国人事考试网通知公告', source: ['www.cpta.com.cn/notice.html', 'www.cpta.com.cn'], - target: `/notice`, + target: '/notice', }, { title: '中国人事考试网成绩发布', source: ['www.cpta.com.cn/performance.html', 'www.cpta.com.cn'], - target: `/performance`, + target: '/performance', }, ], example: '/cpta/notice', diff --git a/lib/routes/daily/utils.tsx b/lib/routes/daily/utils.tsx index 0d872befd..fb1fbfcf8 100644 --- a/lib/routes/daily/utils.tsx +++ b/lib/routes/daily/utils.tsx @@ -8,7 +8,7 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; export const baseUrl = 'https://app.daily.dev'; -const gqlUrl = `https://api.daily.dev/graphql`; +const gqlUrl = 'https://api.daily.dev/graphql'; export const variables = { version: 54, loggedIn: false, diff --git a/lib/routes/damai/activity.tsx b/lib/routes/damai/activity.tsx index 24edf2046..6e2a41f70 100644 --- a/lib/routes/damai/activity.tsx +++ b/lib/routes/damai/activity.tsx @@ -21,7 +21,7 @@ export const route: Route = { name: '票务更新', maintainers: ['hoilc', 'Konano'], handler, - description: `城市、分类名、子分类名,请参见[大麦网搜索页面](https://search.damai.cn/search.htm)`, + description: '城市、分类名、子分类名,请参见[大麦网搜索页面](https://search.damai.cn/search.htm)', }; async function handler(ctx) { diff --git a/lib/routes/dangdang/notice.ts b/lib/routes/dangdang/notice.ts index 014290fbd..be920605a 100644 --- a/lib/routes/dangdang/notice.ts +++ b/lib/routes/dangdang/notice.ts @@ -63,7 +63,7 @@ async function handler(ctx) { return { title: `当当开放平台 - ${typeMap[type] || typeMap[0]}`, - link: `https://open.dangdang.com/home/notice/message/1`, + link: 'https://open.dangdang.com/home/notice/message/1', item: result, }; } diff --git a/lib/routes/dcard/section.ts b/lib/routes/dcard/section.ts index 64337340f..8af463ebe 100644 --- a/lib/routes/dcard/section.ts +++ b/lib/routes/dcard/section.ts @@ -28,16 +28,16 @@ async function handler(ctx) { const limit = ctx.req.query('limit') ? Number(ctx.req.query('limit')) : 30; const browser = await puppeteer(); - let link = `https://www.dcard.tw/f`; - let api = `https://www.dcard.tw/service/api/v2`; - let title = `Dcard - `; + let link = 'https://www.dcard.tw/f'; + let api = 'https://www.dcard.tw/service/api/v2'; + let title = 'Dcard - '; if (section !== 'posts' && section !== 'popular' && section !== 'latest') { link += `/${section}`; api += `/forums/${section}`; title += `${section} - `; } - api += `/posts`; + api += '/posts'; if (type === 'popular') { link += '?latest=false'; api += '?popular=true'; diff --git a/lib/routes/ddosi/index.ts b/lib/routes/ddosi/index.ts index 5e7ec5b9f..7035be4d5 100644 --- a/lib/routes/ddosi/index.ts +++ b/lib/routes/ddosi/index.ts @@ -50,7 +50,7 @@ async function handler() { }); return { - title: `雨苁`, + title: '雨苁', link: String(url), item: items, }; diff --git a/lib/routes/dedao/articles.ts b/lib/routes/dedao/articles.ts index c0be9f871..aa618daa4 100644 --- a/lib/routes/dedao/articles.ts +++ b/lib/routes/dedao/articles.ts @@ -79,7 +79,7 @@ async function handler(ctx) { const headers = { Accept: 'application/json, text/plain, */*', 'Content-Type': 'application/json;charset=UTF-8', - Referer: `https://m.igetget.com/share/course/free/detail?id=nb9L2q1e3OxKBPNsdoJrgN8P0Rwo6B`, + Referer: 'https://m.igetget.com/share/course/free/detail?id=nb9L2q1e3OxKBPNsdoJrgN8P0Rwo6B', Origin: 'https://m.igetget.com', }; const max_id = 0; diff --git a/lib/routes/dgtle/tag.ts b/lib/routes/dgtle/tag.ts index 6a8cc9ddc..efe8c94ab 100644 --- a/lib/routes/dgtle/tag.ts +++ b/lib/routes/dgtle/tag.ts @@ -28,7 +28,7 @@ export const handler = async (ctx: Context): Promise => { const items: DataItem[] = ProcessFeedItems(limit, response.data.dataList, $); - const title: string | undefined = $(`div.tags-detail-top-1 h2`).text(); + const title: string | undefined = $('div.tags-detail-top-1 h2').text(); return { title: `${$('title').text().trim().split(/\s/)[0]}${title ? ` - ${title}` : id}`, diff --git a/lib/routes/diershoubing/news.tsx b/lib/routes/diershoubing/news.tsx index 0a5b62f7d..765c2c830 100644 --- a/lib/routes/diershoubing/news.tsx +++ b/lib/routes/diershoubing/news.tsx @@ -69,9 +69,9 @@ async function handler(ctx) { }); return { - title: `二柄APP`, - link: `https://www.diershoubing.com`, - description: `二柄APP新闻`, + title: '二柄APP', + link: 'https://www.diershoubing.com', + description: '二柄APP新闻', item: items, }; } diff --git a/lib/routes/discourse/official.ts b/lib/routes/discourse/official.ts index 4df45e28f..830262c8e 100644 --- a/lib/routes/discourse/official.ts +++ b/lib/routes/discourse/official.ts @@ -16,7 +16,7 @@ export const route: Route = { requireConfig: [ { name: 'DISCOURSE_CONFIG_*', - description: `Configure the Discourse environment variables referring to [https://docs.rsshub.app/deploy/config#discourse](https://docs.rsshub.app/deploy/config#discourse).`, + description: 'Configure the Discourse environment variables referring to [https://docs.rsshub.app/deploy/config#discourse](https://docs.rsshub.app/deploy/config#discourse).', }, ], requirePuppeteer: false, diff --git a/lib/routes/domp4/latest-movie-bt.ts b/lib/routes/domp4/latest-movie-bt.ts index 70e9b9268..1adc9cb5b 100644 --- a/lib/routes/domp4/latest-movie-bt.ts +++ b/lib/routes/domp4/latest-movie-bt.ts @@ -8,7 +8,7 @@ import { getItemList as detailItemList } from './detail'; import { ensureDomain } from './utils'; function getItemList($) { - const list = $(`#vod .list-group-item`) + const list = $('#vod .list-group-item') .toArray() .map((item) => { item = $(item); diff --git a/lib/routes/dongqiudi/utils.ts b/lib/routes/dongqiudi/utils.ts index 6294b06b8..c927dd768 100644 --- a/lib/routes/dongqiudi/utils.ts +++ b/lib/routes/dongqiudi/utils.ts @@ -65,7 +65,7 @@ const ProcessImg = (content) => { const ProcessFeed = async (ctx, type, id) => { const link = `https://www.dongqiudi.com/${type}/${id}.html`; - const apiUrl = `https://api.dongqiudi.com/v3/archive/app/channel/feeds`; + const apiUrl = 'https://api.dongqiudi.com/v3/archive/app/channel/feeds'; const { data: response } = await got(link); let name; diff --git a/lib/routes/douban/other/classification.ts b/lib/routes/douban/other/classification.ts index 4723fd732..56b0c2f36 100644 --- a/lib/routes/douban/other/classification.ts +++ b/lib/routes/douban/other/classification.ts @@ -38,7 +38,7 @@ async function handler(ctx) { return { title: `豆瓣电影分类${score ? `超过 ${score} 分的` : ''}影视`, - link: `https://movie.douban.com/tag/#/?sort=U&range=0,10&tags=`, + link: 'https://movie.douban.com/tag/#/?sort=U&range=0,10&tags=', item: movies .map((item) => { const itemScore = Number.parseFloat(item.rate) || 0; diff --git a/lib/routes/douban/other/playing.ts b/lib/routes/douban/other/playing.ts index 779a40b8c..944c4b8a4 100644 --- a/lib/routes/douban/other/playing.ts +++ b/lib/routes/douban/other/playing.ts @@ -25,13 +25,13 @@ async function handler(ctx) { const score = Number.parseFloat(ctx.req.param('score')) || 0; const response = await got({ method: 'get', - url: `https://movie.douban.com/cinema/nowplaying/beijing`, + url: 'https://movie.douban.com/cinema/nowplaying/beijing', }); const $ = load(response.data); return { title: `正在上映的${score ? `超过 ${score} 分的` : ''}电影`, - link: `https://movie.douban.com/cinema/nowplaying/`, + link: 'https://movie.douban.com/cinema/nowplaying/', item: $('.list-item') .toArray() .map((i) => { diff --git a/lib/routes/douban/people/status.ts b/lib/routes/douban/people/status.ts index 50e335f8c..809777f0e 100644 --- a/lib/routes/douban/people/status.ts +++ b/lib/routes/douban/people/status.ts @@ -50,7 +50,7 @@ export const route: Route = { 豆瓣读书的可读豆瓣广播 RSS`, }; -const headers = { Referer: `https://m.douban.com/` }; +const headers = { Referer: 'https://m.douban.com/' }; function tryFixStatus(status) { let result = { isFixSuccess: true, why: '' }; @@ -222,20 +222,20 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) { activityInDesc += ``; } if (authorNameBold) { - activityInDesc += ``; + activityInDesc += ''; } activityInDesc += status.reshared_status.author.name; if (authorNameBold) { - activityInDesc += ``; + activityInDesc += ''; } if (readable) { - activityInDesc += ``; + activityInDesc += ''; } - activityInDesc += ` 的广播`; + activityInDesc += ' 的广播'; activityInTitle = `转发 ${status.reshared_status.author.name} 的广播`; } else { - activityInDesc = `转发广播`; - activityInTitle = `转发广播`; + activityInDesc = '转发广播'; + activityInTitle = '转发广播'; } } else { activityInDesc = status.activity; @@ -251,16 +251,16 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) { usernameAndAvatar += ``; } if (authorNameBold) { - usernameAndAvatar += ``; + usernameAndAvatar += ''; } usernameAndAvatar += status.author.name; if (authorNameBold) { - usernameAndAvatar += ``; + usernameAndAvatar += ''; } if (readable) { - usernameAndAvatar += ``; + usernameAndAvatar += ''; } - usernameAndAvatar += ` `; + usernameAndAvatar += ' '; description += usernameAndAvatar + activityInDesc + (showColonInDesc ? ': ' : ''); } @@ -299,7 +299,7 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) { } if (status.images && status.images.length) { - description += readable ? `
` : `
`; + description += readable ? '
' : '
'; // 一些RSS Reader会识别所有标签作为内含图片显示,我们不想要头像也作为内含图片之一 // 让所有配图在description的最前面再次出现一次,但宽高设为0 @@ -320,7 +320,7 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) { } if (status.video_info) { - description += readable ? `
` : `
`; + description += readable ? '
' : '
'; const videoCover = status.video_info.cover_url; const videoSrc = status.video_info.video_url; if (videoSrc) { @@ -350,16 +350,16 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) { usernameAndAvatar += ``; } if (authorNameBold) { - usernameAndAvatar += ``; + usernameAndAvatar += ''; } usernameAndAvatar += status.parent_status.author.name; if (authorNameBold) { - usernameAndAvatar += ``; + usernameAndAvatar += ''; } if (readable) { - usernameAndAvatar += ``; + usernameAndAvatar += ''; } - usernameAndAvatar += `: `; + usernameAndAvatar += ': '; description += usernameAndAvatar + status.parent_status.text; if (showRetweetTextInTitle) { title += status.parent_status.author.name + ': ' + status.parent_status.text; @@ -376,8 +376,8 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) { if (status.card) { if (description) { description += readable - ? `
` - : `
`; + ? '
' + : '
'; } if (!status.card.images_block && status.card.image) { description += ``; @@ -408,7 +408,7 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) { } description += cardContents.join('
'); if (readable) { - description += `
`; + description += '
'; } if (status.card.images_block) { const imageUrls: Array = []; @@ -421,7 +421,7 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) { // video_card if (status.video_card) { - description += readable ? `
` : `
`; + description += readable ? '
' : '
'; const videoCover = status.video_card.video_info && status.video_card.video_info.cover_url; const videoSrc = status.video_card.video_info && status.video_card.video_info.video_url; @@ -431,13 +431,13 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) { description += `${videoSrc ? `` : ''}
${status.video_card.title ? `${status.video_card.title}` : ''}`; if (readable) { - description += `
`; + description += '
'; } } // reshared_status if (status.reshared_status) { - description += readable ? `
` : `
`; + description += readable ? '
' : '
'; if (showRetweetTextInTitle) { title += ' | '; diff --git a/lib/routes/dw/news.ts b/lib/routes/dw/news.ts index 5777d82d2..bccb38925 100644 --- a/lib/routes/dw/news.ts +++ b/lib/routes/dw/news.ts @@ -38,7 +38,7 @@ For the site https://www.dw.com/de/deutschland/s-12321 the language code would b ], }; -const defaultUrl = `https://www.dw.com/graph-api/en/content/navigation/9097`; +const defaultUrl = 'https://www.dw.com/graph-api/en/content/navigation/9097'; const typenames = new Set(['Article', 'Liveblog', 'Video']); async function handler(ctx) { diff --git a/lib/routes/earthquake/index.ts b/lib/routes/earthquake/index.ts index b9e116de8..3dfc0b7df 100644 --- a/lib/routes/earthquake/index.ts +++ b/lib/routes/earthquake/index.ts @@ -26,7 +26,7 @@ export const route: Route = { maintainers: ['LogicJake'], handler, url: 'www.cea.gov.cn/cea/xwzx/zqsd/index.html', - description: `可通过全局过滤参数订阅您感兴趣的地区.`, + description: '可通过全局过滤参数订阅您感兴趣的地区.', }; async function handler(ctx) { diff --git a/lib/routes/eastday/sh.ts b/lib/routes/eastday/sh.ts index 8fdae1aaa..7c875f2dd 100644 --- a/lib/routes/eastday/sh.ts +++ b/lib/routes/eastday/sh.ts @@ -36,7 +36,7 @@ async function handler() { const response = await got({ method: 'get', - url: `https://apin.eastday.com/apiplus/special/specialnewslistbyurl?specialUrl=1632798465040016&skipCount=0&limitCount=20`, + url: 'https://apin.eastday.com/apiplus/special/specialnewslistbyurl?specialUrl=1632798465040016&skipCount=0&limitCount=20', }); const result = await Promise.all( @@ -69,7 +69,7 @@ async function handler() { ); return { - title: `东方网-上海`, + title: '东方网-上海', link: `${domain}/wap/sh.html`, item: result, }; diff --git a/lib/routes/eastmoney/search/index.ts b/lib/routes/eastmoney/search/index.ts index ba2ee9692..7a64cc952 100644 --- a/lib/routes/eastmoney/search/index.ts +++ b/lib/routes/eastmoney/search/index.ts @@ -46,7 +46,7 @@ async function handler(ctx) { }; const cb = `jQuery${('3.5.1' + Math.random()).replaceAll(/\D/g, '')}_${Date.now()}`; - const url = `https://search-api-web.eastmoney.com/search/jsonp`; + const url = 'https://search-api-web.eastmoney.com/search/jsonp'; const response = await got(url, { searchParams: { diff --git a/lib/routes/eleduck/posts.ts b/lib/routes/eleduck/posts.ts index 2f992e8bc..2585f83e9 100644 --- a/lib/routes/eleduck/posts.ts +++ b/lib/routes/eleduck/posts.ts @@ -5,7 +5,7 @@ import got from '@/utils/got'; const getCateName = async (cid = 0) => { const key = 'eleduck-categories'; const cates = await cache.tryGet(key, async () => { - const res = await got(`https://svc.eleduck.com/api/v1/categories`); + const res = await got('https://svc.eleduck.com/api/v1/categories'); const map = {}; for (const item of res.data.categories) { map[item.id] = item.name; diff --git a/lib/routes/europechinese/latest.ts b/lib/routes/europechinese/latest.ts index 4ac16222a..5fa748a4c 100644 --- a/lib/routes/europechinese/latest.ts +++ b/lib/routes/europechinese/latest.ts @@ -29,7 +29,7 @@ export const route: Route = { }; async function handler() { - const url = `https://europechinese.blogspot.com/`; + const url = 'https://europechinese.blogspot.com/'; const { data: response } = await got(url); const $ = load(response); const list = $('h3.post-title'); @@ -60,7 +60,7 @@ async function handler() { ); return { - title: `歐洲動態(國際)| 最新`, + title: '歐洲動態(國際)| 最新', link: url, item: out, }; diff --git a/lib/routes/fanbox/utils.tsx b/lib/routes/fanbox/utils.tsx index 09478a3be..f0d6d6713 100644 --- a/lib/routes/fanbox/utils.tsx +++ b/lib/routes/fanbox/utils.tsx @@ -42,8 +42,8 @@ function passageConv(p) { p.styles.map((s) => { switch (s.type) { case 'bold': - seg[s.offset] = `` + seg[s.offset]; - seg[s.offset + s.length - 1] += ``; + seg[s.offset] = '' + seg[s.offset]; + seg[s.offset + s.length - 1] += ''; break; default: } @@ -53,7 +53,7 @@ function passageConv(p) { if (p.links) { p.links.map((l) => { seg[l.offset] = `` + seg[l.offset]; - seg[l.offset + l.length - 1] += ``; + seg[l.offset + l.length - 1] += ''; return l; }); } @@ -171,7 +171,7 @@ export function parseItem(item: PostItem) { return cache.tryGet(`fanbox-${item.id}-${item.updatedDatetime}`, async () => { const postDetail = (await ofetch(`https://api.fanbox.cc/post.info?postId=${item.id}`, { headers: { ...getHeaders(), 'User-Agent': config.trueUA } })) as PostDetailResponse; return { - title: item.title || `No title`, + title: item.title || 'No title', description: await parseDetail(postDetail.body), pubDate: parseDate(item.updatedDatetime), link: `https://${item.creatorId}.fanbox.cc/posts/${item.id}`, diff --git a/lib/routes/fffdm/manhua/manhua.tsx b/lib/routes/fffdm/manhua/manhua.tsx index f4a2ca88e..b346dc2c4 100644 --- a/lib/routes/fffdm/manhua/manhua.tsx +++ b/lib/routes/fffdm/manhua/manhua.tsx @@ -47,7 +47,7 @@ async function handler(ctx) { const id = ctx.req.param('id'); const count = ctx.req.query('limit') || 99999; const cdnNum = ctx.req.param('cdn') || 5; - const cdn = !Number.isNaN(Number.parseInt(cdnNum)) && 1 <= Number.parseInt(cdnNum) && Number.parseInt(cdnNum) <= 5 ? `https://p${cdnNum}.fzacg.com` : `https://p5.fzacg.com`; + const cdn = !Number.isNaN(Number.parseInt(cdnNum)) && 1 <= Number.parseInt(cdnNum) && Number.parseInt(cdnNum) <= 5 ? `https://p${cdnNum}.fzacg.com` : 'https://p5.fzacg.com'; // 获取漫画清单 const response = await got(`${host}/api/manhua/${id}`); diff --git a/lib/routes/finology/category.ts b/lib/routes/finology/category.ts index 2e50180fb..b606b71ee 100644 --- a/lib/routes/finology/category.ts +++ b/lib/routes/finology/category.ts @@ -44,7 +44,7 @@ async function handler(ctx: Context) { const extra = { description: (topic: string) => `Articles for your research and knowledge under ${topic}`, date: true, - selector: `div.card`, + selector: 'div.card', }; return await commonHandler('https://insider.finology.in', `/${category}`, extra); } diff --git a/lib/routes/finology/most-viewed.ts b/lib/routes/finology/most-viewed.ts index f89b9b4d4..db90aada6 100644 --- a/lib/routes/finology/most-viewed.ts +++ b/lib/routes/finology/most-viewed.ts @@ -22,7 +22,7 @@ async function handler() { const extra = { description: (topic: string) => `Check out the most talked-about articles among our readers! ${topic}`, date: false, - selector: `div.card`, + selector: 'div.card', }; return await commonHandler('https://insider.finology.in', '/most-viewed', extra); } diff --git a/lib/routes/finology/tag.ts b/lib/routes/finology/tag.ts index 418cb3994..1d57675f6 100644 --- a/lib/routes/finology/tag.ts +++ b/lib/routes/finology/tag.ts @@ -57,7 +57,7 @@ async function handler(ctx: Context) { const extra = { description: (topic: string) => `Everything that Insider has to offer about ${topic} for you to read and learn.`, date: true, - selector: `div.card`, + selector: 'div.card', }; return await commonHandler('https://insider.finology.in', `/tag/${topic}`, extra); } diff --git a/lib/routes/foresightnews/index.ts b/lib/routes/foresightnews/index.ts index 3c9cbad9b..d298f0c78 100644 --- a/lib/routes/foresightnews/index.ts +++ b/lib/routes/foresightnews/index.ts @@ -21,7 +21,7 @@ export const route: Route = { async function handler(ctx) { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; - const apiUrl = new URL(`v2/feed`, apiRootUrl).href; + const apiUrl = new URL('v2/feed', apiRootUrl).href; const { items } = await processItems(apiUrl, limit); diff --git a/lib/routes/ft/myft.ts b/lib/routes/ft/myft.ts index 236b2b8f5..112f8a506 100644 --- a/lib/routes/ft/myft.ts +++ b/lib/routes/ft/myft.ts @@ -69,9 +69,9 @@ async function handler(ctx) { ); return { - title: `FT.com - myFT`, + title: 'FT.com - myFT', link, - description: `FT.com - myFT`, + description: 'FT.com - myFT', item: items, }; } diff --git a/lib/routes/fuliba/latest.ts b/lib/routes/fuliba/latest.ts index de117786a..77207a7f3 100644 --- a/lib/routes/fuliba/latest.ts +++ b/lib/routes/fuliba/latest.ts @@ -27,7 +27,7 @@ export const route: Route = { }; async function handler(ctx) { - const { data: response } = await got(`https://fuliba2023.net/wp-json/wp/v2/posts`, { + const { data: response } = await got('https://fuliba2023.net/wp-json/wp/v2/posts', { searchParams: { per_page: ctx.req.query('limit') ?? 100, _embed: 1, @@ -44,7 +44,7 @@ async function handler(ctx) { return { title: '福利吧', - link: `https://fuliba2023.net`, + link: 'https://fuliba2023.net', item: items, }; } diff --git a/lib/routes/furaffinity/browse.ts b/lib/routes/furaffinity/browse.ts index 8ab993012..d43f31123 100644 --- a/lib/routes/furaffinity/browse.ts +++ b/lib/routes/furaffinity/browse.ts @@ -53,7 +53,7 @@ async function handler(ctx) { return { title: 'Fur Affinity | Browse', link: 'https://www.furaffinity.net/browse/', - description: `Fur Affinity Browsing Artwork`, + description: 'Fur Affinity Browsing Artwork', item: items, }; } diff --git a/lib/routes/furaffinity/home.ts b/lib/routes/furaffinity/home.ts index 63cc0fab7..b67c4fb53 100644 --- a/lib/routes/furaffinity/home.ts +++ b/lib/routes/furaffinity/home.ts @@ -75,7 +75,7 @@ async function handler(ctx) { return { title: 'Fur Affinity | Home', link: 'https://www.furaffinity.net/', - description: `Fur Affinity Index`, + description: 'Fur Affinity Index', item: items, }; } diff --git a/lib/routes/furaffinity/search.ts b/lib/routes/furaffinity/search.ts index 2fabc24d9..ada8622d0 100644 --- a/lib/routes/furaffinity/search.ts +++ b/lib/routes/furaffinity/search.ts @@ -67,7 +67,7 @@ async function handler(ctx) { allowEmpty: true, title: 'Fur Affinity | Search', link: `https://www.furaffinity.net/Search/?q=${query}`, - description: `Fur Affinity Search`, + description: 'Fur Affinity Search', item: items, }; } diff --git a/lib/routes/furaffinity/status.ts b/lib/routes/furaffinity/status.ts index ac5deb083..c37a4796b 100644 --- a/lib/routes/furaffinity/status.ts +++ b/lib/routes/furaffinity/status.ts @@ -53,7 +53,7 @@ async function handler() { return { title: 'Fur Affinity | Status', link: 'https://www.furaffinity.net/', - description: `Fur Affinity Status`, + description: 'Fur Affinity Status', item: items, }; } diff --git a/lib/routes/furaffinity/user.ts b/lib/routes/furaffinity/user.ts index 60c7ce544..eca11bec8 100644 --- a/lib/routes/furaffinity/user.ts +++ b/lib/routes/furaffinity/user.ts @@ -91,7 +91,7 @@ async function handler(ctx) { throw new Error(`Unknown type: ${x}`); } } - contact_result += `
`; + contact_result += '
'; } } diff --git a/lib/routes/gcores/articles.ts b/lib/routes/gcores/articles.ts index 8322f4ea1..88bcfa0dc 100644 --- a/lib/routes/gcores/articles.ts +++ b/lib/routes/gcores/articles.ts @@ -9,7 +9,7 @@ export const handler = async (ctx: Context): Promise => { const limit: number = Number.parseInt(ctx.req.query('limit') ?? '30', 10); const targetUrl: string = new URL('articles', baseUrl).href; - const apiUrl: string = new URL(`gapi/v1/articles`, baseUrl).href; + const apiUrl: string = new URL('gapi/v1/articles', baseUrl).href; const query = { 'page[limit]': limit, diff --git a/lib/routes/gdut/oa-news.ts b/lib/routes/gdut/oa-news.ts index f05d7fbe3..cef57d33d 100644 --- a/lib/routes/gdut/oa-news.ts +++ b/lib/routes/gdut/oa-news.ts @@ -209,9 +209,9 @@ async function handler(ctx) { ); return { - title: `广东工业大学通知公文网 - ` + type.name, + title: '广东工业大学通知公文网 - ' + type.name, link: site, - description: `广东工业大学通知公文网`, + description: '广东工业大学通知公文网', item: results, }; } diff --git a/lib/routes/gelonghui/hot-article.ts b/lib/routes/gelonghui/hot-article.ts index 099491b2e..752c8c655 100644 --- a/lib/routes/gelonghui/hot-article.ts +++ b/lib/routes/gelonghui/hot-article.ts @@ -43,7 +43,7 @@ export const route: Route = { async function handler(ctx) { const type = ctx.req.param('type') === 'week' ? 1 : 0; - const baseUrl = `https://www.gelonghui.com`; + const baseUrl = 'https://www.gelonghui.com'; const { data: response } = await got(baseUrl); const $ = load(response); diff --git a/lib/routes/gelonghui/keyword.ts b/lib/routes/gelonghui/keyword.ts index ad1070cc5..90a4f6b89 100644 --- a/lib/routes/gelonghui/keyword.ts +++ b/lib/routes/gelonghui/keyword.ts @@ -27,7 +27,7 @@ export const route: Route = { async function handler(ctx) { const keyword = ctx.req.param('keyword'); - const currentUrl = `https://www.gelonghui.com/api/post/search/v4`; + const currentUrl = 'https://www.gelonghui.com/api/post/search/v4'; const { data } = await got(currentUrl, { searchParams: { keyword, diff --git a/lib/routes/gesiba/index.ts b/lib/routes/gesiba/index.ts index 164cc5a73..a30b3b25b 100644 --- a/lib/routes/gesiba/index.ts +++ b/lib/routes/gesiba/index.ts @@ -9,7 +9,7 @@ const FEED_LANGUAGE = 'de' as const; const FEED_LOGO = 'https://www.gesiba.at/assets/img/gesiba-logo.png'; const BASE_URL = 'https://www.gesiba.at' as const; const MAGIC_QUERY_PARAMS = - `p=actions/sprig-core/components/render&sprig%3AsiteId=0347ff5aeebc536543e7e865c4ed9dd97a9eb81ef054d47105ba6c4ca1da10801&sprig%3Aid=37ff8c3b5f5f7ad3bca87140e3fb8094cc656fcdc5d705c964065a830717c906component-vvyfgj&sprig%3Acomponent=e0737af02d4f2e1586c10610b098b6f75b51b994ddbd89cafd13ef07dc6da9ca&sprig%3Atemplate=3b669582a22c2742c4b713143ea4663ddba00812852f876074de96ad2fc04c24_components%2F_objectList&sprig%3Avariables%5BbaseUrl%5D=0c66aec55b6b038f0c9eb2ddea75d44d0c52b6fbc93960847d53f9d0af3f6162%2Fimmobilien%2Fwohnungen` as const; + 'p=actions/sprig-core/components/render&sprig%3AsiteId=0347ff5aeebc536543e7e865c4ed9dd97a9eb81ef054d47105ba6c4ca1da10801&sprig%3Aid=37ff8c3b5f5f7ad3bca87140e3fb8094cc656fcdc5d705c964065a830717c906component-vvyfgj&sprig%3Acomponent=e0737af02d4f2e1586c10610b098b6f75b51b994ddbd89cafd13ef07dc6da9ca&sprig%3Atemplate=3b669582a22c2742c4b713143ea4663ddba00812852f876074de96ad2fc04c24_components%2F_objectList&sprig%3Avariables%5BbaseUrl%5D=0c66aec55b6b038f0c9eb2ddea75d44d0c52b6fbc93960847d53f9d0af3f6162%2Fimmobilien%2Fwohnungen' as const; // https://www.gesiba.at/index.php?p=actions/sprig-core/components/render&verfuegbar=alle&size-from=&size-to=&rooms-from=&rooms-to=&betreuung=&sprig%3AsiteId=0347ff5aeebc536543e7e865c4ed9dd97a9eb81ef054d47105ba6c4ca1da10801&sprig%3Aid=37ff8c3b5f5f7ad3bca87140e3fb8094cc656fcdc5d705c964065a830717c906component-vvyfgj&sprig%3Acomponent=e0737af02d4f2e1586c10610b098b6f75b51b994ddbd89cafd13ef07dc6da9ca&sprig%3Atemplate=3b669582a22c2742c4b713143ea4663ddba00812852f876074de96ad2fc04c24_components%2F_objectList&sprig%3Avariables%5BbaseUrl%5D=0c66aec55b6b038f0c9eb2ddea75d44d0c52b6fbc93960847d53f9d0af3f6162%2Fimmobilien%2Fwohnungen diff --git a/lib/routes/github/activity.ts b/lib/routes/github/activity.ts index 935f7c249..abb4ed5e9 100644 --- a/lib/routes/github/activity.ts +++ b/lib/routes/github/activity.ts @@ -47,7 +47,7 @@ export const route: Route = { item: feed.items.map((item) => ({ title: item.title ?? '', link: item.link, - description: sanitizeHtml(item.content?.replaceAll(/href="\/(.+?)"/g, `href="https://github.com/$1"`) ?? '', { allowedTags: [...sanitizeHtml.defaults.allowedTags, 'img'] }), + description: sanitizeHtml(item.content?.replaceAll(/href="\/(.+?)"/g, 'href="https://github.com/$1"') ?? '', { allowedTags: [...sanitizeHtml.defaults.allowedTags, 'img'] }), pubDate: item.pubDate ? parseDate(item.pubDate) : undefined, author: item.author, guid: item.id, diff --git a/lib/routes/github/advisor.ts b/lib/routes/github/advisor.ts index 61446b743..ce68836da 100644 --- a/lib/routes/github/advisor.ts +++ b/lib/routes/github/advisor.ts @@ -53,7 +53,7 @@ async function handler(ctx) { const apiRootUrl = 'https://github.com/advisories'; const apiUrl = `${apiRootUrl}?query=type%3A${type}+ecosystem%3A${category}`; - const currentUrl = `https://github.com/advisories`; + const currentUrl = 'https://github.com/advisories'; const response = await got({ method: 'get', diff --git a/lib/routes/github/eventapi.ts b/lib/routes/github/eventapi.ts index 4caaafdbc..50290c0d8 100644 --- a/lib/routes/github/eventapi.ts +++ b/lib/routes/github/eventapi.ts @@ -48,7 +48,7 @@ function formatEventItem(event: any) { description = `PR: ${link}`; } else { link = `https://github.com/${repo.name}`; - description = `PR: Unknown`; + description = 'PR: Unknown'; } break; case 'PullRequestReviewCommentEvent': @@ -117,7 +117,7 @@ function formatEventItem(event: any) { for (const page of payload.pages ?? []) { description += `
  • Page ${page.page_name} ${page.action} ${page.summary ? `: ${page.summary}` : ''}
  • `; } - description += ``; + description += ''; link = `https://github.com/${repo.name}`; break; case 'DiscussionEvent': diff --git a/lib/routes/gocn/jobs.ts b/lib/routes/gocn/jobs.ts index 46a4cc556..1e2bb99f0 100644 --- a/lib/routes/gocn/jobs.ts +++ b/lib/routes/gocn/jobs.ts @@ -46,9 +46,9 @@ async function handler() { })); return { - title: `GoCN社区-招聘`, + title: 'GoCN社区-招聘', link: base_url, - description: `获取GoCN站点招聘`, + description: '获取GoCN站点招聘', item: items, }; } diff --git a/lib/routes/gocn/news.ts b/lib/routes/gocn/news.ts index c84538bd3..48cc00fe4 100644 --- a/lib/routes/gocn/news.ts +++ b/lib/routes/gocn/news.ts @@ -33,9 +33,9 @@ async function handler() { })); return { - title: `GoCN社区-最新动态`, + title: 'GoCN社区-最新动态', link: base_url, - description: `获取GoCN站点最新动态`, + description: '获取GoCN站点最新动态', item: items, }; } diff --git a/lib/routes/gocn/topics.ts b/lib/routes/gocn/topics.ts index 5226d1704..2cc931f9a 100644 --- a/lib/routes/gocn/topics.ts +++ b/lib/routes/gocn/topics.ts @@ -49,9 +49,9 @@ async function handler() { })); return { - title: `GoCN社区-每日新闻`, + title: 'GoCN社区-每日新闻', link: base_url, - description: `获取GoCN站点每日新闻`, + description: '获取GoCN站点每日新闻', item: items, }; } diff --git a/lib/routes/google/citations.ts b/lib/routes/google/citations.ts index f70bbe226..bee00e27c 100644 --- a/lib/routes/google/citations.ts +++ b/lib/routes/google/citations.ts @@ -26,7 +26,7 @@ export const route: Route = { async function handler(ctx) { const id = ctx.req.param('id'); - const BASE_URL = `https://scholar.google.com`; + const BASE_URL = 'https://scholar.google.com'; const url = `https://scholar.google.com/citations?user=${id}`; const response = await got({ diff --git a/lib/routes/gov/chinatax/latest.ts b/lib/routes/gov/chinatax/latest.ts index a3dabc627..57c4ae2ca 100644 --- a/lib/routes/gov/chinatax/latest.ts +++ b/lib/routes/gov/chinatax/latest.ts @@ -29,7 +29,7 @@ export const route: Route = { }; async function handler() { - const link = `http://www.chinatax.gov.cn/chinatax/n810341/n810755/index.html`; + const link = 'http://www.chinatax.gov.cn/chinatax/n810341/n810755/index.html'; const response = await got({ method: 'get', @@ -44,7 +44,7 @@ async function handler() { const a = item.find('a'); return { title: a.text(), - link: new URL(a.attr('href'), `http://www.chinatax.gov.cn`).toString(), + link: new URL(a.attr('href'), 'http://www.chinatax.gov.cn').toString(), }; }); const items = await Promise.all( diff --git a/lib/routes/gov/guangdong/tqyb/sncsyjxh.tsx b/lib/routes/gov/guangdong/tqyb/sncsyjxh.tsx index 7fe0291a8..8399a86e3 100644 --- a/lib/routes/gov/guangdong/tqyb/sncsyjxh.tsx +++ b/lib/routes/gov/guangdong/tqyb/sncsyjxh.tsx @@ -46,7 +46,7 @@ async function handler() { const items = data.map((item) => ({ title: item.cname + ' ' + item.sigtypename, - link: `http://www.tqyb.com.cn/gz/weatherAlarm/otherCity/`, + link: 'http://www.tqyb.com.cn/gz/weatherAlarm/otherCity/', description: renderToString( <> 地区: {item.cname} @@ -62,7 +62,7 @@ async function handler() { return { title: '广东省内城市预警信号', - link: `http://www.tqyb.com.cn/gz/weatherAlarm/otherCity/`, + link: 'http://www.tqyb.com.cn/gz/weatherAlarm/otherCity/', item: items, }; } diff --git a/lib/routes/gov/huizhou/zwgk/index.ts b/lib/routes/gov/huizhou/zwgk/index.ts index b9aaebb0a..0a4aa08f3 100644 --- a/lib/routes/gov/huizhou/zwgk/index.ts +++ b/lib/routes/gov/huizhou/zwgk/index.ts @@ -24,7 +24,7 @@ export const route: Route = { name: '惠州市人民政府', maintainers: ['Fatpandac'], handler, - description: `#### 政务公开 {#guang-dong-sheng-ren-min-zheng-fu-hui-zhou-shi-ren-min-zheng-fu-zheng-wu-gong-kai}`, + description: '#### 政务公开 {#guang-dong-sheng-ren-min-zheng-fu-hui-zhou-shi-ren-min-zheng-fu-zheng-wu-gong-kai}', }; async function handler(ctx) { diff --git a/lib/routes/gov/miit/yjzj.ts b/lib/routes/gov/miit/yjzj.ts index b45b3dcd6..2b9deec1d 100644 --- a/lib/routes/gov/miit/yjzj.ts +++ b/lib/routes/gov/miit/yjzj.ts @@ -79,7 +79,7 @@ async function handler() { ); return { - title: `工业和信息化部 - 意见征集`, + title: '工业和信息化部 - 意见征集', link: url, item: items, }; diff --git a/lib/routes/gov/moa/moa.ts b/lib/routes/gov/moa/moa.ts index cf86e6fcf..baada5949 100644 --- a/lib/routes/gov/moa/moa.ts +++ b/lib/routes/gov/moa/moa.ts @@ -222,7 +222,7 @@ async function dealLatestDataChannel() { }) ); return { - title: `中华人民共和国农业农村部 - 数据 - 最新发布`, + title: '中华人民共和国农业农村部 - 数据 - 最新发布', link: 'http://zdscxx.moa.gov.cn:8080/nyb/pc/messageList.jsp', item: items, }; diff --git a/lib/routes/gov/moa/szcpxx.ts b/lib/routes/gov/moa/szcpxx.ts index ea83941fe..5a13c92d0 100644 --- a/lib/routes/gov/moa/szcpxx.ts +++ b/lib/routes/gov/moa/szcpxx.ts @@ -10,7 +10,7 @@ export const handler = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 6; const rootUrl = 'http://www.moa.gov.cn'; - const currentUrl = new URL(`ztzl/szcpxx/zyzc/index.htm`, rootUrl).href; + const currentUrl = new URL('ztzl/szcpxx/zyzc/index.htm', rootUrl).href; const { data: response } = await got(currentUrl); diff --git a/lib/routes/gov/sh/rsj/ksxm.tsx b/lib/routes/gov/sh/rsj/ksxm.tsx index cef610fa7..fa0e7f78d 100644 --- a/lib/routes/gov/sh/rsj/ksxm.tsx +++ b/lib/routes/gov/sh/rsj/ksxm.tsx @@ -59,7 +59,7 @@ async function handler() { .toArray() .map((item) => ({ title: $(item).find('kaosxmmc').text(), - link: `http://www.rsj.sh.gov.cn/ksyzc/index801.jsp`, + link: 'http://www.rsj.sh.gov.cn/ksyzc/index801.jsp', description: renderDescription({ name: $(item).find('kaosxmmc').text(), type: $(item).find('kaoslb_dmfy').text(), diff --git a/lib/routes/gov/sh/wsjkw/yqtb/index.ts b/lib/routes/gov/sh/wsjkw/yqtb/index.ts index 003cb60a1..4d11457e0 100644 --- a/lib/routes/gov/sh/wsjkw/yqtb/index.ts +++ b/lib/routes/gov/sh/wsjkw/yqtb/index.ts @@ -29,7 +29,7 @@ export const route: Route = { }; async function handler() { - const url = `https://wsjkw.sh.gov.cn/yqtb/index.html`; + const url = 'https://wsjkw.sh.gov.cn/yqtb/index.html'; const res = await got.get(url); const $ = load(res.data); @@ -41,7 +41,7 @@ async function handler() { item = $(item); const title = item.find('a').text(); const address = item.find('a').attr('href'); - const host = `https://wsjkw.sh.gov.cn`; + const host = 'https://wsjkw.sh.gov.cn'; const pubDate = parseDate(item.find('span').text(), 'YYYY-MM-DD'); return { title, diff --git a/lib/routes/gov/zhengce/govall.ts b/lib/routes/gov/zhengce/govall.ts index 3afc233d7..a1f13b5aa 100644 --- a/lib/routes/gov/zhengce/govall.ts +++ b/lib/routes/gov/zhengce/govall.ts @@ -43,7 +43,7 @@ export const route: Route = { async function handler(ctx) { const advance = ctx.req.param('advance'); - const link = `http://sousuo.gov.cn/list.htm`; + const link = 'http://sousuo.gov.cn/list.htm'; const params = new URLSearchParams({ n: 20, t: 'govall', diff --git a/lib/routes/gov/zhengce/zhengceku.ts b/lib/routes/gov/zhengce/zhengceku.ts index 21149cbd4..99536e601 100644 --- a/lib/routes/gov/zhengce/zhengceku.ts +++ b/lib/routes/gov/zhengce/zhengceku.ts @@ -26,7 +26,7 @@ async function handler(ctx) { return await buildData({ link, url: link, - title: `%title%`, + title: '%title%', description: '政府文件库, 当页的所有列表', params: { title: `$('.channel_tab > .noline > a').text().trim() + ' - 政府文件库'`, diff --git a/lib/routes/grubstreet/index.ts b/lib/routes/grubstreet/index.ts index 18709bb0a..890d4865a 100644 --- a/lib/routes/grubstreet/index.ts +++ b/lib/routes/grubstreet/index.ts @@ -17,8 +17,8 @@ export const route: Route = { }; async function handler(ctx) { - const url = `https://www.grubstreet.com/_components/newsfeed/instances/grubstreet-index@published`; - const title = `Grub Street`; + const url = 'https://www.grubstreet.com/_components/newsfeed/instances/grubstreet-index@published'; + const title = 'Grub Street'; const description = `New York Magazine's Food and Restaurant Blog`; return await utils.getData(ctx, url, title, description); diff --git a/lib/routes/guangdiu/cheaps.ts b/lib/routes/guangdiu/cheaps.ts index e744269de..cecda6dfd 100644 --- a/lib/routes/guangdiu/cheaps.ts +++ b/lib/routes/guangdiu/cheaps.ts @@ -41,7 +41,7 @@ async function handler(ctx) { })); return { - title: `逛丢 - 九块九`, + title: '逛丢 - 九块九', link: url, item: items, }; diff --git a/lib/routes/guangdiu/rank.ts b/lib/routes/guangdiu/rank.ts index 9c880bd42..15259d971 100644 --- a/lib/routes/guangdiu/rank.ts +++ b/lib/routes/guangdiu/rank.ts @@ -58,7 +58,7 @@ async function handler() { ); return { - title: `逛丢 - 一小时风云榜`, + title: '逛丢 - 一小时风云榜', link: url, item: items, }; diff --git a/lib/routes/guduodata/daily.tsx b/lib/routes/guduodata/daily.tsx index dfa3574bb..f926dbb6b 100644 --- a/lib/routes/guduodata/daily.tsx +++ b/lib/routes/guduodata/daily.tsx @@ -66,14 +66,14 @@ async function handler() { })) ); return { - title: `骨朵数据 - 日榜`, + title: '骨朵数据 - 日榜', link: host, description: yestoday, item: await Promise.all( items.map((item) => cache.tryGet(item.url, async () => { const response = await got.get(`${item.url}&t=${now}`, { - headers: { Referer: `http://guduodata.com/` }, + headers: { Referer: 'http://guduodata.com/' }, }); const data = response.data.data; return { diff --git a/lib/routes/gumroad/index.tsx b/lib/routes/gumroad/index.tsx index 4fa10c06b..9624df369 100644 --- a/lib/routes/gumroad/index.tsx +++ b/lib/routes/gumroad/index.tsx @@ -23,7 +23,7 @@ export const route: Route = { name: 'Products', maintainers: ['Fatpandac'], handler, - description: `\`https://afkmaster.gumroad.com/l/Eve10\` -> \`/gumroad/afkmaster/Eve10\``, + description: '`https://afkmaster.gumroad.com/l/Eve10` -> `/gumroad/afkmaster/Eve10`', }; const renderDescription = (img, productsName, price, desc, stack) => diff --git a/lib/routes/guokr/channel.ts b/lib/routes/guokr/channel.ts index bac498899..913f572d8 100644 --- a/lib/routes/guokr/channel.ts +++ b/lib/routes/guokr/channel.ts @@ -33,7 +33,7 @@ export const route: Route = { async function handler(ctx) { const channel = channelMap[ctx.req.param('channel')] ?? ctx.req.param('channel'); - const { data: response } = await got(`https://www.guokr.com/apis/minisite/article.json`, { + const { data: response } = await got('https://www.guokr.com/apis/minisite/article.json', { searchParams: { retrieve_type: 'by_wx', channel_key: channel, diff --git a/lib/routes/gxmzu/utils/index.ts b/lib/routes/gxmzu/utils/index.ts index 386c73446..a12ee8949 100644 --- a/lib/routes/gxmzu/utils/index.ts +++ b/lib/routes/gxmzu/utils/index.ts @@ -12,7 +12,7 @@ async function getNoticeList(ctx, url, host, titleSelector, dateSelector, conten } const $ = load(response); - const list = $(`tr[height=20]`) + const list = $('tr[height=20]') .toArray() .map((item) => { item = $(item); diff --git a/lib/routes/hackernews/index.ts b/lib/routes/hackernews/index.ts index cd00a7092..dff606d2c 100644 --- a/lib/routes/hackernews/index.ts +++ b/lib/routes/hackernews/index.ts @@ -38,7 +38,7 @@ export const route: Route = { name: 'User', maintainers: ['nczitzk', 'xie-dongping'], handler, - description: `Subscribe to the content of a specific user`, + description: 'Subscribe to the content of a specific user', }; async function handler(ctx) { diff --git a/lib/routes/hafu/utils.tsx b/lib/routes/hafu/utils.tsx index 224119be4..1c95081a4 100644 --- a/lib/routes/hafu/utils.tsx +++ b/lib/routes/hafu/utils.tsx @@ -57,7 +57,7 @@ async function tryGetFullText(href, link, type) { function tryGetAttachments(articleData, articleBody, type) { if (type === 'ggtz') { - articleData(`[id^=nattach]`) + articleData('[id^=nattach]') .prev() .map((_, item) => { const href = articleData(item).attr('href').slice(1); diff --git a/lib/routes/hameln/chapter.ts b/lib/routes/hameln/chapter.ts index d4ba53583..c6c4cf6f4 100644 --- a/lib/routes/hameln/chapter.ts +++ b/lib/routes/hameln/chapter.ts @@ -27,7 +27,7 @@ export const route: Route = { name: 'chapter', maintainers: ['huangliangshusheng'], handler, - description: `Eg: [https://syosetu.org/novel/264928](https://syosetu.org/novel/264928)`, + description: 'Eg: [https://syosetu.org/novel/264928](https://syosetu.org/novel/264928)', }; async function handler(ctx) { diff --git a/lib/routes/hanime1/search.ts b/lib/routes/hanime1/search.ts index 025354362..c23732d7d 100644 --- a/lib/routes/hanime1/search.ts +++ b/lib/routes/hanime1/search.ts @@ -53,7 +53,7 @@ async function handler(ctx) { const maxTagsToShow = 3; const displayedTags = tags.slice(0, maxTagsToShow).join(', ') + (tags.length > maxTagsToShow ? ', ...' : ''); - const feedTitle = `Hanime1 搜索结果` + (genre ? ` | 类型: ${genre}` : '') + (query ? ` | 关键词: ${query}` : '') + (tags.length ? ` | 标签: ${displayedTags}` : ''); + const feedTitle = 'Hanime1 搜索结果' + (genre ? ` | 类型: ${genre}` : '') + (query ? ` | 关键词: ${query}` : '') + (tags.length ? ` | 标签: ${displayedTags}` : ''); return { title: feedTitle, diff --git a/lib/routes/hellobtc/news.ts b/lib/routes/hellobtc/news.ts index 0cbc7ba3a..c64a81bd0 100644 --- a/lib/routes/hellobtc/news.ts +++ b/lib/routes/hellobtc/news.ts @@ -48,7 +48,7 @@ async function handler() { .filter(Boolean); return { - title: `白话区块链 - 快讯`, + title: '白话区块链 - 快讯', link: url, item: items, }; diff --git a/lib/routes/home-assistant/hacs.ts b/lib/routes/home-assistant/hacs.ts index 42c83bb64..81c5069f9 100644 --- a/lib/routes/home-assistant/hacs.ts +++ b/lib/routes/home-assistant/hacs.ts @@ -36,7 +36,7 @@ async function handler() { return { title: 'HACS Repositories', - link: `https://www.hacs.xyz/`, + link: 'https://www.hacs.xyz/', item: dataList.map((item) => ({ title: item.manifest_name || item.manifest?.name || item.full_name, description: `${item.domain ? `` : ''}
    ${item.description}

    Last updated: ${item.last_updated}
    Stars: ${item.stargazers_count}
    Topics: ${item.topics?.join(', ')}`, diff --git a/lib/routes/hotukdeals/hottest.ts b/lib/routes/hotukdeals/hottest.ts index 9a9c581a0..805f22a37 100644 --- a/lib/routes/hotukdeals/hottest.ts +++ b/lib/routes/hotukdeals/hottest.ts @@ -28,9 +28,9 @@ export const route: Route = { }; async function handler() { - const data = await got.get(`https://www.hotukdeals.com/`, { + const data = await got.get('https://www.hotukdeals.com/', { headers: { - Referer: `https://www.hotukdeals.com/`, + Referer: 'https://www.hotukdeals.com/', }, }); @@ -40,8 +40,8 @@ async function handler() { const threads = dom.window.__INITIAL_STATE__.widgets.hottestWidget.threads; return { - title: `hotukdeals hottest`, - link: `https://www.hotukdeals.com/`, + title: 'hotukdeals hottest', + link: 'https://www.hotukdeals.com/', item: threads.map((item) => ({ title: item.title, description: `
    ${item.temperature}° ${item.title}
    ${item.displayPrice}`, diff --git a/lib/routes/hpoi/banner-item.ts b/lib/routes/hpoi/banner-item.ts index a91789361..5a6c1e10c 100644 --- a/lib/routes/hpoi/banner-item.ts +++ b/lib/routes/hpoi/banner-item.ts @@ -62,7 +62,7 @@ async function handler() { ); return { - title: `Hpoi 手办维基 - 热门推荐`, + title: 'Hpoi 手办维基 - 热门推荐', link, item: items.filter((item) => !!item), }; diff --git a/lib/routes/huitun/xiaohongshu.ts b/lib/routes/huitun/xiaohongshu.ts index f16ed870c..a142b52de 100644 --- a/lib/routes/huitun/xiaohongshu.ts +++ b/lib/routes/huitun/xiaohongshu.ts @@ -22,7 +22,7 @@ export const route: Route = { supportPodcast: false, supportScihub: false, }, - description: `免费版账户每天查询次数为10次, 若需增加查询次数请购买灰豚数据红薯版会员`, + description: '免费版账户每天查询次数为10次, 若需增加查询次数请购买灰豚数据红薯版会员', name: '小红书笔记', maintainers: ['Skylwn'], handler, diff --git a/lib/routes/hupu/bbs.tsx b/lib/routes/hupu/bbs.tsx index 010657c40..3471deba8 100644 --- a/lib/routes/hupu/bbs.tsx +++ b/lib/routes/hupu/bbs.tsx @@ -40,7 +40,7 @@ async function handler(ctx) { const rootUrl = 'https://bbs.hupu.com'; const apiRootUrl = 'https://games.mobileapi.hupu.com'; - const currentUrl = `${rootUrl}/${id}${order === '1' ? `-postdate` : ''}`; + const currentUrl = `${rootUrl}/${id}${order === '1' ? '-postdate' : ''}`; const response = await got({ method: 'get', diff --git a/lib/routes/hupu/utils.ts b/lib/routes/hupu/utils.ts index dadc17d83..726b0cfe5 100644 --- a/lib/routes/hupu/utils.ts +++ b/lib/routes/hupu/utils.ts @@ -149,7 +149,8 @@ function generateTeamPlayerTable(team: TeamPlayerStats): string { const playerDataRows = allPlayers.map((player) => generatePlayerDataRow(player)).join(''); const teamColor = hexToRgb(team.teamColor); - const headerRow = `
    时间
    得分
    篮板
    助攻
    抢断
    盖帽
    投篮
    投篮%
    三分
    三分%
    罚球
    罚球%
    失误
    前板
    后板
    被盖
    犯规
    被犯
    +/-
    `; + const headerRow = + '
    时间
    得分
    篮板
    助攻
    抢断
    盖帽
    投篮
    投篮%
    三分
    三分%
    罚球
    罚球%
    失误
    前板
    后板
    被盖
    犯规
    被犯
    +/-
    '; return `
    ${playerNameRows}
    ${team.teamName}
    ${headerRow}${playerDataRows}
    ${team.dnpPlayerList.length > 0 ? `
    未出场队员:${team.dnpPlayerList.join('、')}
    ` : ''}`; } diff --git a/lib/routes/huxiu/channel.ts b/lib/routes/huxiu/channel.ts index ab7088076..b23f0dd8e 100644 --- a/lib/routes/huxiu/channel.ts +++ b/lib/routes/huxiu/channel.ts @@ -43,7 +43,7 @@ async function handler(ctx) { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20; - const apiUrl = new URL(`web/channel/articleListV1`, apiArticleRootUrl).href; + const apiUrl = new URL('web/channel/articleListV1', apiArticleRootUrl).href; const currentUrl = new URL(id ? `channel/${id}.html` : 'article', rootUrl).href; const { data: response } = await got.post(apiUrl, { diff --git a/lib/routes/huxiu/collection.ts b/lib/routes/huxiu/collection.ts index 782727b4b..695936e88 100644 --- a/lib/routes/huxiu/collection.ts +++ b/lib/routes/huxiu/collection.ts @@ -20,7 +20,7 @@ export const route: Route = { name: '文集', maintainers: ['AlexdanerZe', 'nczitzk'], handler, - description: `更多文集请参见 [文集](https://www.huxiu.com/collection)`, + description: '更多文集请参见 [文集](https://www.huxiu.com/collection)', }; async function handler(ctx) { diff --git a/lib/routes/huxiu/tag.ts b/lib/routes/huxiu/tag.ts index 7c3907901..97f049f1c 100644 --- a/lib/routes/huxiu/tag.ts +++ b/lib/routes/huxiu/tag.ts @@ -20,7 +20,7 @@ export const route: Route = { name: '标签', maintainers: ['xyqfer', 'HenryQW', 'nczitzk', 'TimoYoung'], handler, - description: `更多标签请参见 [标签](https://www.huxiu.com/tags)`, + description: '更多标签请参见 [标签](https://www.huxiu.com/tags)', }; async function handler(ctx) { diff --git a/lib/routes/icac/utils.ts b/lib/routes/icac/utils.ts index 7886692d3..1f7216da8 100644 --- a/lib/routes/icac/utils.ts +++ b/lib/routes/icac/utils.ts @@ -7,7 +7,7 @@ const LANG_TYPE = { }; function langBase(lang) { - return lang ? `${BASE_URL}/${lang}` : `https://www.icac.org.hk/sc`; + return lang ? `${BASE_URL}/${lang}` : 'https://www.icac.org.hk/sc'; } export default { LANG_TYPE, BASE_URL, langBase }; diff --git a/lib/routes/ieee-security/sp.ts b/lib/routes/ieee-security/sp.ts index 1c2cbf523..b4acc1647 100644 --- a/lib/routes/ieee-security/sp.ts +++ b/lib/routes/ieee-security/sp.ts @@ -20,7 +20,7 @@ export const route: Route = { maintainers: ['ZeddYu'], handler, url: 'ieee-security.org/TC/SP-Index.html', - description: `Return results from 2020`, + description: 'Return results from 2020', }; async function handler() { diff --git a/lib/routes/ifanr/category.ts b/lib/routes/ifanr/category.ts index 971baa87c..8efa09a55 100644 --- a/lib/routes/ifanr/category.ts +++ b/lib/routes/ifanr/category.ts @@ -35,7 +35,7 @@ export const route: Route = { name: '分类', maintainers: ['donghongfei'], handler, - description: `支持分类:早报、评测、糖纸众测、产品`, + description: '支持分类:早报、评测、糖纸众测、产品', }; async function handler(ctx) { diff --git a/lib/routes/iiilab/index.ts b/lib/routes/iiilab/index.ts index 174d2dc09..baf94ca65 100644 --- a/lib/routes/iiilab/index.ts +++ b/lib/routes/iiilab/index.ts @@ -22,8 +22,8 @@ async function handler() { return await buildData({ link, url: link, - title: `%title%`, - description: `%description%`, + title: '%title%', + description: '%description%', params: { title: '发现', description: '人人都是自媒体-发现', diff --git a/lib/routes/imhcg/blog.ts b/lib/routes/imhcg/blog.ts index afe682c34..6499951ec 100644 --- a/lib/routes/imhcg/blog.ts +++ b/lib/routes/imhcg/blog.ts @@ -42,7 +42,7 @@ async function handler() { }); return { - title: `Engineering Blogs`, + title: 'Engineering Blogs', link: 'https://infos.imhcg.cn/', item: items, }; diff --git a/lib/routes/imiker/jinghua.ts b/lib/routes/imiker/jinghua.ts index 9ff9586fe..434a3f62e 100644 --- a/lib/routes/imiker/jinghua.ts +++ b/lib/routes/imiker/jinghua.ts @@ -36,7 +36,7 @@ async function handler(ctx) { const rootUrl = 'https://ask.imiker.com'; const apiUrl = new URL('explore/main/list/', rootUrl).href; - const currentUrl = new URL(``, rootUrl).href; + const currentUrl = new URL('', rootUrl).href; const { data: response } = await got(apiUrl, { searchParams: { diff --git a/lib/routes/infoq/utils.ts b/lib/routes/infoq/utils.ts index c862eb48f..4a05b1413 100644 --- a/lib/routes/infoq/utils.ts +++ b/lib/routes/infoq/utils.ts @@ -103,7 +103,7 @@ function addCoverToDescription(content, cover) { } function parseContent(content) { - const isRichContent = content.startsWith(`{"`); + const isRichContent = content.startsWith('{"'); if (!isRichContent) { return content; } diff --git a/lib/routes/infzm/hot.ts b/lib/routes/infzm/hot.ts index c9757097a..6af39dadb 100644 --- a/lib/routes/infzm/hot.ts +++ b/lib/routes/infzm/hot.ts @@ -23,7 +23,7 @@ async function handler(): Promise { const link = 'https://www.infzm.com/'; const { data } = await got({ method: 'get', - url: `https://www.infzm.com/hot_contents`, + url: 'https://www.infzm.com/hot_contents', headers: { Referer: link, }, @@ -32,7 +32,7 @@ async function handler(): Promise { const resultItem = await fetchArticles(data.data.hot_contents); return { - title: `南方周末-热门文章`, + title: '南方周末-热门文章', link, image: 'https://www.infzm.com/favicon.ico', item: resultItem as DataItem[], diff --git a/lib/routes/issuehunt/funded.ts b/lib/routes/issuehunt/funded.ts index 0c110e51f..75621398a 100644 --- a/lib/routes/issuehunt/funded.ts +++ b/lib/routes/issuehunt/funded.ts @@ -36,7 +36,7 @@ async function handler(ctx) { return { title: `Issue Hunt 的悬赏 -- ${username}/${repo}`, link: `https://issuehunt.io/r/${username}/${repo}`, - description: ``, + description: '', item: issues.map((item) => ({ title: item.title, description: md.render(item.body), diff --git a/lib/routes/jandan/utils.ts b/lib/routes/jandan/utils.ts index c2b702c5b..040d4ff00 100644 --- a/lib/routes/jandan/utils.ts +++ b/lib/routes/jandan/utils.ts @@ -148,7 +148,7 @@ export const handleForumSection = async (rootUrl: string): Promise<{ title: stri title, items: [ { - title: `解析错误: 鱼塘`, + title: '解析错误: 鱼塘', description: `解析鱼塘页面时出错: ${error instanceof Error ? error.message : String(error)}`, link: currentUrl, pubDate: new Date(), diff --git a/lib/routes/jiuyangongshe/community.tsx b/lib/routes/jiuyangongshe/community.tsx index c8dbc44a1..b6315d877 100644 --- a/lib/routes/jiuyangongshe/community.tsx +++ b/lib/routes/jiuyangongshe/community.tsx @@ -120,7 +120,7 @@ export const route: Route = { }; async function handler(ctx: Context): Promise { - const link = `https://www.jiuyangongshe.com`; + const link = 'https://www.jiuyangongshe.com'; const time = String(Date.now()); const response = await ofetch('https://app.jiuyangongshe.com/jystock-app/api/v2/article/community', { diff --git a/lib/routes/jpxgmn/weekly.ts b/lib/routes/jpxgmn/weekly.ts index 51e727cd5..e560aebd0 100644 --- a/lib/routes/jpxgmn/weekly.ts +++ b/lib/routes/jpxgmn/weekly.ts @@ -45,7 +45,7 @@ async function handler() { return ret; }); return { - title: `极品性感美女 - 本周热门推荐`, + title: '极品性感美女 - 本周热门推荐', link: response.url, item: await Promise.all( items.map((item) => diff --git a/lib/routes/juejin/books.ts b/lib/routes/juejin/books.ts index 160563932..3f2518497 100644 --- a/lib/routes/juejin/books.ts +++ b/lib/routes/juejin/books.ts @@ -24,7 +24,7 @@ export const route: Route = { maintainers: ['xyqfer'], handler, url: 'juejin.cn/books', - description: `> 掘金小册需要付费订阅,RSS 仅做更新提醒,不含付费内容.`, + description: '> 掘金小册需要付费订阅,RSS 仅做更新提醒,不含付费内容.', }; async function handler() { diff --git a/lib/routes/juejin/pins.ts b/lib/routes/juejin/pins.ts index 86a0fcb40..193913901 100644 --- a/lib/routes/juejin/pins.ts +++ b/lib/routes/juejin/pins.ts @@ -40,7 +40,7 @@ async function handler(ctx) { let url: string; let json: Record; if (/^\d+$/.test(type)) { - url = `https://api.juejin.cn/recommend_api/v1/short_msg/topic`; + url = 'https://api.juejin.cn/recommend_api/v1/short_msg/topic'; json = { id_type: 4, sort_type: 500, cursor: '0', limit: 20, topic_id: type }; } else { url = `https://api.juejin.cn/recommend_api/v1/short_msg/${type}`; diff --git a/lib/routes/jump/discount.tsx b/lib/routes/jump/discount.tsx index db3f72e7e..bc6d09c4c 100644 --- a/lib/routes/jump/discount.tsx +++ b/lib/routes/jump/discount.tsx @@ -111,7 +111,7 @@ const renderDescription = (item) => ); const getDiscountNum = async (platform) => { - const response = await got.get(`https://switch.jumpvg.com/jump/platform/order/v2?needCount=1&needFilter=1&version=3`); + const response = await got.get('https://switch.jumpvg.com/jump/platform/order/v2?needCount=1&needFilter=1&version=3'); const data = response.data.data; let totalNum = 0; for (const index in data) { diff --git a/lib/routes/kbs/today.ts b/lib/routes/kbs/today.ts index d8df62d9d..d4f33615b 100644 --- a/lib/routes/kbs/today.ts +++ b/lib/routes/kbs/today.ts @@ -80,7 +80,7 @@ async function handler(ctx) { ); return { - title: `Latest News | KBS WORLD`, + title: 'Latest News | KBS WORLD', link: currentUrl, item: items, }; diff --git a/lib/routes/keylol/index.ts b/lib/routes/keylol/index.ts index 826be4186..e97ccab1d 100644 --- a/lib/routes/keylol/index.ts +++ b/lib/routes/keylol/index.ts @@ -25,7 +25,7 @@ export const route: Route = { { name: 'KEYLOL_COOKIE', optional: true, - description: `配置后可抓取具有阅读权限的帖子內容`, + description: '配置后可抓取具有阅读权限的帖子內容', }, ], requirePuppeteer: false, diff --git a/lib/routes/konachan/namespace.ts b/lib/routes/konachan/namespace.ts index 772118e01..39d419f5d 100644 --- a/lib/routes/konachan/namespace.ts +++ b/lib/routes/konachan/namespace.ts @@ -3,6 +3,6 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: 'Konachan.com Anime Wallpapers', url: 'konachan.com', - description: `konachan post`, + description: 'konachan post', lang: 'en', }; diff --git a/lib/routes/konghq/blog-posts.ts b/lib/routes/konghq/blog-posts.ts index 7b33c5ddc..44d5529ca 100644 --- a/lib/routes/konghq/blog-posts.ts +++ b/lib/routes/konghq/blog-posts.ts @@ -72,7 +72,7 @@ async function handler() { ); return { - title: `Kong Inc(konghq.com) blog posts`, + title: 'Kong Inc(konghq.com) blog posts', link: BLOG_POSTS_URL, item: items, }; diff --git a/lib/routes/konghq/namespace.ts b/lib/routes/konghq/namespace.ts index 227dfd37e..c28153e8c 100644 --- a/lib/routes/konghq/namespace.ts +++ b/lib/routes/konghq/namespace.ts @@ -3,6 +3,6 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: 'Kong API 网关平台', url: 'konghq.com', - description: `[Kong](https://konghq.com/) 是一家开源的 API 网关服务商,此处收集其官网的最新博客文章。`, + description: '[Kong](https://konghq.com/) 是一家开源的 API 网关服务商,此处收集其官网的最新博客文章。', lang: 'zh-CN', }; diff --git a/lib/routes/kuaidi100/supported-company.ts b/lib/routes/kuaidi100/supported-company.ts index 568101b9c..90b7dccf1 100644 --- a/lib/routes/kuaidi100/supported-company.ts +++ b/lib/routes/kuaidi100/supported-company.ts @@ -29,9 +29,9 @@ export const route: Route = { async function handler() { const ls = await utils.company(); return { - title: `快递100 快递列表`, + title: '快递100 快递列表', link: 'https://www.kuaidi100.com', - description: `快递100 所支持的快递列表及其查询名称`, + description: '快递100 所支持的快递列表及其查询名称', item: ls.map((item) => ({ title: item.name, description: item.number, diff --git a/lib/routes/kuaidi100/utils.ts b/lib/routes/kuaidi100/utils.ts index 9fa313279..b538b6ca1 100644 --- a/lib/routes/kuaidi100/utils.ts +++ b/lib/routes/kuaidi100/utils.ts @@ -32,18 +32,30 @@ async function getCookie() { if (set_cookie) { for (const e of set_cookie) { // eslint-disable-next-line unicorn/prefer-switch - if (e.indexOf('WWWID') === 0) { - wwwid = e.split(';')[0]; - } else if (e.indexOf('csrftoken') === 0) { - csrf = e.split(';')[0]; - } else if (e.indexOf('globacsrftoken') === 0) { - globacsrftoken = e.split(';')[0]; - } else if (e.includes('dasddocTitle')) { - dasddocTitl = e.split(';')[0]; - } else if (e.includes('dasddocReferrer')) { - dasddocReferrer = e.split(';')[0]; - } else if (e.includes('dasddocHref')) { - dasddocHref = e.split(';')[0]; + switch (0) { + case e.indexOf('WWWID'): { + wwwid = e.split(';')[0]; + + break; + } + case e.indexOf('csrftoken'): { + csrf = e.split(';')[0]; + + break; + } + case e.indexOf('globacsrftoken'): { + globacsrftoken = e.split(';')[0]; + + break; + } + default: + if (e.includes('dasddocTitle')) { + dasddocTitl = e.split(';')[0]; + } else if (e.includes('dasddocReferrer')) { + dasddocReferrer = e.split(';')[0]; + } else if (e.includes('dasddocHref')) { + dasddocHref = e.split(';')[0]; + } } } } diff --git a/lib/routes/kyodonews/index.tsx b/lib/routes/kyodonews/index.tsx index 1918bfc68..67f217266 100644 --- a/lib/routes/kyodonews/index.tsx +++ b/lib/routes/kyodonews/index.tsx @@ -37,7 +37,8 @@ export const route: Route = { name: '最新报道', maintainers: ['Rongronggg9'], handler, - description: `\`keyword\` 为关键词,由于共同网有许多关键词并不在主页列出,此处不一一列举,可从关键词页的 URL 的最后一级路径中提取。如 \`日中关系\` 的关键词页 URL 为 \`https://china.kyodonews.net/news/japan-china_relationship\`, 则将 \`japan-china_relationship\` 填入 \`keyword\`。特别地,当填入 \`rss\` 时,将从共同网官方 RSS 中抓取文章;略去时,将从首页抓取最新报道 (注意:首页更新可能比官方 RSS 稍慢)。`, + description: + '`keyword` 为关键词,由于共同网有许多关键词并不在主页列出,此处不一一列举,可从关键词页的 URL 的最后一级路径中提取。如 `日中关系` 的关键词页 URL 为 `https://china.kyodonews.net/news/japan-china_relationship`, 则将 `japan-china_relationship` 填入 `keyword`。特别地,当填入 `rss` 时,将从共同网官方 RSS 中抓取文章;略去时,将从首页抓取最新报道 (注意:首页更新可能比官方 RSS 稍慢)。', }; async function handler(ctx) { diff --git a/lib/routes/laimanhua/index.ts b/lib/routes/laimanhua/index.ts index 6e854f399..f6d12a789 100644 --- a/lib/routes/laimanhua/index.ts +++ b/lib/routes/laimanhua/index.ts @@ -31,7 +31,7 @@ export const route: Route = { async function handler(ctx) { const id = ctx.req.param('id'); - const baseUrl = `https://www.laimanhua8.com`; + const baseUrl = 'https://www.laimanhua8.com'; const link = `${baseUrl}/kanmanhua/${id}/`; const { data: response } = await got(link, { diff --git a/lib/routes/learnblockchain/posts.ts b/lib/routes/learnblockchain/posts.ts index 1dc455d53..0481f97c4 100644 --- a/lib/routes/learnblockchain/posts.ts +++ b/lib/routes/learnblockchain/posts.ts @@ -61,7 +61,7 @@ async function handler(ctx) { return { title: `登链社区--${cid}`, link: url, - description: `登链社区`, + description: '登链社区', item: list.toArray().map((ite) => { const item = $(ite); const json = { diff --git a/lib/routes/leetcode/dailyquestion-solution-cn.ts b/lib/routes/leetcode/dailyquestion-solution-cn.ts index bfc8c3c92..eb19f5c5a 100644 --- a/lib/routes/leetcode/dailyquestion-solution-cn.ts +++ b/lib/routes/leetcode/dailyquestion-solution-cn.ts @@ -24,7 +24,7 @@ export const route: Route = { }; async function handler() { - const baseurl = `https://leetcode.cn`; + const baseurl = 'https://leetcode.cn'; const url = `${baseurl}/graphql/`; const headers = { 'content-type': 'application/json', diff --git a/lib/routes/leetcode/dailyquestion-solution-en.ts b/lib/routes/leetcode/dailyquestion-solution-en.ts index 7542159f6..983957e17 100644 --- a/lib/routes/leetcode/dailyquestion-solution-en.ts +++ b/lib/routes/leetcode/dailyquestion-solution-en.ts @@ -25,7 +25,7 @@ export const route: Route = { }; async function handler() { - const baseurl = `https://leetcode.com`; + const baseurl = 'https://leetcode.com'; const url = `${baseurl}/graphql/`; const headers = { 'content-type': 'application/json', diff --git a/lib/routes/lenovo/drive.tsx b/lib/routes/lenovo/drive.tsx index 9b5a6e2fe..93435bc2c 100644 --- a/lib/routes/lenovo/drive.tsx +++ b/lib/routes/lenovo/drive.tsx @@ -36,7 +36,7 @@ export async function handler(ctx) { const response = await ofetch(link); if (response.statusCode !== 200) { - throw new InvalidParameterError(`无效序列号, 请检查你的序列号是否正确.`); + throw new InvalidParameterError('无效序列号, 请检查你的序列号是否正确.'); } const driveList = response.data.partList.flatMap((part) => part.drivelist); diff --git a/lib/routes/lens/profile.ts b/lib/routes/lens/profile.ts index ac77628d1..3fc45e031 100644 --- a/lib/routes/lens/profile.ts +++ b/lib/routes/lens/profile.ts @@ -29,7 +29,7 @@ async function handler(ctx) { const handle = ctx.req.param('handle'); const profile = ( - await got(`https://api-v2.lens.dev/`, { + await got('https://api-v2.lens.dev/', { method: 'POST', json: { operationName: 'Profile', @@ -44,7 +44,7 @@ async function handler(ctx) { ).data.data.profile; const publications = ( - await got(`https://api-v2.lens.dev/`, { + await got('https://api-v2.lens.dev/', { method: 'POST', json: { operationName: 'Publications', diff --git a/lib/routes/linkedin/cn/renderer.ts b/lib/routes/linkedin/cn/renderer.ts index 6328531fb..074ecd93e 100644 --- a/lib/routes/linkedin/cn/renderer.ts +++ b/lib/routes/linkedin/cn/renderer.ts @@ -90,7 +90,7 @@ const renderSingle = (node) => { case 'BOLD': return `${node.text}`; case 'LINE_BREAK': - return `
    `; + return '
    '; case 'LIST_ITEM': return `
  • ${node.text}
  • `; case 'LIST': diff --git a/lib/routes/linkedin/utils.ts b/lib/routes/linkedin/utils.ts index e1c7ab05b..38d3d0803 100644 --- a/lib/routes/linkedin/utils.ts +++ b/lib/routes/linkedin/utils.ts @@ -114,7 +114,7 @@ function parseJobDetail(data) { const job = new Job(); const $ = load(data); - job.recruiter = $('a.message-the-recruiter__cta').attr(`href`); + job.recruiter = $('a.message-the-recruiter__cta').attr('href'); job.description = $('div.description__text description__text--rich').text(); return job; diff --git a/lib/routes/lofter/collection.ts b/lib/routes/lofter/collection.ts index adf90b2e0..17e561b2e 100644 --- a/lib/routes/lofter/collection.ts +++ b/lib/routes/lofter/collection.ts @@ -61,7 +61,7 @@ async function handler(ctx) { title: item.post.title || item.post.noticeLinkTitle, link: item.post.blogPageUrl, description: - JSON.parse(item.post.photoLinks || `[]`) + JSON.parse(item.post.photoLinks || '[]') .map((photo) => { if (photo.raw?.match(/\/\/nos\.netease\.com\//)) { photo.raw = `https://${photo.raw.match(/(imglf\d)/)[0]}.lf127.net${photo.raw.match(/\/\/nos\.netease\.com\/imglf\d(.*)/)[1]}`; @@ -69,7 +69,7 @@ async function handler(ctx) { return ``; }) .join('') + - JSON.parse(item.post.embed ? `[${item.post.embed}]` : `[]`) + JSON.parse(item.post.embed ? `[${item.post.embed}]` : '[]') .map((video) => ``) .join('') + item.post.content, diff --git a/lib/routes/lofter/user.ts b/lib/routes/lofter/user.ts index d16cbe6e9..ee509e0f1 100644 --- a/lib/routes/lofter/user.ts +++ b/lib/routes/lofter/user.ts @@ -35,7 +35,7 @@ async function handler(ctx) { const response = await got({ method: 'post', - url: `http://api.lofter.com/v2.0/blogHomePage.api?product=lofter-iphone-10.0.0`, + url: 'http://api.lofter.com/v2.0/blogHomePage.api?product=lofter-iphone-10.0.0', body: new URLSearchParams({ blogdomain: rootUrl, checkpwd: '1', @@ -57,7 +57,7 @@ async function handler(ctx) { title: item.post.title || item.post.noticeLinkTitle, link: item.post.blogPageUrl, description: - JSON.parse(item.post.photoLinks || `[]`) + JSON.parse(item.post.photoLinks || '[]') .map((photo) => { if (photo.raw?.match(/\/\/nos\.netease\.com\//)) { photo.raw = `https://${photo.raw.match(/(imglf\d)/)[0]}.lf127.net${photo.raw.match(/\/\/nos\.netease\.com\/imglf\d(.*)/)[1]}`; @@ -65,7 +65,7 @@ async function handler(ctx) { return ``; }) .join('') + - JSON.parse(item.post.embed ? `[${item.post.embed}]` : `[]`) + JSON.parse(item.post.embed ? `[${item.post.embed}]` : '[]') .map((video) => ``) .join('') + item.post.content, diff --git a/lib/routes/logonews/index.tsx b/lib/routes/logonews/index.tsx index 853b5c7bc..552e9ac56 100644 --- a/lib/routes/logonews/index.tsx +++ b/lib/routes/logonews/index.tsx @@ -19,7 +19,7 @@ export const route: Route = { maintainers: ['nczitzk'], handler, url: 'logonews.cn/', - description: `如 [中国 - 标志情报局](https://www.logonews.cn/tag/china) 的 URL 为 \`https://www.logonews.cn/tag/china\`,可得路由为 [\`/logonews/tag/china\`](https://rsshub.app/logonews/tag/china)。`, + description: '如 [中国 - 标志情报局](https://www.logonews.cn/tag/china) 的 URL 为 `https://www.logonews.cn/tag/china`,可得路由为 [`/logonews/tag/china`](https://rsshub.app/logonews/tag/china)。', }; async function handler(ctx) { diff --git a/lib/routes/macmenubar/recently.ts b/lib/routes/macmenubar/recently.ts index ca71e5f3f..fd937d8de 100644 --- a/lib/routes/macmenubar/recently.ts +++ b/lib/routes/macmenubar/recently.ts @@ -2,7 +2,7 @@ import type { Route } from '@/types'; import got from '@/utils/got'; async function getCategoryId(categories) { - const baseUrl = `https://macmenubar.com/wp-json/wp/v2/categories`; + const baseUrl = 'https://macmenubar.com/wp-json/wp/v2/categories'; const { data: response } = await got(baseUrl, { method: 'GET', searchParams: { diff --git a/lib/routes/magazinelib/latest-magazine.tsx b/lib/routes/magazinelib/latest-magazine.tsx index c0fa7afd8..fb0c09390 100644 --- a/lib/routes/magazinelib/latest-magazine.tsx +++ b/lib/routes/magazinelib/latest-magazine.tsx @@ -27,7 +27,7 @@ export const route: Route = { name: 'Latest Magazine', maintainers: ['EthanWng97'], handler, - description: `For instance, when doing search at [https://magazinelib.com](https://magazinelib.com) and you get url \`https://magazinelib.com/?s=new+yorker\`, the query is \`new+yorker\``, + description: 'For instance, when doing search at [https://magazinelib.com](https://magazinelib.com) and you get url `https://magazinelib.com/?s=new+yorker`, the query is `new+yorker`', }; async function handler(ctx) { diff --git a/lib/routes/mashiro/index.ts b/lib/routes/mashiro/index.ts index 1a92e4686..d11534a30 100644 --- a/lib/routes/mashiro/index.ts +++ b/lib/routes/mashiro/index.ts @@ -19,7 +19,7 @@ export const route: Route = { source: ['mashiro.best/', 'mashiro.best/:lang/'], }, ], - name: `Blog`, + name: 'Blog', maintainers: ['MuenYu'], handler: async (ctx) => { const { lang = 'en' } = ctx.req.param(); diff --git a/lib/routes/mastodon/timeline-local.ts b/lib/routes/mastodon/timeline-local.ts index 3320a05e9..4c8544cfb 100644 --- a/lib/routes/mastodon/timeline-local.ts +++ b/lib/routes/mastodon/timeline-local.ts @@ -33,7 +33,7 @@ export const route: Route = { name: 'Instance timeline (local)', maintainers: ['hoilc'], handler, - description: `If the instance address is not \`mastodon.social\` or \`pawoo.net\`, then the route requires \`ALLOW_USER_SUPPLY_UNSAFE_DOMAIN\` to be \`true\`.`, + description: 'If the instance address is not `mastodon.social` or `pawoo.net`, then the route requires `ALLOW_USER_SUPPLY_UNSAFE_DOMAIN` to be `true`.', }; async function handler(ctx) { diff --git a/lib/routes/mastodon/timeline-remote.ts b/lib/routes/mastodon/timeline-remote.ts index 5f094d79f..9f2fbaad1 100644 --- a/lib/routes/mastodon/timeline-remote.ts +++ b/lib/routes/mastodon/timeline-remote.ts @@ -33,7 +33,7 @@ export const route: Route = { name: 'Instance timeline (federated)', maintainers: ['hoilc'], handler, - description: `If the instance address is not \`mastodon.social\` or \`pawoo.net\`, then the route requires \`ALLOW_USER_SUPPLY_UNSAFE_DOMAIN\` to be \`true\`.`, + description: 'If the instance address is not `mastodon.social` or `pawoo.net`, then the route requires `ALLOW_USER_SUPPLY_UNSAFE_DOMAIN` to be `true`.', }; async function handler(ctx) { diff --git a/lib/routes/mi/golden.ts b/lib/routes/mi/golden.ts index 14d59029f..8989794f2 100644 --- a/lib/routes/mi/golden.ts +++ b/lib/routes/mi/golden.ts @@ -24,7 +24,7 @@ async function handler() { })); return { - title: `金米奖 - 小米应用商店`, + title: '金米奖 - 小米应用商店', link, item: list, description: response.data.description, diff --git a/lib/routes/mihoyo/bbs/follow-list.ts b/lib/routes/mihoyo/bbs/follow-list.ts index 219f85dc8..bb975622a 100644 --- a/lib/routes/mihoyo/bbs/follow-list.ts +++ b/lib/routes/mihoyo/bbs/follow-list.ts @@ -31,7 +31,7 @@ async function handler(ctx) { page_size, }; const link = `https://www.miyoushe.com/ys/accountCenter/followList?id=${uid}`; - const url = `https://bbs-api.miyoushe.com/user/wapi/following`; + const url = 'https://bbs-api.miyoushe.com/user/wapi/following'; const response = await got({ method: 'get', url, diff --git a/lib/routes/mihoyo/bbs/user-post.ts b/lib/routes/mihoyo/bbs/user-post.ts index f6361e815..8d6f654b9 100644 --- a/lib/routes/mihoyo/bbs/user-post.ts +++ b/lib/routes/mihoyo/bbs/user-post.ts @@ -29,7 +29,7 @@ async function handler(ctx) { size, }; const link = `https://www.miyoushe.com/ys/accountCenter/postList?id=${uid}`; - const url = `https://bbs-api.miyoushe.com/post/wapi/userPost`; + const url = 'https://bbs-api.miyoushe.com/post/wapi/userPost'; const response = await got({ method: 'get', url, diff --git a/lib/routes/minecraft/blockedservers.ts b/lib/routes/minecraft/blockedservers.ts index aaa898ad5..2cd9f6894 100644 --- a/lib/routes/minecraft/blockedservers.ts +++ b/lib/routes/minecraft/blockedservers.ts @@ -23,7 +23,7 @@ export const route: Route = { maintainers: ['xtexChooser'], handler, url: 'minecraft.net/', - description: `Java 版中被 Mojang 通过 sessionserver 阻止的服务器域名的 SHA-1 散列`, + description: 'Java 版中被 Mojang 通过 sessionserver 阻止的服务器域名的 SHA-1 散列', zh: { name: 'Java版被阻止的服务器域名散列', }, @@ -37,7 +37,7 @@ async function handler() { const data = (response.data.toString() as string).split('\n').filter((str) => str !== ''); - const title = `Minecraft Java版被阻止的服务器域名散列`; + const title = 'Minecraft Java版被阻止的服务器域名散列'; return { title, diff --git a/lib/routes/minecraft/java-runtime.ts b/lib/routes/minecraft/java-runtime.ts index 72be6ad09..d0b9b9f6f 100644 --- a/lib/routes/minecraft/java-runtime.ts +++ b/lib/routes/minecraft/java-runtime.ts @@ -8,8 +8,8 @@ export const route: Route = { categories: ['game'], example: '/minecraft/java-runtime', parameters: { - arch: `Arch, \`all\` by default`, - javaType: `Java runtime type, \`all\` by default`, + arch: 'Arch, `all` by default', + javaType: 'Java runtime type, `all` by default', }, features: { requireConfig: false, diff --git a/lib/routes/minecraft/version.ts b/lib/routes/minecraft/version.ts index bc445aabc..c0ef9388a 100644 --- a/lib/routes/minecraft/version.ts +++ b/lib/routes/minecraft/version.ts @@ -8,8 +8,8 @@ export const route: Route = { categories: ['game'], example: '/minecraft/version', parameters: { - versionType: `Game version type, \`all\` by default`, - linkType: `Link added to feed, \`official\` by default`, + versionType: 'Game version type, `all` by default', + linkType: 'Link added to feed, `official` by default', }, features: { requireConfig: false, @@ -60,7 +60,7 @@ const typeName = { }; const linkFormatter: any = { - official: () => `https://www.minecraft.net`, + official: () => 'https://www.minecraft.net', enwiki: (item: VersionInManifest) => { let id = item.id; if (item.type === 'old_beta' && id.startsWith('b')) { @@ -72,7 +72,7 @@ const linkFormatter: any = { } else if (id.startsWith('c')) { id = `Classic ${id.slice(1)}`; } else if (id.startsWith('inf-')) { - id = `Infdev`; + id = 'Infdev'; } else if (id.startsWith('rd-')) { id = `pre-Classic ${id}`; } @@ -93,7 +93,7 @@ const linkFormatter: any = { } else if (id.startsWith('c')) { id = `Java版Classic ${id.slice(1)}`; } else if (id.startsWith('inf-')) { - id = `Java版Infdev`; + id = 'Java版Infdev'; } else if (id.startsWith('rd-')) { id = `Java版pre-Classic ${id}`; } @@ -125,7 +125,7 @@ async function handler(ctx?: Context) { return { title, - link: `https://www.minecraft.net/`, + link: 'https://www.minecraft.net/', description: title, item: data.map((item) => ({ title: `${item.id} ${typeName[item.type] || ''}更新`, diff --git a/lib/routes/miniflux/entry.ts b/lib/routes/miniflux/entry.ts index b2511d539..e6833a64f 100644 --- a/lib/routes/miniflux/entry.ts +++ b/lib/routes/miniflux/entry.ts @@ -226,7 +226,7 @@ async function handler(ctx) { agTitle = `MiniFlux | ${feedsName.join(', ')}`; agInfo = `A RSS feed powered by MiniFlux and RSSHub effortlessly republishes the contents in "${feedsName.join('" & "')}".`; } else { - agTitle = `MiniFlux | Feeds Aggregator`; + agTitle = 'MiniFlux | Feeds Aggregator'; agInfo = 'An aggregator powered by MiniFlux and RSSHub with empty content. If this is not your intention, please double-check your setting for parameters.'; } @@ -276,7 +276,7 @@ async function handler(ctx) { } result = { - title: `MiniFlux | All`, + title: 'MiniFlux | All', link: instance, description: `All feeds on ${instance} powered by MiniFlux`, item: articles, diff --git a/lib/routes/miniflux/subscription.ts b/lib/routes/miniflux/subscription.ts index d6cdb91a3..af5037fab 100644 --- a/lib/routes/miniflux/subscription.ts +++ b/lib/routes/miniflux/subscription.ts @@ -120,9 +120,9 @@ async function handler(ctx) { } return { - title: `MiniFlux | Subscription List`, + title: 'MiniFlux | Subscription List', link: instance, - description: `A subscription tracking feed.`, + description: 'A subscription tracking feed.', item: subscription, allowEmpty: true, }; diff --git a/lib/routes/modrinth/versions.tsx b/lib/routes/modrinth/versions.tsx index 4ff061ace..bc5a3966b 100644 --- a/lib/routes/modrinth/versions.tsx +++ b/lib/routes/modrinth/versions.tsx @@ -112,7 +112,7 @@ async function handler(ctx: Context) { game_versions: parsedQuery.has('game_versions') ? JSON.stringify(parsedQuery.getAll('game_versions')) : '', }, }); - const authors = await ofetch(`https://api.modrinth.com/v2/users`, { + const authors = await ofetch('https://api.modrinth.com/v2/users', { query: { ids: JSON.stringify([...new Set(versions.map((it) => it.author_id))]), }, diff --git a/lib/routes/mox/index.ts b/lib/routes/mox/index.ts index 784e10a26..9b9f0e5f2 100644 --- a/lib/routes/mox/index.ts +++ b/lib/routes/mox/index.ts @@ -15,7 +15,7 @@ export const route: Route = { { name: 'MOX_COOKIE', optional: true, - description: `注册用户登录后的 Cookie, 可以从浏览器开发者工具Network面板中的mox页面请求获取,Cookie内容形如VOLSKEY=xxxxxx; VLIBSID=xxxxxx; VOLSESS=xxxxxx`, + description: '注册用户登录后的 Cookie, 可以从浏览器开发者工具Network面板中的mox页面请求获取,Cookie内容形如VOLSKEY=xxxxxx; VLIBSID=xxxxxx; VOLSESS=xxxxxx', }, ], antiCrawler: true, diff --git a/lib/routes/msn/index.ts b/lib/routes/msn/index.ts index 67349229d..a74dc9a7a 100644 --- a/lib/routes/msn/index.ts +++ b/lib/routes/msn/index.ts @@ -17,7 +17,7 @@ export const route: Route = { }, categories: ['traditional-media'], example: '/zh-tw/Bloomberg/sr-vid-08gw7ky4u229xjsjvnf4n6n7v67gxm0pjmv9fr4y2x9jjmwcri4s', - description: `MSN News`, + description: 'MSN News', features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/mymusicsheet/usersheets.tsx b/lib/routes/mymusicsheet/usersheets.tsx index c631a288a..5f00edf30 100644 --- a/lib/routes/mymusicsheet/usersheets.tsx +++ b/lib/routes/mymusicsheet/usersheets.tsx @@ -31,7 +31,7 @@ export const route: Route = { name: 'User Sheets', maintainers: ['Freddd13'], handler, - description: `Please refer to [Wikipedia](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) for ISO 4217.`, + description: 'Please refer to [Wikipedia](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) for ISO 4217.', }; async function handler(ctx) { diff --git a/lib/routes/nature/cover.ts b/lib/routes/nature/cover.ts index 1ad509eb1..6052b8fa4 100644 --- a/lib/routes/nature/cover.ts +++ b/lib/routes/nature/cover.ts @@ -45,7 +45,7 @@ export const route: Route = { maintainers: ['y9c', 'pseudoyu'], handler, url: 'nature.com/', - description: `Subscribe to the cover images of the Nature journals, and get the latest publication updates in time.`, + description: 'Subscribe to the cover images of the Nature journals, and get the latest publication updates in time.', }; async function handler() { diff --git a/lib/routes/nature/research.ts b/lib/routes/nature/research.ts index f95bbaae7..e12180d88 100644 --- a/lib/routes/nature/research.ts +++ b/lib/routes/nature/research.ts @@ -74,7 +74,7 @@ async function handler(ctx) { return { title: `Nature (${pageTitle}) | Latest Research`, - description: pageCapture('meta[name="description"]').attr('content') || `Nature, a nature research journal`, + description: pageCapture('meta[name="description"]').attr('content') || 'Nature, a nature research journal', link: pageURL, item: items, }; diff --git a/lib/routes/nautil/topics.tsx b/lib/routes/nautil/topics.tsx index e135f8be4..fc5c052d8 100644 --- a/lib/routes/nautil/topics.tsx +++ b/lib/routes/nautil/topics.tsx @@ -31,7 +31,7 @@ export const route: Route = { name: 'Topics', maintainers: ['emdoe'], handler, - description: `This route provides a flexible plan with full text content to subscribe specific topic(s) on the Nautilus. Please visit [nautil.us](https://nautil.us) and click \`Topics\` to acquire whole topic list.`, + description: 'This route provides a flexible plan with full text content to subscribe specific topic(s) on the Nautilus. Please visit [nautil.us](https://nautil.us) and click `Topics` to acquire whole topic list.', }; async function handler(ctx) { diff --git a/lib/routes/nber/common.tsx b/lib/routes/nber/common.tsx index 821f2c1dc..fc13f6748 100644 --- a/lib/routes/nber/common.tsx +++ b/lib/routes/nber/common.tsx @@ -47,6 +47,6 @@ export async function handler(ctx) { title: 'NBER Working Paper', link: 'https://www.nber.org/papers', item: items, - description: `National Bureau of Economic Research Working Papers articles`, + description: 'National Bureau of Economic Research Working Papers articles', }; } diff --git a/lib/routes/ncwu/notice.ts b/lib/routes/ncwu/notice.ts index 45477174e..b2c5f6242 100644 --- a/lib/routes/ncwu/notice.ts +++ b/lib/routes/ncwu/notice.ts @@ -39,7 +39,7 @@ async function handler() { .map((item) => { item = $(item); return { - title: `「` + item.find('a.dw').text() + `」` + item.find('a.dw').next().text(), + title: '「' + item.find('a.dw').text() + '」' + item.find('a.dw').next().text(), description: item.find('div.detail').text(), pubDate: parseDate(item.find('div.month').text() + '-' + item.find('div.day').text(), 'YYYY-MM-DD'), link: item.find('a.dw').next().attr('href'), diff --git a/lib/routes/ndss-symposium/ndss.ts b/lib/routes/ndss-symposium/ndss.ts index 1634bf225..31bc90722 100644 --- a/lib/routes/ndss-symposium/ndss.ts +++ b/lib/routes/ndss-symposium/ndss.ts @@ -29,7 +29,7 @@ export const route: Route = { maintainers: ['ZeddYu'], handler, url: 'ndss-symposium.org/', - description: `Return results from 2020`, + description: 'Return results from 2020', }; async function handler() { diff --git a/lib/routes/neea/index.ts b/lib/routes/neea/index.ts index e6c3b85f2..35b25dc29 100644 --- a/lib/routes/neea/index.ts +++ b/lib/routes/neea/index.ts @@ -34,7 +34,7 @@ async function handler(ctx) { const data = response.data; const $ = load(data); - const list = $(`#ReportIDname > a`).parent().parent().toArray(); + const list = $('#ReportIDname > a').parent().parent().toArray(); const process = await Promise.all( list.map(async (item) => { diff --git a/lib/routes/newswav/latest.ts b/lib/routes/newswav/latest.ts index f0a35072e..dc6401c24 100644 --- a/lib/routes/newswav/latest.ts +++ b/lib/routes/newswav/latest.ts @@ -30,7 +30,7 @@ export const route: Route = { async function handler() { const baseUrl = 'https://newswav.com'; - const response = await ofetch(`https://feed-api.newswav.com/api/web/feeds/latest`, { + const response = await ofetch('https://feed-api.newswav.com/api/web/feeds/latest', { query: { languages: 'en,ms,zh', }, diff --git a/lib/routes/nga/forum.ts b/lib/routes/nga/forum.ts index 3ade42720..920454dc7 100644 --- a/lib/routes/nga/forum.ts +++ b/lib/routes/nga/forum.ts @@ -39,7 +39,7 @@ async function handler(ctx) { const src = p1.replaceAll(/\?.*/g, ''); return ``; }) - .replaceAll(/\[url](.+?)\[\/url]/g, `$1`); + .replaceAll(/\[url](.+?)\[\/url]/g, '$1'); const homePage = await got.post('https://ngabbs.com/app_api.php?__lib=subject&__act=list', { headers: { 'X-User-Agent': X_UA, diff --git a/lib/routes/nikkei/cn/index.ts b/lib/routes/nikkei/cn/index.ts index 36defa883..745266945 100644 --- a/lib/routes/nikkei/cn/index.ts +++ b/lib/routes/nikkei/cn/index.ts @@ -42,7 +42,7 @@ export const route: Route = { } else if (params.category && !params.type) { return `/nikkei/cn/cn/${params.category.replace('.html', '')}`; } else { - return `/nikkei/cn/cn`; + return '/nikkei/cn/cn'; } }, }, @@ -55,7 +55,7 @@ export const route: Route = { } else if (params.category && !params.type) { return `/nikkei/cn/zh/${params.category.replace('.html', '')}`; } else { - return `/nikkei/cn/zh`; + return '/nikkei/cn/zh'; } }, }, diff --git a/lib/routes/nintendo/eshop-us.ts b/lib/routes/nintendo/eshop-us.ts index 8a958628e..2fedf8e5f 100644 --- a/lib/routes/nintendo/eshop-us.ts +++ b/lib/routes/nintendo/eshop-us.ts @@ -34,9 +34,9 @@ async function handler(ctx) { ctx.set('json', response.data); return { - title: `Nintendo eShop(美服)新游戏`, - link: `https://www.nintendo.com/store/games/`, - description: `Nintendo eShop(美服)新上架的游戏`, + title: 'Nintendo eShop(美服)新游戏', + link: 'https://www.nintendo.com/store/games/', + description: 'Nintendo eShop(美服)新上架的游戏', item: data.map((item) => ({ title: item.title, description: renderEshopUsDescription(item), diff --git a/lib/routes/nju/admission.ts b/lib/routes/nju/admission.ts index 0ba564d6f..a82c3b296 100644 --- a/lib/routes/nju/admission.ts +++ b/lib/routes/nju/admission.ts @@ -35,7 +35,7 @@ async function handler() { const items = await Promise.all( Object.keys(category_dict).map(async () => { - const response = await got(`https://admission.nju.edu.cn/tzgg`); + const response = await got('https://admission.nju.edu.cn/tzgg'); const data = response.data; const $ = load(data); diff --git a/lib/routes/nju/dafls.ts b/lib/routes/nju/dafls.ts index 3b188f0f7..a51d81ae0 100644 --- a/lib/routes/nju/dafls.ts +++ b/lib/routes/nju/dafls.ts @@ -36,7 +36,7 @@ async function handler() { const items = await Promise.all( Object.keys(category_dict).map(async (c) => { - const response = await got(`https://dafls.nju.edu.cn/13167/list.htm`); + const response = await got('https://dafls.nju.edu.cn/13167/list.htm'); const data = response.data; const $ = load(data); diff --git a/lib/routes/nju/hosptial.ts b/lib/routes/nju/hosptial.ts index 878e96934..c1d823948 100644 --- a/lib/routes/nju/hosptial.ts +++ b/lib/routes/nju/hosptial.ts @@ -35,7 +35,7 @@ async function handler() { const items = await Promise.all( Object.keys(category_dict).map(async () => { - const response = await got(`https://hospital.nju.edu.cn/ggtz/index.html`); + const response = await got('https://hospital.nju.edu.cn/ggtz/index.html'); const data = response.data; const $ = load(data); diff --git a/lib/routes/nju/hqjt.ts b/lib/routes/nju/hqjt.ts index 3b7dd8c10..971209697 100644 --- a/lib/routes/nju/hqjt.ts +++ b/lib/routes/nju/hqjt.ts @@ -36,7 +36,7 @@ async function handler() { const items = await Promise.all( Object.keys(category_dict).map(async () => { - const response = await got(`https://webplus.nju.edu.cn/_s25/zbcg/list.psp`); + const response = await got('https://webplus.nju.edu.cn/_s25/zbcg/list.psp'); const data = response.data; const $ = load(data); diff --git a/lib/routes/nju/itsc.ts b/lib/routes/nju/itsc.ts index fa280aa45..837615077 100644 --- a/lib/routes/nju/itsc.ts +++ b/lib/routes/nju/itsc.ts @@ -36,7 +36,7 @@ async function handler() { const items = await Promise.all( Object.keys(category_dict).map(async () => { - const response = await got(`https://itsc.nju.edu.cn/tzgg/list.htm`); + const response = await got('https://itsc.nju.edu.cn/tzgg/list.htm'); const data = response.data; const $ = load(data); diff --git a/lib/routes/nju/jjc.ts b/lib/routes/nju/jjc.ts index 8e33e8380..64faa8d45 100644 --- a/lib/routes/nju/jjc.ts +++ b/lib/routes/nju/jjc.ts @@ -59,7 +59,7 @@ async function handler() { ); return { - title: `南京大学基建处`, + title: '南京大学基建处', link: 'https://jjc.nju.edu.cn/main.htm', item: [...items[0], ...items[1], ...items[2]], }; diff --git a/lib/routes/nju/zbb.ts b/lib/routes/nju/zbb.ts index cf3a1e707..de30c82b1 100644 --- a/lib/routes/nju/zbb.ts +++ b/lib/routes/nju/zbb.ts @@ -29,7 +29,7 @@ export const route: Route = { async function handler(ctx) { const type = ctx.req.param('type'); if (type === 'zfcgyxgk') { - const url = `https://zbb.nju.edu.cn/zfcgyxgk/index.chtml`; + const url = 'https://zbb.nju.edu.cn/zfcgyxgk/index.chtml'; const response = await got({ method: 'get', diff --git a/lib/routes/nju/zcc.ts b/lib/routes/nju/zcc.ts index 00ff1d8e6..070a07398 100644 --- a/lib/routes/nju/zcc.ts +++ b/lib/routes/nju/zcc.ts @@ -35,7 +35,7 @@ async function handler() { const items = await Promise.all( Object.keys(category_dict).map(async () => { - const response = await got(`https://zcc.nju.edu.cn/sy/tzzhxx/index.html`); + const response = await got('https://zcc.nju.edu.cn/sy/tzzhxx/index.html'); const data = response.data; const $ = load(data); diff --git a/lib/routes/nmc/weatheralarm.ts b/lib/routes/nmc/weatheralarm.ts index 61d9e58f0..9cac7a1cd 100644 --- a/lib/routes/nmc/weatheralarm.ts +++ b/lib/routes/nmc/weatheralarm.ts @@ -33,7 +33,7 @@ export const route: Route = { async function handler(ctx) { const { province = '' } = ctx.req.param(); - const alarmInfoURL = `http://www.nmc.cn/rest/findAlarm`; + const alarmInfoURL = 'http://www.nmc.cn/rest/findAlarm'; const { data: response } = await got(alarmInfoURL, { searchParams: { pageNo: 1, diff --git a/lib/routes/nosec/index.ts b/lib/routes/nosec/index.ts index 75751dac4..b5f81e734 100644 --- a/lib/routes/nosec/index.ts +++ b/lib/routes/nosec/index.ts @@ -59,9 +59,9 @@ async function handler(ctx) { link = `https://nosec.org/home/index/${keykind}.html`; } else { // keykind 未知时则获取全部 - formdata = `keykind=&page=1`; - title = `NOSEC 安全讯息平台`; - link = `https://nosec.org/home/index`; + formdata = 'keykind=&page=1'; + title = 'NOSEC 安全讯息平台'; + link = 'https://nosec.org/home/index'; } const response = await got({ diff --git a/lib/routes/nowcoder/interview.ts b/lib/routes/nowcoder/interview.ts index 8c3f52518..86c9d97f1 100644 --- a/lib/routes/nowcoder/interview.ts +++ b/lib/routes/nowcoder/interview.ts @@ -23,7 +23,7 @@ export const route: Route = { }, ], name: '牛客面试经验', - description: `牛客面试经验`, + description: '牛客面试经验', maintainers: ['xia0ne'], handler, url: 'nowcoder.com/', diff --git a/lib/routes/nowcoder/jobcenter.ts b/lib/routes/nowcoder/jobcenter.ts index e7882faf4..cf5d1bb20 100644 --- a/lib/routes/nowcoder/jobcenter.ts +++ b/lib/routes/nowcoder/jobcenter.ts @@ -49,7 +49,7 @@ export const route: Route = { }; async function handler(ctx) { - const rootUrl = `https://www.nowcoder.com/job/center/`; + const rootUrl = 'https://www.nowcoder.com/job/center/'; const currentUrl = `${rootUrl}?${ctx.req.param('type') ? 'type=' + ctx.req.param('type') : ''}${ctx.req.param('city') ? '&city=' + ctx.req.param('city') : ''}${ctx.req.param('order') ? '&order=' + ctx.req.param('order') : ''}${ ctx.req.param('recruitType') ? '&recruitType=' + ctx.req.param('recruitType') : '' }${ctx.req.param('latest') ? '&latest=' + ctx.req.param('latest') : ''}`; diff --git a/lib/routes/npr/full.ts b/lib/routes/npr/full.ts index 0cbdb2cf0..b56809541 100644 --- a/lib/routes/npr/full.ts +++ b/lib/routes/npr/full.ts @@ -91,7 +91,7 @@ export const route: Route = { name: 'News', maintainers: ['bennyyip'], handler, - description: `Provide full article RSS for CBC topics.`, + description: 'Provide full article RSS for CBC topics.', }; async function handler(ctx) { diff --git a/lib/routes/nudt/yjszs.ts b/lib/routes/nudt/yjszs.ts index d75d82e57..1c418c3b7 100644 --- a/lib/routes/nudt/yjszs.ts +++ b/lib/routes/nudt/yjszs.ts @@ -64,7 +64,7 @@ async function handler(ctx) { throw new InvalidParameterError('invalid keyId'); } let link = `${host}/pubweb/homePageList`; - link += keyId === '2' ? `/searchContent.view` : `/recruitStudents.view?keyId=${keyId}`; + link += keyId === '2' ? '/searchContent.view' : `/recruitStudents.view?keyId=${keyId}`; const response = await got({ method: 'get', url: link, diff --git a/lib/routes/nwafu/utils.ts b/lib/routes/nwafu/utils.ts index eae6d5987..4be34d977 100644 --- a/lib/routes/nwafu/utils.ts +++ b/lib/routes/nwafu/utils.ts @@ -1,12 +1,12 @@ -const libValue = ['https://lib.nwafu.edu.cn/gg/', '.pageList ul li', 'li a', '.pageArticle', `西北农林科技大学图书馆通知公告`]; -const youthValue = ['https://54youth.nwsuaf.edu.cn/twsy/tzgg//', 'section ul li', 'li a', 'article', `共青团西北农林科技大学委员会通知公告`]; -const cieValue = ['https://cie.nwsuaf.edu.cn/dtytz/tzgg/', 'ul.list li', 'li a', '.article', `西北农林科技大学信息工程学院通知公告`]; -const gsValue = ['https://gs.nwsuaf.edu.cn/tzggB/', 'dl#sort ul.list li', 'li a', '.content', `西北农林科技大学后勤管理处通知公告`]; -const jccValue = ['https://jcc.nwsuaf.edu.cn/tzgg/', 'dl#sort ul.list li', 'li a', '.content', `西北农林科技大学计划财务处通知公告`]; -const jiaowuValue = ['https://jiaowu.nwsuaf.edu.cn/tzggB/', '.list-i ul li', 'li a', 'article', `西北农林科技大学教务通知公告`]; -const newsValue = ['https://news.nwafu.edu.cn/yxxw/', 'ul.NWAFU-list01 li', 'li a', '.pageArticle', `西北农林科技大学新闻网聚焦院处`]; -const nicValue = ['https://nic.nwsuaf.edu.cn/tzgg1/', 'dl#sort ul.list li', 'li a', '.content', `西北农林科技大学信息化管理处通知公告`]; -const yjshyValue = ['https://yjshy.nwafu.edu.cn/tzgg/', '.sort_rightcont ul li', 'li a', '.cont', `西北农林科技大学研究生院通知公告`]; +const libValue = ['https://lib.nwafu.edu.cn/gg/', '.pageList ul li', 'li a', '.pageArticle', '西北农林科技大学图书馆通知公告']; +const youthValue = ['https://54youth.nwsuaf.edu.cn/twsy/tzgg//', 'section ul li', 'li a', 'article', '共青团西北农林科技大学委员会通知公告']; +const cieValue = ['https://cie.nwsuaf.edu.cn/dtytz/tzgg/', 'ul.list li', 'li a', '.article', '西北农林科技大学信息工程学院通知公告']; +const gsValue = ['https://gs.nwsuaf.edu.cn/tzggB/', 'dl#sort ul.list li', 'li a', '.content', '西北农林科技大学后勤管理处通知公告']; +const jccValue = ['https://jcc.nwsuaf.edu.cn/tzgg/', 'dl#sort ul.list li', 'li a', '.content', '西北农林科技大学计划财务处通知公告']; +const jiaowuValue = ['https://jiaowu.nwsuaf.edu.cn/tzggB/', '.list-i ul li', 'li a', 'article', '西北农林科技大学教务通知公告']; +const newsValue = ['https://news.nwafu.edu.cn/yxxw/', 'ul.NWAFU-list01 li', 'li a', '.pageArticle', '西北农林科技大学新闻网聚焦院处']; +const nicValue = ['https://nic.nwsuaf.edu.cn/tzgg1/', 'dl#sort ul.list li', 'li a', '.content', '西北农林科技大学信息化管理处通知公告']; +const yjshyValue = ['https://yjshy.nwafu.edu.cn/tzgg/', '.sort_rightcont ul li', 'li a', '.cont', '西北农林科技大学研究生院通知公告']; const nxyValue = ['https://nxy.nwafu.edu.cn/xytz/tzgg_xwzx/', 'div.sort_rightcont ul li', 'li a', 'div.sort_rightcont2', '西北农林科技大学农业科学院通知公告']; const cmeeValue = ['https://cmee.nwafu.edu.cn/xwzx/xytz/', 'div.sort_rightcont ul li', 'li a', 'div.sort_rightcont2', '西北农林科技大学机械与电子工程学院通知公告']; const xshdValue = ['https://www.nwafu.edu.cn/xshd/', 'ul.subArticleList li', 'li a', '.article', '西北农林科技大学学术活动']; diff --git a/lib/routes/nytimes/daily-briefing-chinese.tsx b/lib/routes/nytimes/daily-briefing-chinese.tsx index 45d5e04c0..b828e02c4 100644 --- a/lib/routes/nytimes/daily-briefing-chinese.tsx +++ b/lib/routes/nytimes/daily-briefing-chinese.tsx @@ -29,7 +29,7 @@ export const route: Route = { maintainers: ['yueyericardo', 'nczitzk'], handler, url: 'nytimes.com/', - description: `URL: [https://www.nytimes.com/zh-hans/series/daily-briefing-chinese](https://www.nytimes.com/zh-hans/series/daily-briefing-chinese)`, + description: 'URL: [https://www.nytimes.com/zh-hans/series/daily-briefing-chinese](https://www.nytimes.com/zh-hans/series/daily-briefing-chinese)', }; async function handler() { diff --git a/lib/routes/nytimes/index.ts b/lib/routes/nytimes/index.ts index 0961b884a..f70421e8f 100644 --- a/lib/routes/nytimes/index.ts +++ b/lib/routes/nytimes/index.ts @@ -43,7 +43,7 @@ export const route: Route = { maintainers: ['HenryQW', 'pseudoyu'], handler, url: 'nytimes.com/', - description: `By extracting the full text of articles, we provide a better reading experience (full text articles) over the official one.`, + description: 'By extracting the full text of articles, we provide a better reading experience (full text articles) over the official one.', }; async function handler(ctx) { diff --git a/lib/routes/nytimes/rss.ts b/lib/routes/nytimes/rss.ts index 8f25eed25..9ed4b89ab 100644 --- a/lib/routes/nytimes/rss.ts +++ b/lib/routes/nytimes/rss.ts @@ -34,7 +34,7 @@ export const route: Route = { maintainers: ['HenryQW', 'pseudoyu', 'dzx-dzx'], handler, url: 'nytimes.com/', - description: `Enhance the official EN RSS feed`, + description: 'Enhance the official EN RSS feed', }; async function handler(ctx) { diff --git a/lib/routes/obsidian/plugins.ts b/lib/routes/obsidian/plugins.ts index 70e1aacc7..a2caa5fdc 100644 --- a/lib/routes/obsidian/plugins.ts +++ b/lib/routes/obsidian/plugins.ts @@ -27,7 +27,7 @@ async function handler() { return { title: 'Obsidian Plugins', - link: `https://obsidian.md/plugins`, + link: 'https://obsidian.md/plugins', item: data.map((item) => ({ title: item.name, description: `${item.description}

    Downloads: ${stats[item.id].downloads}`, diff --git a/lib/routes/oct0pu5/rss.ts b/lib/routes/oct0pu5/rss.ts index c597bc20b..48bea0bd7 100644 --- a/lib/routes/oct0pu5/rss.ts +++ b/lib/routes/oct0pu5/rss.ts @@ -31,8 +31,8 @@ async function handler() { return await buildData({ link, url: link, - title: `%title%`, - description: `%description%`, + title: '%title%', + description: '%description%', params: { title: '博客', description: 'Oct0pu5的博客', diff --git a/lib/routes/oeeee/app/reporter.ts b/lib/routes/oeeee/app/reporter.ts index 963c0779d..7f6a59e92 100644 --- a/lib/routes/oeeee/app/reporter.ts +++ b/lib/routes/oeeee/app/reporter.ts @@ -21,7 +21,7 @@ export const route: Route = { name: '南都客户端(按记者)', maintainers: ['TimWu007'], handler, - description: `记者的 UID 可通过 \`m.mp.oeeee.com\` 下的文章页面获取。点击文章下方的作者头像,进入该作者的个人主页,即可从 url 中获取。`, + description: '记者的 UID 可通过 `m.mp.oeeee.com` 下的文章页面获取。点击文章下方的作者头像,进入该作者的个人主页,即可从 url 中获取。', }; async function handler(ctx) { diff --git a/lib/routes/oeeee/web.ts b/lib/routes/oeeee/web.ts index 962d33594..720355d80 100644 --- a/lib/routes/oeeee/web.ts +++ b/lib/routes/oeeee/web.ts @@ -51,7 +51,7 @@ async function handler(ctx) { const items = await Promise.all(list.map((item) => parseArticle(item, cache.tryGet))); return { - title: `南方都市报奥一网`, + title: '南方都市报奥一网', link: `https://www.oeeee.com/api/channel.php?s=/index/index/channel/${channelEname}`, item: items, }; diff --git a/lib/routes/onet/news.tsx b/lib/routes/onet/news.tsx index 74b556556..ae6d02f70 100644 --- a/lib/routes/onet/news.tsx +++ b/lib/routes/onet/news.tsx @@ -32,7 +32,7 @@ export const route: Route = { maintainers: ['Vegann'], handler, url: 'wiadomosci.onet.pl/', - description: `This route provides a better reading experience (full text articles) over the official one for \`https://wiadomosci.onet.pl\`.`, + description: 'This route provides a better reading experience (full text articles) over the official one for `https://wiadomosci.onet.pl`.', }; async function handler() { diff --git a/lib/routes/osu/beatmaps/latest-ranked.tsx b/lib/routes/osu/beatmaps/latest-ranked.tsx index 7de7c5948..3c795358c 100644 --- a/lib/routes/osu/beatmaps/latest-ranked.tsx +++ b/lib/routes/osu/beatmaps/latest-ranked.tsx @@ -343,7 +343,7 @@ async function handler(ctx): Promise { ); return { - title: `${modeInTitle === 'true' ? `[${modeLiteralToDisplayNameMap[beatmapset.beatmaps[0].mode]}] ` : ``}${beatmapset.title_unicode ?? beatmapset.title}`, + title: `${modeInTitle === 'true' ? `[${modeLiteralToDisplayNameMap[beatmapset.beatmaps[0].mode]}] ` : ''}${beatmapset.title_unicode ?? beatmapset.title}`, description, pubDate, link: `https://osu.ppy.sh/beatmapsets/${beatmapset.id}`, diff --git a/lib/routes/outagereport/index.ts b/lib/routes/outagereport/index.ts index 0dc6628b8..d155a1876 100644 --- a/lib/routes/outagereport/index.ts +++ b/lib/routes/outagereport/index.ts @@ -19,7 +19,7 @@ export const route: Route = { name: 'Report', maintainers: ['cxumol', 'nczitzk'], handler, - description: `Please skip the local service area code for \`name\`, for example \`https://outage.report/us/verizon-wireless\` to \`verizon-wireless\`.`, + description: 'Please skip the local service area code for `name`, for example `https://outage.report/us/verizon-wireless` to `verizon-wireless`.', }; async function handler(ctx) { diff --git a/lib/routes/pixabay/search.tsx b/lib/routes/pixabay/search.tsx index 8996a8bd5..86e888d53 100644 --- a/lib/routes/pixabay/search.tsx +++ b/lib/routes/pixabay/search.tsx @@ -89,7 +89,7 @@ async function handler(ctx) { title: `Search ${q} - Pixabay`, description: 'Download & use free nature stock photos in high resolution ✓ New free images everyday ✓ HD to 4K ✓ Best nature pictures for all devices on Pixabay', link: `${baseUrl}/images/search/${q}/${order === 'latest' ? '?order=latest' : ''}`, - image: `https://pixabay.com/apple-touch-icon.png`, + image: 'https://pixabay.com/apple-touch-icon.png', language: 'en', item: items, }; diff --git a/lib/routes/pixiv/illustfollow.ts b/lib/routes/pixiv/illustfollow.ts index 6e9028519..af0979df9 100644 --- a/lib/routes/pixiv/illustfollow.ts +++ b/lib/routes/pixiv/illustfollow.ts @@ -54,9 +54,9 @@ async function handler() { const response = await getIllustFollows(token); const illusts = response.data.illusts; return { - title: `Pixiv关注的新作品`, + title: 'Pixiv关注的新作品', link: 'https://www.pixiv.net/bookmark_new_illust.php', - description: `Pixiv关注的画师们的最新作品`, + description: 'Pixiv关注的画师们的最新作品', item: illusts.map((illust) => { const images = pixivUtils.getImgs(illust); return { diff --git a/lib/routes/pixiv/novel-api/series/sfw.ts b/lib/routes/pixiv/novel-api/series/sfw.ts index 0b4b0cf3f..e36919942 100644 --- a/lib/routes/pixiv/novel-api/series/sfw.ts +++ b/lib/routes/pixiv/novel-api/series/sfw.ts @@ -37,7 +37,7 @@ export async function getSFWSeriesNovels(seriesId: string, limit: number = 10): if (!chapter.available) { return { title: `#${chapterStartNum + index} ${chapter.title}`, - description: `PIXIV_REFRESHTOKEN is required to view the full content.
    需要 PIXIV_REFRESHTOKEN 才能查看完整內文。`, + description: 'PIXIV_REFRESHTOKEN is required to view the full content.
    需要 PIXIV_REFRESHTOKEN 才能查看完整內文。', link: `${baseUrl}/novel/show.php?id=${chapter.id}`, }; } diff --git a/lib/routes/pku/cls/lecture.ts b/lib/routes/pku/cls/lecture.ts index 3582926be..56f1e52c7 100644 --- a/lib/routes/pku/cls/lecture.ts +++ b/lib/routes/pku/cls/lecture.ts @@ -36,9 +36,9 @@ async function handler() { const $ = load(response.data); return { - title: `北京大学生命科学学院近期讲座`, + title: '北京大学生命科学学院近期讲座', link: homeUrl, - description: `北京大学生命科学学院近期讲座`, + description: '北京大学生命科学学院近期讲座', item: $('a.clearfix') .toArray() .map((item) => ({ diff --git a/lib/routes/plurk/hotlinks.ts b/lib/routes/plurk/hotlinks.ts index b655243f0..122a5928a 100644 --- a/lib/routes/plurk/hotlinks.ts +++ b/lib/routes/plurk/hotlinks.ts @@ -39,7 +39,7 @@ async function handler(ctx) { const items = await Promise.all(apiResponse.map((item) => getPlurk(item.link_url.startsWith('https://www.plurk.com/p/') ? item.link_url : `plurk:${item.link_url}`, item, null, cache.tryGet))); return { - title: `Hot Links - Plurk`, + title: 'Hot Links - Plurk', image: 'https://s.plurk.com/2c1574c02566f3b06e91.png', link: `${baseUrl}/hotlinks`, item: items, diff --git a/lib/routes/polymarket/namespace.ts b/lib/routes/polymarket/namespace.ts index 19454d16d..70131d8f1 100644 --- a/lib/routes/polymarket/namespace.ts +++ b/lib/routes/polymarket/namespace.ts @@ -3,6 +3,6 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: 'Polymarket', url: 'polymarket.com', - description: `Polymarket is a prediction market platform where you can bet on real-world events.`, + description: 'Polymarket is a prediction market platform where you can bet on real-world events.', lang: 'en', }; diff --git a/lib/routes/producthunt/namespace.ts b/lib/routes/producthunt/namespace.ts index 29f5c1bfc..834f8dfe3 100644 --- a/lib/routes/producthunt/namespace.ts +++ b/lib/routes/producthunt/namespace.ts @@ -3,6 +3,6 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: 'Product Hunt', url: 'www.producthunt.com', - description: `> 官方 Feed 地址为: [https://www.producthunt.com/feed](https://www.producthunt.com/feed)`, + description: '> 官方 Feed 地址为: [https://www.producthunt.com/feed](https://www.producthunt.com/feed)', lang: 'en', }; diff --git a/lib/routes/psyche/type.ts b/lib/routes/psyche/type.ts index 56c3ac7e9..a90775b70 100644 --- a/lib/routes/psyche/type.ts +++ b/lib/routes/psyche/type.ts @@ -26,7 +26,7 @@ export const route: Route = { name: 'Types', maintainers: ['emdoe'], handler, - description: `Supported types: Ideas, Guides, and Films.`, + description: 'Supported types: Ideas, Guides, and Films.', }; async function handler(ctx) { diff --git a/lib/routes/qingting/podcast.ts b/lib/routes/qingting/podcast.ts index 5bc02fddb..b99513f34 100644 --- a/lib/routes/qingting/podcast.ts +++ b/lib/routes/qingting/podcast.ts @@ -32,7 +32,7 @@ export const route: Route = { name: '播客', maintainers: ['RookieZoe', 'huyyi', 'pseudoyu'], handler, - description: `获取的播放 URL 有效期只有 1 天,需要开启播客 APP 的自动下载功能。`, + description: '获取的播放 URL 有效期只有 1 天,需要开启播客 APP 的自动下载功能。', }; function getMediaUrl(channelId: string, mediaId: string) { diff --git a/lib/routes/qlu/notice.ts b/lib/routes/qlu/notice.ts index 476efdc6e..cc2f6c8e5 100644 --- a/lib/routes/qlu/notice.ts +++ b/lib/routes/qlu/notice.ts @@ -68,7 +68,7 @@ async function handler() { ); return { - title: `齐鲁工业大学 - 通知公告`, + title: '齐鲁工业大学 - 通知公告', link: `${host}/tzggsh/list1.htm`, description: '齐鲁工业大学 - 通知公告', item: items, diff --git a/lib/routes/radio-canada/latest.ts b/lib/routes/radio-canada/latest.ts index f7b0776e0..c7f73c369 100644 --- a/lib/routes/radio-canada/latest.ts +++ b/lib/routes/radio-canada/latest.ts @@ -58,7 +58,7 @@ async function handler(ctx) { .text() .match(/window\._rcState_ = (.*);/)?.[1]; - item.description = rcState ? parseDescriptionFromState(rcState) : ($(`div[data-testid="newsStoryMedia"]`).html() ?? '') + ($('article > main').html() ?? ''); + item.description = rcState ? parseDescriptionFromState(rcState) : ($('div[data-testid="newsStoryMedia"]').html() ?? '') + ($('article > main').html() ?? ''); return item; }) diff --git a/lib/routes/reactiflux/transcripts.ts b/lib/routes/reactiflux/transcripts.ts index 5f2abf7a1..4044678a7 100644 --- a/lib/routes/reactiflux/transcripts.ts +++ b/lib/routes/reactiflux/transcripts.ts @@ -25,7 +25,7 @@ export async function handler(ctx) { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; const rootUrl = 'https://www.reactiflux.com'; - const currentUrl = new URL(`transcripts`, rootUrl).href; + const currentUrl = new URL('transcripts', rootUrl).href; const { data: response } = await got(currentUrl); diff --git a/lib/routes/ruankao/news.ts b/lib/routes/ruankao/news.ts index 679c775ec..623ac39ad 100644 --- a/lib/routes/ruankao/news.ts +++ b/lib/routes/ruankao/news.ts @@ -101,7 +101,7 @@ export const route: Route = { { title: '计算机职业技术资格考试(软考)动态', source: ['www.ruankao.org.cn/index/work', 'www.ruankao.org.cn'], - target: `/news`, + target: '/news', }, ], example: '/ruankao/news', diff --git a/lib/routes/rustcc/jobs.ts b/lib/routes/rustcc/jobs.ts index 02d50ef6d..d8dedc1f0 100644 --- a/lib/routes/rustcc/jobs.ts +++ b/lib/routes/rustcc/jobs.ts @@ -47,7 +47,7 @@ async function handler() { return { title: 'Rust语言中文社区 | 招聘', link: jobs_url, - description: `获取Rust语言中文社区的最新招聘`, + description: '获取Rust语言中文社区的最新招聘', item: await Promise.all(list.map((item) => getFeedItem(item))), }; } diff --git a/lib/routes/rustcc/news.ts b/lib/routes/rustcc/news.ts index 66a9f5892..c67cd925a 100644 --- a/lib/routes/rustcc/news.ts +++ b/lib/routes/rustcc/news.ts @@ -38,7 +38,7 @@ async function handler() { return { title: 'Rust语言中文社区 | 新闻/聚合', link: newsUrl, - description: `获取Rust语言中文社区的新闻/聚合`, + description: '获取Rust语言中文社区的新闻/聚合', item: list.map((item) => getFeedItem(item)), }; } diff --git a/lib/routes/saraba1st/digest.tsx b/lib/routes/saraba1st/digest.tsx index f208e21e3..027ba7405 100644 --- a/lib/routes/saraba1st/digest.tsx +++ b/lib/routes/saraba1st/digest.tsx @@ -25,7 +25,7 @@ export const route: Route = { name: '论坛摘要', maintainers: ['shinemoon'], handler, - description: `版面网址如果为 \`https://stage1st.com/2b/forum-6-1.html\` 那么论坛 id 就是 \`forum-6-1\`。`, + description: '版面网址如果为 `https://stage1st.com/2b/forum-6-1.html` 那么论坛 id 就是 `forum-6-1`。', }; async function handler(ctx) { diff --git a/lib/routes/saraba1st/thread.ts b/lib/routes/saraba1st/thread.ts index 80390852e..58cf2504a 100644 --- a/lib/routes/saraba1st/thread.ts +++ b/lib/routes/saraba1st/thread.ts @@ -23,7 +23,7 @@ export const route: Route = { name: '帖子', maintainers: ['zengxs'], handler, - description: `帖子网址如果为 \`https://stage1st.com/2b/thread-751272-1-1.html\` 那么帖子 id 就是 \`751272\`。`, + description: '帖子网址如果为 `https://stage1st.com/2b/thread-751272-1-1.html` 那么帖子 id 就是 `751272`。', }; async function handler(ctx) { diff --git a/lib/routes/science/early.ts b/lib/routes/science/early.ts index 5cc20e2e8..ed3365602 100644 --- a/lib/routes/science/early.ts +++ b/lib/routes/science/early.ts @@ -29,7 +29,7 @@ export const route: Route = { name: 'First Release', maintainers: ['y9c', 'TonyRL'], handler, - description: `*only Science, Science Immunology and Science Translational Medicine have first release*`, + description: '*only Science, Science Immunology and Science Translational Medicine have first release*', }; async function handler(ctx) { diff --git a/lib/routes/scu/scupi/notice.ts b/lib/routes/scu/scupi/notice.ts index 73c7b55ca..c38f53ce7 100644 --- a/lib/routes/scu/scupi/notice.ts +++ b/lib/routes/scu/scupi/notice.ts @@ -22,7 +22,7 @@ export const route: Route = { maintainers: ['sitdownkevin'], url: 'scupi.scu.edu.cn/activities/notice', handler, - description: ``, + description: '', }; async function handler() { diff --git a/lib/routes/sega/pjsekai.ts b/lib/routes/sega/pjsekai.ts index 3bcf37660..01abdc65f 100644 --- a/lib/routes/sega/pjsekai.ts +++ b/lib/routes/sega/pjsekai.ts @@ -31,7 +31,7 @@ export const route: Route = { async function handler() { // 从仓库 Sekai-World/sekai-master-db-diff 获取最新公告 - const response = await got.get(`https://cdn.jsdelivr.net/gh/Sekai-World/sekai-master-db-diff@master/userInformations.json`); + const response = await got.get('https://cdn.jsdelivr.net/gh/Sekai-World/sekai-master-db-diff@master/userInformations.json'); const posts = response.data || []; const list = await Promise.all( posts.map(async (post) => { diff --git a/lib/routes/shmeea/namespace.ts b/lib/routes/shmeea/namespace.ts index 7c68c3050..b65500901 100644 --- a/lib/routes/shmeea/namespace.ts +++ b/lib/routes/shmeea/namespace.ts @@ -3,6 +3,6 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: '上海市教育考试院', url: 'www.shmeea.edu.cn', - description: `官方网址:[https://www.shmeea.edu.cn](https://www.shmeea.edu.cn)`, + description: '官方网址:[https://www.shmeea.edu.cn](https://www.shmeea.edu.cn)', lang: 'zh-CN', }; diff --git a/lib/routes/shopify/apps/search.ts b/lib/routes/shopify/apps/search.ts index 9aa4378a4..90c0e51e1 100644 --- a/lib/routes/shopify/apps/search.ts +++ b/lib/routes/shopify/apps/search.ts @@ -58,7 +58,7 @@ async function handler(ctx: Context): Promise { .match(/\d\.\d/); const rattingCountMatch = appInfo.find('span + span.tw-sr-only').text().match(/\d+/); - const description = $(item).find(`div.tw-text-fg-secondary:not(.tw-mb-md)`).eq(1).text().trim(); + const description = $(item).find('div.tw-text-fg-secondary:not(.tw-mb-md)').eq(1).text().trim(); const result: DataItem = { title: $(item).attr('data-app-card-name-value') ?? '', @@ -68,7 +68,7 @@ async function handler(ctx: Context): Promise { _extra: { handle, description, - built_for_shopify: $(item).find(`span.built-for-shopify-badge`).length > 0, + built_for_shopify: $(item).find('span.built-for-shopify-badge').length > 0, ratting: rattingMatch ? Number.parseFloat(rattingMatch[0]) : 0, ratting_count: rattingCountMatch ? Number(rattingCountMatch[0]) : 0, }, diff --git a/lib/routes/sicau/jk.ts b/lib/routes/sicau/jk.ts index 44bf78476..631f48b28 100644 --- a/lib/routes/sicau/jk.ts +++ b/lib/routes/sicau/jk.ts @@ -83,7 +83,7 @@ export const route: Route = { method: 'post', }); const query = async (page: number) => - await $post(`/getUserSchoolActList`, { + await $post('/getUserSchoolActList', { query: { gid: gidDict[gid], typeId: typeDict[typeId], diff --git a/lib/routes/smzdm/keyword.ts b/lib/routes/smzdm/keyword.ts index c54c84f56..efc2b825b 100644 --- a/lib/routes/smzdm/keyword.ts +++ b/lib/routes/smzdm/keyword.ts @@ -41,7 +41,7 @@ async function handler(ctx) { const keyword = ctx.req.param('keyword'); - const response = await got(`https://search.smzdm.com`, { + const response = await got('https://search.smzdm.com', { headers: { ...getHeaders(), Referer: `https://search.smzdm.com/?c=home&s=${encodeURIComponent(keyword)}&order=time&v=a`, diff --git a/lib/routes/smzdm/ranking.ts b/lib/routes/smzdm/ranking.ts index f801f2251..2f846ffcf 100644 --- a/lib/routes/smzdm/ranking.ts +++ b/lib/routes/smzdm/ranking.ts @@ -231,7 +231,7 @@ async function handler(ctx) { // When the hour is 3, some special rank_id require a special hour num const true_hour = getTrueHour(rank_type, rank_id, hour); - const response = await got(`https://www.smzdm.com/top/json_more`, { + const response = await got('https://www.smzdm.com/top/json_more', { headers: { Referer: 'https://www.smzdm.com/top', ...getHeaders(), diff --git a/lib/routes/solidot/_article.ts b/lib/routes/solidot/_article.ts index 341db83b3..827570f18 100644 --- a/lib/routes/solidot/_article.ts +++ b/lib/routes/solidot/_article.ts @@ -33,11 +33,11 @@ export default async function get_article(url) { $('div.talk_time').remove(); const description = $('div.block_m') .html() - .replaceAll(/(href.*?)(.*?)<\/u>/g, `$1$2`) + .replaceAll(/(href.*?)(.*?)<\/u>/g, '$1$2') .replaceAll('href="/', 'href="' + domain + '/') // Preserve the not extremely disturbing donation ad // to support the site. - .replaceAll(/()/g, `

    $1`); + .replaceAll(/()/g, '

    $1'); const item = { title, diff --git a/lib/routes/southcn/nfapp/column.ts b/lib/routes/southcn/nfapp/column.ts index 853488f28..b8858a9b3 100644 --- a/lib/routes/southcn/nfapp/column.ts +++ b/lib/routes/southcn/nfapp/column.ts @@ -37,7 +37,7 @@ async function handler(ctx) { const getColumnDetail = `https://api.nfapp.southcn.com/nanfang_if/getColumn?columnId=${columnId}`; const { data: responseColumn } = await got(getColumnDetail); - const columnName = responseColumn.columnName === '' ? `南方+` : `南方+ - ${responseColumn.columnName}`; + const columnName = responseColumn.columnName === '' ? '南方+' : `南方+ - ${responseColumn.columnName}`; const columnLink = responseColumn.linkUrl === '' ? `https://m.nfapp.southcn.com/${columnId}` : responseColumn.linkUrl; /* Notes of columnLink: diff --git a/lib/routes/southcn/nfapp/reporter.ts b/lib/routes/southcn/nfapp/reporter.ts index 2a740f01e..b283af4ea 100644 --- a/lib/routes/southcn/nfapp/reporter.ts +++ b/lib/routes/southcn/nfapp/reporter.ts @@ -23,7 +23,7 @@ export const route: Route = { name: '南方 +(按作者)', maintainers: ['TimWu007'], handler, - description: `作者的 UUID 只可通过 \`static.nfapp.southcn.com\` 下的文章页面获取。点击文章下方的作者介绍,进入该作者的个人主页,即可从 url 中获取。`, + description: '作者的 UUID 只可通过 `static.nfapp.southcn.com` 下的文章页面获取。点击文章下方的作者介绍,进入该作者的个人主页,即可从 url 中获取。', }; async function handler(ctx) { diff --git a/lib/routes/spotify/artists-top.ts b/lib/routes/spotify/artists-top.ts index e0d19559b..b7ad27551 100644 --- a/lib/routes/spotify/artists-top.ts +++ b/lib/routes/spotify/artists-top.ts @@ -42,7 +42,7 @@ export const route: Route = { async function handler() { const token = await utils.getPrivateToken(); - const itemsResponse = await ofetch(`https://api.spotify.com/v1/me/top/artists`, { + const itemsResponse = await ofetch('https://api.spotify.com/v1/me/top/artists', { method: 'GET', headers: { Authorization: `Bearer ${token}`, @@ -51,7 +51,7 @@ async function handler() { const items = itemsResponse.items; return { - title: `Spotify: My Top Artists`, + title: 'Spotify: My Top Artists', allowEmpty: true, item: items.map((element) => utils.parseArtist(element)), }; diff --git a/lib/routes/spotify/tracks-top.ts b/lib/routes/spotify/tracks-top.ts index 3cf106712..c311925e1 100644 --- a/lib/routes/spotify/tracks-top.ts +++ b/lib/routes/spotify/tracks-top.ts @@ -42,7 +42,7 @@ export const route: Route = { async function handler() { const token = await utils.getPrivateToken(); - const itemsResponse = await ofetch(`https://api.spotify.com/v1/me/top/tracks`, { + const itemsResponse = await ofetch('https://api.spotify.com/v1/me/top/tracks', { method: 'GET', headers: { Authorization: `Bearer ${token}`, @@ -51,7 +51,7 @@ async function handler() { const items = itemsResponse.items; return { - title: `Spotify: My Top Tracks`, + title: 'Spotify: My Top Tracks', allowEmpty: true, item: items.map((element) => utils.parseTrack(element)), }; diff --git a/lib/routes/sse/renewal.tsx b/lib/routes/sse/renewal.tsx index be4e0d3ec..1268e09b0 100644 --- a/lib/routes/sse/renewal.tsx +++ b/lib/routes/sse/renewal.tsx @@ -38,7 +38,7 @@ export const route: Route = { async function handler() { const pageUrl = 'https://kcb.sse.com.cn/renewal/'; - const host = `https://kcb.sse.com.cn`; + const host = 'https://kcb.sse.com.cn'; const response = await got('https://query.sse.com.cn/statusAction.do', { searchParams: { diff --git a/lib/routes/ssm/news.tsx b/lib/routes/ssm/news.tsx index 23b74638b..d74a7aa71 100644 --- a/lib/routes/ssm/news.tsx +++ b/lib/routes/ssm/news.tsx @@ -5,7 +5,7 @@ import type { Route } from '@/types'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -const rootUrl = `https://www.ssm.gov.mo`; +const rootUrl = 'https://www.ssm.gov.mo'; const newsUrl = `${rootUrl}/apps1/content/ch/973/itemlist.aspx?defaultcss=false&dlimit=20&showdate=true&dorder=cridate%20desc,displaydate%20desc&withattach=true`; export const route: Route = { diff --git a/lib/routes/sspai/series.ts b/lib/routes/sspai/series.ts index ddc4d00f7..947287163 100644 --- a/lib/routes/sspai/series.ts +++ b/lib/routes/sspai/series.ts @@ -26,7 +26,7 @@ export const route: Route = { maintainers: ['HenryQW'], handler, url: 'sspai.com/series', - description: `> 少数派专栏需要付费订阅,RSS 仅做更新提醒,不含付费内容.`, + description: '> 少数派专栏需要付费订阅,RSS 仅做更新提醒,不含付费内容.', }; async function handler() { diff --git a/lib/routes/sspai/topics.ts b/lib/routes/sspai/topics.ts index a7744c6e4..b034ba813 100644 --- a/lib/routes/sspai/topics.ts +++ b/lib/routes/sspai/topics.ts @@ -25,11 +25,11 @@ export const route: Route = { maintainers: ['SunShinenny'], handler, url: 'sspai.com/topics', - description: `此为专题广场更新提示 => 集合型而非单篇文章。与下方 "专题内文章更新" 存在明显区别!`, + description: '此为专题广场更新提示 => 集合型而非单篇文章。与下方 "专题内文章更新" 存在明显区别!', }; async function handler() { - const api_url = `https://sspai.com/api/v1/topics?offset=0&limit=20&include_total=false`; + const api_url = 'https://sspai.com/api/v1/topics?offset=0&limit=20&include_total=false'; const resp = await got({ method: 'get', url: api_url, @@ -56,9 +56,9 @@ async function handler() { ); return { - title: `少数派专题广场更新推送`, - link: `https://sspai.com/topics`, - description: `仅仅推送新的专题(集合型而非具体文章) `, + title: '少数派专题广场更新推送', + link: 'https://sspai.com/topics', + description: '仅仅推送新的专题(集合型而非具体文章) ', item: items, }; } diff --git a/lib/routes/stcn/rank.ts b/lib/routes/stcn/rank.ts index 9ad5abc95..313a58452 100644 --- a/lib/routes/stcn/rank.ts +++ b/lib/routes/stcn/rank.ts @@ -15,7 +15,7 @@ export const handler = async (ctx: Context): Promise => { const baseUrl = 'https://www.stcn.com'; const targetUrl: string = new URL(`article/list/${id}.html`, baseUrl).href; - const apiUrl: string = new URL(`article/category-news-rank.html`, baseUrl).href; + const apiUrl: string = new URL('article/category-news-rank.html', baseUrl).href; const response = await ofetch(apiUrl, { headers: { diff --git a/lib/routes/storm/channel.ts b/lib/routes/storm/channel.ts index 1eda985a8..f03878b97 100644 --- a/lib/routes/storm/channel.ts +++ b/lib/routes/storm/channel.ts @@ -32,7 +32,7 @@ async function handler(ctx) { const id = ctx.req.param('id') ?? '2'; const rootUrl = 'https://www.storm.mg'; - const currentUrl = new URL(`/api/getArticleList`, rootUrl).href; + const currentUrl = new URL('/api/getArticleList', rootUrl).href; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; const response = await ofetch(currentUrl, { diff --git a/lib/routes/sustainabilitymag/articles.ts b/lib/routes/sustainabilitymag/articles.ts index 0b292f55e..4b07d9166 100644 --- a/lib/routes/sustainabilitymag/articles.ts +++ b/lib/routes/sustainabilitymag/articles.ts @@ -64,7 +64,7 @@ const render = (widgets) => .join(''); async function handler() { - const baseURL = `https://sustainabilitymag.com`; + const baseURL = 'https://sustainabilitymag.com'; const feedURL = `${baseURL}/articles`; const feedLang = 'en'; const feedDescription = 'Sustainability Magazine Articles'; diff --git a/lib/routes/swjtu/gsee/yjs.ts b/lib/routes/swjtu/gsee/yjs.ts index 290891fc7..5e2bd3fea 100644 --- a/lib/routes/swjtu/gsee/yjs.ts +++ b/lib/routes/swjtu/gsee/yjs.ts @@ -52,7 +52,7 @@ export const route: Route = { name: '地球科学与工程学院', maintainers: ['E1nzbern'], handler, - description: `研究生教育通知公告`, + description: '研究生教育通知公告', }; async function handler() { diff --git a/lib/routes/swjtu/jtys/yjs.ts b/lib/routes/swjtu/jtys/yjs.ts index 9093865df..b68fe24c2 100644 --- a/lib/routes/swjtu/jtys/yjs.ts +++ b/lib/routes/swjtu/jtys/yjs.ts @@ -49,7 +49,7 @@ export const route: Route = { name: '交通运输与物流学院', maintainers: ['qizidog'], handler, - description: `#### 研究生通知 {#xi-nan-jiao-tong-da-xue-jiao-tong-yun-shu-yu-wu-liu-xue-yuan-yan-jiu-sheng-tong-zhi}`, + description: '#### 研究生通知 {#xi-nan-jiao-tong-da-xue-jiao-tong-yun-shu-yu-wu-liu-xue-yuan-yan-jiu-sheng-tong-zhi}', }; async function handler() { diff --git a/lib/routes/sysu/cse.ts b/lib/routes/sysu/cse.ts index 8512d45cd..ae61712ba 100644 --- a/lib/routes/sysu/cse.ts +++ b/lib/routes/sysu/cse.ts @@ -32,7 +32,7 @@ async function handler() { method: 'get', url: 'http://cse.sysu.edu.cn/', headers: { - Referer: `http://cse.sysu.edu.cn/`, + Referer: 'http://cse.sysu.edu.cn/', }, }); const $ = load(response.data); @@ -120,10 +120,10 @@ async function handler() { // console.log(item_data); return { - title: `中山大学 - 数据科学与计算机学院`, - link: `http://cse.sysu.edu.cn`, - description: `中山大学 - 数据科学与计算机学院`, - language: `zh-cn`, + title: '中山大学 - 数据科学与计算机学院', + link: 'http://cse.sysu.edu.cn', + description: '中山大学 - 数据科学与计算机学院', + language: 'zh-cn', item: item_data, }; } diff --git a/lib/routes/telegram/stories.ts b/lib/routes/telegram/stories.ts index 14468315a..2d4fa44ef 100644 --- a/lib/routes/telegram/stories.ts +++ b/lib/routes/telegram/stories.ts @@ -62,7 +62,7 @@ export const route: Route = { name: 'Stories', maintainers: ['synchrone'], handler, - description: ``, + description: '', }; function getMediaAreas(mediaAreas?: Api.TypeMediaArea[]) { diff --git a/lib/routes/tencent/cloud/developer/column.ts b/lib/routes/tencent/cloud/developer/column.ts index 182f8c04d..9d2b6d4bf 100644 --- a/lib/routes/tencent/cloud/developer/column.ts +++ b/lib/routes/tencent/cloud/developer/column.ts @@ -20,7 +20,7 @@ export const route: Route = { maintainers: ['lyling'], handler: async (ctx) => { const categoryId = ctx.req.param('categoryId') ?? 0; - const link = `https://cloud.tencent.com/developer/api/home/article-list`; + const link = 'https://cloud.tencent.com/developer/api/home/article-list'; const response = await ofetch(link, { method: 'POST', headers: { diff --git a/lib/routes/tencent/pvp/newsindex.ts b/lib/routes/tencent/pvp/newsindex.ts index c23d03ad0..9698f3063 100644 --- a/lib/routes/tencent/pvp/newsindex.ts +++ b/lib/routes/tencent/pvp/newsindex.ts @@ -13,7 +13,7 @@ const map = new Map([ ]); const link = 'https://pvp.qq.com/web201706/newsindex.shtml'; const apiUrl = 'https://apps.game.qq.com/wmp/v3.1/?p0=18&p1=searchNewsKeywordsList&order=sIdxTime&r0=cors&type=iTarget&source=app_news_search&pagesize=12&page=1&id='; -const pageUrl = `https://pvp.qq.com/web201706/newsdetail.shtml?tid=`; +const pageUrl = 'https://pvp.qq.com/web201706/newsdetail.shtml?tid='; const getPage = async (id, typeName) => { const response = await got(apiUrl + id, { @@ -83,7 +83,8 @@ async function handler(ctx) { return { title: `【${OutName}】 - 王者荣耀 - 新闻列表`, link, - description: `《王者荣耀》是腾讯天美工作室历时3年推出的东方英雄即时对战手游大作,抗塔强杀、团灭超神,领略爽热血竞技的酣畅淋漓!1v1、3v3、闯关等丰富游戏模式,随时战,更自由!跨服匹配秒开局,好友组队战排位,不靠装备、没有等级,更公平、更爽快的无差异对战!`, + description: + '《王者荣耀》是腾讯天美工作室历时3年推出的东方英雄即时对战手游大作,抗塔强杀、团灭超神,领略爽热血竞技的酣畅淋漓!1v1、3v3、闯关等丰富游戏模式,随时战,更自由!跨服匹配秒开局,好友组队战排位,不靠装备、没有等级,更公平、更爽快的无差异对战!', item, }; } diff --git a/lib/routes/test/index.ts b/lib/routes/test/index.ts index 7555c6148..37294182c 100644 --- a/lib/routes/test/index.ts +++ b/lib/routes/test/index.ts @@ -48,25 +48,25 @@ async function handler(ctx) { { title: 'Filter Title1', description: 'Description1', - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/-1`, - author: `DIYgod0`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/-1', + author: 'DIYgod0', category: ['Category0', 'Category1'], }, { title: 'Filter Title2', description: 'Description2', - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/0`, - author: `DIYgod0`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/0', + author: 'DIYgod0', category: ['Category0', 'Category1', 'Category2'], }, { title: 'Filter Title3', description: 'Description3', - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/1`, - author: `DIYgod0`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/1', + author: 'DIYgod0', category: 'Category3', }, ]; @@ -77,9 +77,9 @@ async function handler(ctx) { item.push({ title: 'TitleIllegal', description: 'DescriptionIllegal', - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/1`, - author: `DIYgod0`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/1', + author: 'DIYgod0', category: [1, 'CategoryIllegal', true, null, undefined, { type: 'object' }], }); @@ -87,11 +87,11 @@ async function handler(ctx) { case 'long': item.push({ - title: `Long Title `.repeat(50), - description: `Long Description `.repeat(10), - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/0`, - author: `DIYgod0`, + title: 'Long Title '.repeat(50), + description: 'Long Description '.repeat(10), + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/0', + author: 'DIYgod0', }); break; @@ -103,9 +103,9 @@ async function handler(ctx) { item.push({ title: 'Cache Title', description: description.text, - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/0`, - author: `DIYgod0`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/0', + author: 'DIYgod0', }); break; @@ -124,9 +124,9 @@ async function handler(ctx) { item.push({ title: 'Cache Title', description: refresh + ' ' + noRefresh, - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/0`, - author: `DIYgod0`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/0', + author: 'DIYgod0', }); break; @@ -142,9 +142,9 @@ async function handler(ctx) { item.push({ title: 'Cache Title', description: description.text, - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/0`, - author: `DIYgod0`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/0', + author: 'DIYgod0', }); break; @@ -153,7 +153,7 @@ async function handler(ctx) { image = 'https://mock.com/DIYgod/RSSHub.png'; item.push( { - title: `Complicated Title`, + title: 'Complicated Title', description: ` @@ -165,38 +165,38 @@ async function handler(ctx) { `, - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `//mock.com/DIYgod/RSSHub`, - author: `DIYgod`, + pubDate: new Date('2019-3-1').toUTCString(), + link: '//mock.com/DIYgod/RSSHub', + author: 'DIYgod', }, { - title: `Complicated Title`, + title: 'Complicated Title', description: ` `, - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://mock.com/DIYgod/RSSHub`, - author: `DIYgod`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://mock.com/DIYgod/RSSHub', + author: 'DIYgod', }, { - title: `Complicated Title`, + title: 'Complicated Title', description: ` `, - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `//mock.com/DIYgod/RSSHub`, - author: `DIYgod`, + pubDate: new Date('2019-3-1').toUTCString(), + link: '//mock.com/DIYgod/RSSHub', + author: 'DIYgod', enclosure_url: 'https://mock.com/DIYgod/RSSHub.png', enclosure_type: 'image/png', itunes_item_image: 'https://mock.com/DIYgod/RSSHub.gif', }, { - title: `Complicated Title`, + title: 'Complicated Title', description: ` `, - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `//mock.com/DIYgod/RSSHub`, - author: `DIYgod`, + pubDate: new Date('2019-3-1').toUTCString(), + link: '//mock.com/DIYgod/RSSHub', + author: 'DIYgod', image: 'https://mock.com/DIYgod/RSSHub.jpg', } ); @@ -206,7 +206,7 @@ async function handler(ctx) { case 'multimedia': item.push( { - title: `Multimedia Title`, + title: 'Multimedia Title', description: ` `, - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://mock.com/DIYgod/RSSHub`, - author: `DIYgod`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://mock.com/DIYgod/RSSHub', + author: 'DIYgod', }, { - title: `Multimedia Title`, + title: 'Multimedia Title', description: ` `, - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://mock.com/DIYgod/RSSHub`, - author: `DIYgod`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://mock.com/DIYgod/RSSHub', + author: 'DIYgod', enclosure_url: 'https://mock.com/DIYgod/RSSHub.mp4', enclosure_type: 'video/mp4', } @@ -236,26 +236,26 @@ async function handler(ctx) { case 'sort': item.push( { - title: `Sort Title 0`, - link: `https://github.com/DIYgod/RSSHub/issues/s1`, - author: `DIYgod0`, + title: 'Sort Title 0', + link: 'https://github.com/DIYgod/RSSHub/issues/s1', + author: 'DIYgod0', }, { - title: `Sort Title 1`, - link: `https://github.com/DIYgod/RSSHub/issues/s1`, - author: `DIYgod0`, + title: 'Sort Title 1', + link: 'https://github.com/DIYgod/RSSHub/issues/s1', + author: 'DIYgod0', }, { - title: `Sort Title 2`, - link: `https://github.com/DIYgod/RSSHub/issues/s2`, + title: 'Sort Title 2', + link: 'https://github.com/DIYgod/RSSHub/issues/s2', pubDate: new Date(1_546_272_000_000 - 10 * 10 * 1000).toUTCString(), - author: `DIYgod0`, + author: 'DIYgod0', }, { - title: `Sort Title 3`, - link: `https://github.com/DIYgod/RSSHub/issues/s3`, + title: 'Sort Title 3', + link: 'https://github.com/DIYgod/RSSHub/issues/s3', pubDate: new Date(1_546_272_000_000).toUTCString(), - author: `DIYgod0`, + author: 'DIYgod0', } ); @@ -263,10 +263,10 @@ async function handler(ctx) { case 'mess': item.push({ - title: `Mess Title`, - link: `/DIYgod/RSSHub/issues/0`, + title: 'Mess Title', + link: '/DIYgod/RSSHub/issues/0', pubDate: 1_546_272_000_000, - author: `DIYgod0`, + author: 'DIYgod0', }); break; @@ -275,9 +275,9 @@ async function handler(ctx) { item.push({ title: '小可愛', description: '宇宙無敵', - link: `/DIYgod/RSSHub/issues/0`, + link: '/DIYgod/RSSHub/issues/0', pubDate: new Date(1_546_272_000_000).toUTCString(), - author: `DIYgod0`, + author: 'DIYgod0', }); break; @@ -286,9 +286,9 @@ async function handler(ctx) { item.push({ title: '小可愛', description: '

    宇宙無敵


    '.repeat(1000), - link: `/DIYgod/RSSHub/issues/0`, + link: '/DIYgod/RSSHub/issues/0', pubDate: new Date(1_546_272_000_000).toUTCString(), - author: `DIYgod0`, + author: 'DIYgod0', }); break; @@ -297,23 +297,23 @@ async function handler(ctx) { item.push( { title: 'Title0', - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/-3`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/-3', }, { title: 'Title1', description: 'Description1', - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/-2`, - author: `DIYgod0 `, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/-2', + author: 'DIYgod0 ', category: 'Category0', }, { title: 'Title2 HTML in description', description: 'RSSHub', - pubDate: new Date(`2019-3-1`).toUTCString(), - updated: new Date(`2019-3-2`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/-1`, + pubDate: new Date('2019-3-1').toUTCString(), + updated: new Date('2019-3-2').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/-1', author: [{ name: ' DIYgod1' }, { name: 'DIYgod2 ' }], category: ['Category0', 'Category1'], }, @@ -322,9 +322,9 @@ async function handler(ctx) { content: { html: 'DIYgod/RSSHub', }, - pubDate: new Date(`2019-3-1`).toUTCString(), - updated: new Date(`2019-3-2`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/issues/0`, + pubDate: new Date('2019-3-1').toUTCString(), + updated: new Date('2019-3-2').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/issues/0', author: [{ name: ' DIYgod3' }, { name: 'DIYgod4 ' }, { name: 'DIYgod5 ' }], category: ['Category1'], enclosure_url: 'https://github.com/DIYgod/RSSHub/issues/0', @@ -334,8 +334,8 @@ async function handler(ctx) { }, { title: 'Title4 author is null', - pubDate: new Date(`2019-3-1`).toUTCString(), - link: `https://github.com/DIYgod/RSSHub/pull/11555`, + pubDate: new Date('2019-3-1').toUTCString(), + link: 'https://github.com/DIYgod/RSSHub/pull/11555', author: null, } ); @@ -346,7 +346,7 @@ async function handler(ctx) { item.push({ title: 'Title0', description: 'Description0', - pubDate: new Date(`2019-3-1`).toUTCString(), + pubDate: new Date('2019-3-1').toUTCString(), link: 'https://github.com/DIYgod/RSSHub/issues/0', }); diff --git a/lib/routes/theblockbeats/index.tsx b/lib/routes/theblockbeats/index.tsx index c2c570f6f..861be0e3f 100644 --- a/lib/routes/theblockbeats/index.tsx +++ b/lib/routes/theblockbeats/index.tsx @@ -10,7 +10,7 @@ import { parseDate } from '@/utils/parse-date'; const domain = 'theblockbeats.info'; const rootUrl = `https://www.${domain}`; -const apiBase = `https://api.blockbeats.cn`; +const apiBase = 'https://api.blockbeats.cn'; const render = (data: { image?: string; description?: string }) => { const html = renderToString(); diff --git a/lib/routes/thecover/channel.ts b/lib/routes/thecover/channel.ts index 9d3dfe39d..039658fbb 100644 --- a/lib/routes/thecover/channel.ts +++ b/lib/routes/thecover/channel.ts @@ -82,7 +82,8 @@ async function handler(ctx) { return { title: `${nodes[id]}-封面新闻`, link: targetUrl, - description: `封面新闻作为华西都市报深度融合转型和打造新型主流媒体的载体,牢固确立移动优先战略,创新移动新闻产品,打造移动传播矩阵,封面新闻的传播力、引导力、影响力和公信力不断得到各方肯定。封面新闻突破千万的用户下载量,呈现出以四川为主阵地的全国分布态势,用户年龄构成以20-35岁为主,“亿万年轻人的生活方式”的定位初步得到体现。`, + description: + '封面新闻作为华西都市报深度融合转型和打造新型主流媒体的载体,牢固确立移动优先战略,创新移动新闻产品,打造移动传播矩阵,封面新闻的传播力、引导力、影响力和公信力不断得到各方肯定。封面新闻突破千万的用户下载量,呈现出以四川为主阵地的全国分布态势,用户年龄构成以20-35岁为主,“亿万年轻人的生活方式”的定位初步得到体现。', language: 'zh-cn', item: items, }; diff --git a/lib/routes/thepaper/namespace.ts b/lib/routes/thepaper/namespace.ts index a0cda4243..36c7e447d 100644 --- a/lib/routes/thepaper/namespace.ts +++ b/lib/routes/thepaper/namespace.ts @@ -3,6 +3,6 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: '澎湃新闻', url: 'thepaper.cn', - description: `以下所有路由可使用参数\`old\`以采取旧全文获取方法。该方法会另外获取网页中的图片与视频资源。在原始 url 追加\`?old=yes\`以启用.`, + description: '以下所有路由可使用参数`old`以采取旧全文获取方法。该方法会另外获取网页中的图片与视频资源。在原始 url 追加`?old=yes`以启用.', lang: 'zh-CN', }; diff --git a/lib/routes/thwiki/index.ts b/lib/routes/thwiki/index.ts index 7f0f6e072..3f89be1b5 100644 --- a/lib/routes/thwiki/index.ts +++ b/lib/routes/thwiki/index.ts @@ -45,7 +45,7 @@ async function handler(ctx) { return { title: 'Touhou events calendar (THBWiki)', - link: `https://calendar.thwiki.cc/`, + link: 'https://calendar.thwiki.cc/', description: 'A Touhou related events calendar api from THBWiki', item: data.map((item) => ({ title: item.title, diff --git a/lib/routes/tingshuitz/shenzhen.tsx b/lib/routes/tingshuitz/shenzhen.tsx index 3e3420a3d..735f2355f 100644 --- a/lib/routes/tingshuitz/shenzhen.tsx +++ b/lib/routes/tingshuitz/shenzhen.tsx @@ -27,7 +27,7 @@ export const route: Route = { maintainers: ['lilPiper'], handler, url: 'sz-water.com.cn/*', - description: `可能仅限中国大陆服务器访问,以实际情况为准。`, + description: '可能仅限中国大陆服务器访问,以实际情况为准。', }; async function handler() { diff --git a/lib/routes/toranoana/news.ts b/lib/routes/toranoana/news.ts index 9c60d77f0..e340331f9 100644 --- a/lib/routes/toranoana/news.ts +++ b/lib/routes/toranoana/news.ts @@ -61,7 +61,7 @@ async function handler(ctx): Promise { } } else { // exclude category-joshi to get result of general - apiUrl += `?categories_exclude=1598`; + apiUrl += '?categories_exclude=1598'; } const posts = await ofetch(apiUrl, { diff --git a/lib/routes/toutiao/a-bogus.ts b/lib/routes/toutiao/a-bogus.ts index 33f2353e7..e3b916232 100644 --- a/lib/routes/toutiao/a-bogus.ts +++ b/lib/routes/toutiao/a-bogus.ts @@ -304,7 +304,7 @@ function generate_rc4_bb_str(url_search_params, user_agent, window_env_str, suff // 对后缀两次sm3之的结果 const cus = sm3.sum(sm3.sum(suffix)); // 对ua处理之后的结果 - const ua = sm3.sum(result_encrypt(rc4_encrypt(user_agent, Reflect.apply(String.fromCharCode, null, [0.003_906_25, 1, 14])), 's3')); + const ua = sm3.sum(result_encrypt(rc4_encrypt(user_agent, Reflect.apply(String.fromCodePoint, null, [0.003_906_25, 1, 14])), 's3')); // const end_time = Date.now(); // b @@ -524,7 +524,7 @@ function generate_rc4_bb_str(url_search_params, user_agent, window_env_str, suff b[71], ]; bb = bb.concat(window_env_list).concat(b[72]); - return rc4_encrypt(String.fromCharCode.apply(null, bb), Reflect.apply(String.fromCharCode, null, [121])); + return rc4_encrypt(String.fromCodePoint.apply(null, bb), Reflect.apply(String.fromCodePoint, null, [121])); } function generate_random_str() { @@ -532,7 +532,7 @@ function generate_random_str() { random_str_list = random_str_list.concat(gener_random(Math.random() * 10000, [3, 45])); random_str_list = random_str_list.concat(gener_random(Math.random() * 10000, [1, 0])); random_str_list = random_str_list.concat(gener_random(Math.random() * 10000, [1, 5])); - return String.fromCharCode.apply(null, random_str_list); + return String.fromCodePoint.apply(null, random_str_list); } export function generate_a_bogus(url_search_params, user_agent) { diff --git a/lib/routes/trow/portal.ts b/lib/routes/trow/portal.ts index c814477d3..d01921d3d 100644 --- a/lib/routes/trow/portal.ts +++ b/lib/routes/trow/portal.ts @@ -32,11 +32,11 @@ export const route: Route = { async function handler() { let data; const response = await got.extend({ followRedirect: false }).get({ - url: `https://trow.cc`, + url: 'https://trow.cc', }); if (response.statusCode === 302) { const response2 = await got.extend({ followRedirect: false }).get({ - url: `https://trow.cc`, + url: 'https://trow.cc', headers: { cookie: response.headers['set-cookie'], }, @@ -50,9 +50,9 @@ async function handler() { const list = $('#portal_content .borderwrap[style="display:show"]'); return { - title: `The Ring of Wonder - Portal`, - link: `https://trow.cc`, - description: `The Ring of Wonder 首页更新`, + title: 'The Ring of Wonder - Portal', + link: 'https://trow.cc', + description: 'The Ring of Wonder 首页更新', item: list.toArray().map((item) => { item = $(item); const dateraw = item.find('.postdetails').text(); diff --git a/lib/routes/tumblr/utils.ts b/lib/routes/tumblr/utils.ts index b04dd104f..50c4eeb68 100644 --- a/lib/routes/tumblr/utils.ts +++ b/lib/routes/tumblr/utils.ts @@ -107,7 +107,7 @@ if (config.tumblr && config.tumblr.clientId && config.tumblr.clientSecret && con // We may be able to restore the new token if the app is restarted. This will avoid reusing the old token and have a failing request. // Keep it for a year (not clear how long the refresh token lasts). const cacheEntry = { startToken: config.tumblr.refreshToken, currentToken: newRefreshToken }; - await cache.set(`tumblr:refreshToken`, JSON.stringify(cacheEntry), 31_536_000); + await cache.set('tumblr:refreshToken', JSON.stringify(cacheEntry), 31_536_000); return accessToken; }; diff --git a/lib/routes/twitch/schedule.ts b/lib/routes/twitch/schedule.ts index daad1d2f0..7afc493a4 100644 --- a/lib/routes/twitch/schedule.ts +++ b/lib/routes/twitch/schedule.ts @@ -77,7 +77,7 @@ async function handler(ctx) { const streamScheduleData = response.data[1].data; if (!streamScheduleData.user.id) { - throw new InvalidParameterError(`Username does not exist`); + throw new InvalidParameterError('Username does not exist'); } const displayName = channelShellData.userOrError.displayName; diff --git a/lib/routes/twitch/video.ts b/lib/routes/twitch/video.ts index ef3be9eeb..0e7efb970 100644 --- a/lib/routes/twitch/video.ts +++ b/lib/routes/twitch/video.ts @@ -83,7 +83,7 @@ async function handler(ctx) { const channelVideoShelvesQueryData = response.data[0].data; if (!channelVideoShelvesQueryData.user.id) { - throw new InvalidParameterError(`Username does not exist`); + throw new InvalidParameterError('Username does not exist'); } const displayName = channelVideoShelvesQueryData.user.displayName; diff --git a/lib/routes/twitter/api/web-api/gql-id-resolver.ts b/lib/routes/twitter/api/web-api/gql-id-resolver.ts index 9c2067ace..aac492bf1 100644 --- a/lib/routes/twitter/api/web-api/gql-id-resolver.ts +++ b/lib/routes/twitter/api/web-api/gql-id-resolver.ts @@ -68,7 +68,7 @@ export async function resolveQueryIds(): Promise> { try { const parsed = typeof cached === 'string' ? JSON.parse(cached) : cached; if (parsed && typeof parsed === 'object' && Object.keys(parsed).length > 0) { - logger.debug(`twitter gql-id-resolver: using cached query IDs`); + logger.debug('twitter gql-id-resolver: using cached query IDs'); return { ...fallbackIds, ...parsed }; } } catch { diff --git a/lib/routes/twitter/home-latest.ts b/lib/routes/twitter/home-latest.ts index a9d4e9abe..6a0ff6375 100644 --- a/lib/routes/twitter/home-latest.ts +++ b/lib/routes/twitter/home-latest.ts @@ -54,8 +54,8 @@ async function handler(ctx) { } return { - title: `Twitter following timeline`, - link: `https://x.com/home`, + title: 'Twitter following timeline', + link: 'https://x.com/home', // description: userInfo?.description, item: utils.ProcessFeed(ctx, { data, diff --git a/lib/routes/twitter/home.ts b/lib/routes/twitter/home.ts index 4879e767e..c4f1a94e3 100644 --- a/lib/routes/twitter/home.ts +++ b/lib/routes/twitter/home.ts @@ -54,8 +54,8 @@ async function handler(ctx) { } return { - title: `Twitter following timeline`, - link: `https://x.com/home`, + title: 'Twitter following timeline', + link: 'https://x.com/home', // description: userInfo?.description, item: utils.ProcessFeed(ctx, { data, diff --git a/lib/routes/twitter/trends.ts b/lib/routes/twitter/trends.ts index 214082213..426bca160 100644 --- a/lib/routes/twitter/trends.ts +++ b/lib/routes/twitter/trends.ts @@ -33,7 +33,7 @@ async function handler(ctx) { return { title: `Twitter Trends on ${data[0].locations[0].name}`, - link: `https://x.com/i/trends`, + link: 'https://x.com/i/trends', item: trends .filter((t) => !t.promoted_content) .map((t) => ({ diff --git a/lib/routes/twitter/utils.ts b/lib/routes/twitter/utils.ts index c9fef81ab..e1de97426 100644 --- a/lib/routes/twitter/utils.ts +++ b/lib/routes/twitter/utils.ts @@ -101,7 +101,7 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { } if (bestVideo && bestVideo.url) { - const gifAutoPlayAttr = media.type === 'animated_gif' ? `autoplay loop muted webkit-playsinline playsinline` : ''; + const gifAutoPlayAttr = media.type === 'animated_gif' ? 'autoplay loop muted webkit-playsinline playsinline' : ''; if (!readable) { content += '
    '; } @@ -131,12 +131,12 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { default: originalImg = getOriginalImg(media.media_url_https); if (!readable) { - content += `
    `; + content += '
    '; } if (addLinkForPics) { content += ``; } - content += `= 0) { content += ` width="${widthOfPics}"`; style += `width: ${widthOfPics}px;`; @@ -150,7 +150,7 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { } content += ` style="${style}" ${readable ? 'hspace="4" vspace="8"' : ''} src="${originalImg}">`; if (addLinkForPics) { - content += ``; + content += ''; } break; } @@ -180,7 +180,7 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { let originalImg; switch (media.type) { case 'video': - content = formatVideo(media, `width="0" height="0"`); + content = formatVideo(media, 'width="0" height="0"'); break; case 'photo': @@ -218,7 +218,7 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { quote += `
    `; quote += `
    `; } else { - quote += `

    `; + quote += '

    '; } if (readable) { @@ -230,20 +230,20 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { } if (authorNameBold) { - quote += ``; + quote += ''; } quote += author.name; if (authorNameBold) { - quote += ``; + quote += ''; } if (readable) { - quote += ``; + quote += ''; } - quote += `: `; + quote += ': '; quote += formatText(quoteData); if (!readable) { @@ -261,14 +261,14 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { } if (showTimestampInDescription) { quote += '
    ' + parseDate(quoteData.created_at); - quote += ``; + quote += ''; if (readable) { quote += `
    `; } } if (readable) { - quote += `
    `; + quote += '
    '; } quote += ''; } @@ -316,11 +316,11 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { description += ``; } if (authorNameBold) { - description += ``; + description += ''; } description += originalItem.user?.name; if (authorNameBold) { - description += ``; + description += ''; } if (readable) { description += ''; @@ -334,11 +334,11 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { description += ``; } if (authorNameBold) { - description += ``; + description += ''; } description += item.user?.name; if (authorNameBold) { - description += ``; + description += ''; } if (readable) { description += ''; @@ -358,16 +358,16 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { description += ``; } if (authorNameBold) { - description += ``; + description += ''; } description += item.user?.name; if (authorNameBold) { - description += ``; + description += ''; } if (readable) { - description += ``; + description += ''; } - description += `: `; + description += ': '; } if (item.in_reply_to_screen_name) { description += showEmojiForRetweetAndReply ? '↩️ ' : showSymbolForRetweetAndReply ? 'Re ' : ''; @@ -384,7 +384,7 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { if (showTimestampInDescription) { if (readable) { - description += `
    `; + description += '
    '; } description += `${parseDate(item.created_at)}`; } diff --git a/lib/routes/twreporter/newest.ts b/lib/routes/twreporter/newest.ts index eb65efd6e..2b362e10a 100644 --- a/lib/routes/twreporter/newest.ts +++ b/lib/routes/twreporter/newest.ts @@ -29,8 +29,8 @@ export const route: Route = { }; async function handler() { - const base = `https://www.twreporter.org`; - const url = `https://go-api.twreporter.org/v2/index_page`; + const base = 'https://www.twreporter.org'; + const url = 'https://go-api.twreporter.org/v2/index_page'; const res = await ofetch(url); const list = res.data.latest_section; const out = await Promise.all( @@ -45,7 +45,7 @@ async function handler() { ); return { - title: `報導者 | 最新`, + title: '報導者 | 最新', link: base, item: out, }; diff --git a/lib/routes/txks/news.ts b/lib/routes/txks/news.ts index dae83a9cc..34f8654a5 100644 --- a/lib/routes/txks/news.ts +++ b/lib/routes/txks/news.ts @@ -101,7 +101,7 @@ export const route: Route = { { title: '全国通信专业技术人员职业水平考试动态', source: ['www.txks.org.cn/index/work', 'www.txks.org.cn'], - target: `/news`, + target: '/news', }, ], example: '/txks/news', diff --git a/lib/routes/typora/changelog-dev.ts b/lib/routes/typora/changelog-dev.ts index 6859758d5..d93afcf22 100644 --- a/lib/routes/typora/changelog-dev.ts +++ b/lib/routes/typora/changelog-dev.ts @@ -50,7 +50,7 @@ async function handler() { }); return { - title: `Typora Changelog - Dev`, + title: 'Typora Changelog - Dev', link: currentUrl, description: 'Typora Changelog', item: items, diff --git a/lib/routes/uber/blog.ts b/lib/routes/uber/blog.ts index aea54a2c9..3dc011341 100644 --- a/lib/routes/uber/blog.ts +++ b/lib/routes/uber/blog.ts @@ -85,7 +85,7 @@ async function handler() { ); return { - title: `Uber Engineering Blog`, + title: 'Uber Engineering Blog', link: rootURL + '/blog/engineering', description: 'The technology behind Uber Engineering', item: result, diff --git a/lib/routes/upc/jsj.ts b/lib/routes/upc/jsj.ts index 1dc8d9461..753195858 100644 --- a/lib/routes/upc/jsj.ts +++ b/lib/routes/upc/jsj.ts @@ -92,9 +92,9 @@ async function handler(ctx) { ); return { - title: HEAD[type] + `-计算机科学与技术学院`, + title: HEAD[type] + '-计算机科学与技术学院', link, - description: HEAD[type] + `-计算机科学与技术学院`, + description: HEAD[type] + '-计算机科学与技术学院', item: out, }; } diff --git a/lib/routes/upc/main.ts b/lib/routes/upc/main.ts index ea41372a8..e19ebeb77 100644 --- a/lib/routes/upc/main.ts +++ b/lib/routes/upc/main.ts @@ -88,9 +88,9 @@ async function handler(ctx) { ); return { - title: HEAD[type] + `-中国石油大学(华东)`, + title: HEAD[type] + '-中国石油大学(华东)', link, - description: HEAD[type] + `-中国石油大学(华东)`, + description: HEAD[type] + '-中国石油大学(华东)', item: out, }; } diff --git a/lib/routes/uraaka-joshi/uraaka-joshi.ts b/lib/routes/uraaka-joshi/uraaka-joshi.ts index 1aef1cf8d..4d97470fa 100644 --- a/lib/routes/uraaka-joshi/uraaka-joshi.ts +++ b/lib/routes/uraaka-joshi/uraaka-joshi.ts @@ -22,8 +22,8 @@ export const route: Route = { }; async function handler() { - const link = `https://www.uraaka-joshi.com/`; - const title = `裏垢女子まとめ`; + const link = 'https://www.uraaka-joshi.com/'; + const title = '裏垢女子まとめ'; const browser = await puppeteer(); diff --git a/lib/routes/usenix/usenix.ts b/lib/routes/usenix/usenix.ts index 8eff3387f..e994b8a4b 100644 --- a/lib/routes/usenix/usenix.ts +++ b/lib/routes/usenix/usenix.ts @@ -22,7 +22,7 @@ export const route: Route = { maintainers: ['ZeddYu'], handler, url: 'usenix.org/conferences/all', - description: `Return results from 2020`, + description: 'Return results from 2020', }; async function handler() { diff --git a/lib/routes/v2ex/xna.ts b/lib/routes/v2ex/xna.ts index b37a94e17..befd869aa 100644 --- a/lib/routes/v2ex/xna.ts +++ b/lib/routes/v2ex/xna.ts @@ -52,9 +52,9 @@ async function handler(ctx) { }); return { - title: `V2EX-xna`, + title: 'V2EX-xna', link: pageUrl, - description: `V2EX-xna`, + description: 'V2EX-xna', item: items, }; } diff --git a/lib/routes/vimeo/category.ts b/lib/routes/vimeo/category.ts index f590fdab4..7d19c8bdf 100644 --- a/lib/routes/vimeo/category.ts +++ b/lib/routes/vimeo/category.ts @@ -79,7 +79,7 @@ async function handler(ctx) { item: vimeojs.map((item) => ({ title: item.name, description: renderDescription({ - videoUrl: item.uri.replace(`/videos`, ''), + videoUrl: item.uri.replace('/videos', ''), vdescription: item.description || '', }), pubDate: parseDate(item.created_time), diff --git a/lib/routes/vimeo/channel.ts b/lib/routes/vimeo/channel.ts index eb34fd65b..8fd2baf82 100644 --- a/lib/routes/vimeo/channel.ts +++ b/lib/routes/vimeo/channel.ts @@ -42,7 +42,7 @@ async function handler(ctx) { }, }); const page2 = - channel === `bestoftheyear` + channel === 'bestoftheyear' ? await got({ method: 'get', url: `${url}/page:2/sort:date/format:detail`, diff --git a/lib/routes/visionias/daily-news-summary.ts b/lib/routes/visionias/daily-news-summary.ts index c4b1eed8a..6f749e25d 100644 --- a/lib/routes/visionias/daily-news-summary.ts +++ b/lib/routes/visionias/daily-news-summary.ts @@ -40,15 +40,15 @@ async function handler(): Promise { language: 'en', item: items, image: `${baseUrl}/current-affairs/images/news-today-logo.svg`, - icon: `https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png`, - logo: `https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png`, + icon: 'https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png', + logo: 'https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png', allowEmpty: true, }; } function processNews(page) { const $ = load(page); - const items = $(`#quiz-start div[x-data="{ isExpanded: false }"]`) + const items = $('#quiz-start div[x-data="{ isExpanded: false }"]') .toArray() .map((item) => { const title = $(item).find('a>h5').text().trim(); diff --git a/lib/routes/visionias/monthly-magazine.ts b/lib/routes/visionias/monthly-magazine.ts index e8bbef7ae..25b6e3d05 100644 --- a/lib/routes/visionias/monthly-magazine.ts +++ b/lib/routes/visionias/monthly-magazine.ts @@ -40,15 +40,15 @@ async function handler(): Promise { language: 'en', item: items, image: `${baseUrl}/current-affairs/images/news-today-logo.svg`, - icon: `https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png`, - logo: `https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png`, + icon: 'https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png', + logo: 'https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png', allowEmpty: true, }; } async function processNews(page) { const $ = load(page); - const divItems = $(`#monthly-table-of-content>div`).toArray(); + const divItems = $('#monthly-table-of-content>div').toArray(); const linkItems = divItems.flatMap((item) => { const maintitle = $(item).find('button>div:nth-child(2) div.text-left').text().trim(); return $(item) diff --git a/lib/routes/visionias/news-today.ts b/lib/routes/visionias/news-today.ts index 5c8d67bee..41a3f667c 100644 --- a/lib/routes/visionias/news-today.ts +++ b/lib/routes/visionias/news-today.ts @@ -66,8 +66,8 @@ async function handler(ctx): Promise { language: 'en', item: items, image: `${baseUrl}/current-affairs/images/news-today-logo.svg`, - icon: `https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png`, - logo: `https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png`, + icon: 'https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png', + logo: 'https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png', allowEmpty: true, }; } @@ -75,7 +75,7 @@ async function handler(ctx): Promise { async function processCurrentNews(currentUrl) { const response = await ofetch(`${baseUrl}${currentUrl}`); const $ = load(response); - const items = $(`#table-of-content > ul > li > a`) + const items = $('#table-of-content > ul > li > a') .toArray() .map((item) => { const link = $(item).attr('href'); diff --git a/lib/routes/visionias/weekly-focus.ts b/lib/routes/visionias/weekly-focus.ts index bcf73b69f..fe0ee3148 100644 --- a/lib/routes/visionias/weekly-focus.ts +++ b/lib/routes/visionias/weekly-focus.ts @@ -51,8 +51,8 @@ async function handler(ctx): Promise { language: 'en', item: itemsPromise.map((item) => (item.status === 'fulfilled' ? item.value : { title: 'Error Parse News' })), image: `${baseUrl}/current-affairs/images/weekly-focus-logo.svg`, - icon: `https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png`, - logo: `https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png`, + icon: 'https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png', + logo: 'https://cdn.visionias.in/new-system-assets/images/home_page/home/vision-logo-footer.png', allowEmpty: true, }; } diff --git a/lib/routes/wechat/mp.ts b/lib/routes/wechat/mp.ts index d080dc708..b54d935ae 100755 --- a/lib/routes/wechat/mp.ts +++ b/lib/routes/wechat/mp.ts @@ -48,7 +48,7 @@ async function handler(ctx) { const list = JSONresponse.data.appmsg_list; const $ = load(HTMLresponse.data); // 标题,另外差一个菜单标题!求助 - const mptitle = $('div.articles_header').find('a').text() + `|` + $('div.articles_header > h2.rich_media_title').text(); + const mptitle = $('div.articles_header').find('a').text() + '|' + $('div.articles_header > h2.rich_media_title').text(); const articledata = await Promise.all( list.map((item) => { const single = { diff --git a/lib/routes/wechat/msgalbum.ts b/lib/routes/wechat/msgalbum.ts index 327057356..3f6d8d7f6 100644 --- a/lib/routes/wechat/msgalbum.ts +++ b/lib/routes/wechat/msgalbum.ts @@ -21,7 +21,8 @@ export const route: Route = { name: '公众号文章话题 Tag', maintainers: ['MisteryMonster'], handler, - description: `一些公众号(如看理想)会在微信文章里添加 Tag ,点入 Tag 的链接如 \`https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzA3MDM3NjE5NQ==&action=getalbum&album_id=1375870284640911361\`,其中\`biz\` 为 \`MzA3MDM3NjE5NQ==\`,\`aid\` 为 \`1375870284640911361\`。`, + description: + '一些公众号(如看理想)会在微信文章里添加 Tag ,点入 Tag 的链接如 `https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzA3MDM3NjE5NQ==&action=getalbum&album_id=1375870284640911361`,其中`biz` 为 `MzA3MDM3NjE5NQ==`,`aid` 为 `1375870284640911361`。', }; async function handler(ctx) { @@ -34,7 +35,7 @@ async function handler(ctx) { }); const $ = load(HTMLresponse.data); const list = $('li').toArray(); - const mptitle = $('.album__author-name').text() + `|` + $('.album__label-title').text(); + const mptitle = $('.album__author-name').text() + '|' + $('.album__label-title').text(); const articledata = await Promise.all( list.map((item) => { const link = $(item).attr('data-link').replace('http://', 'https://'); diff --git a/lib/routes/weibo/friends.ts b/lib/routes/weibo/friends.ts index dbc04bf37..255d0fe0c 100644 --- a/lib/routes/weibo/friends.ts +++ b/lib/routes/weibo/friends.ts @@ -67,13 +67,13 @@ async function handler(ctx) { } const uid = await cache.tryGet( - `weibo:friends:login-user`, + 'weibo:friends:login-user', async () => { const _r = await got({ method: 'get', url: 'https://m.weibo.cn/api/config', headers: { - Referer: `https://m.weibo.cn/`, + Referer: 'https://m.weibo.cn/', Cookie: config.weibo.cookies, ...weiboUtils.apiHeaders, }, @@ -112,7 +112,7 @@ async function handler(ctx) { method: 'get', url: 'https://m.weibo.cn/feed/friends', headers: { - Referer: `https://m.weibo.cn/`, + Referer: 'https://m.weibo.cn/', Cookie: config.weibo.cookies, ...weiboUtils.apiHeaders, }, @@ -156,7 +156,7 @@ async function handler(ctx) { return weiboUtils.sinaimgTvax({ title, - link: `https://weibo.com`, + link: 'https://weibo.com', item: resultItems, }); } diff --git a/lib/routes/weibo/group.ts b/lib/routes/weibo/group.ts index 80f657373..4c52d814a 100644 --- a/lib/routes/weibo/group.ts +++ b/lib/routes/weibo/group.ts @@ -68,7 +68,7 @@ async function handler(ctx) { method: 'get', url: `https://m.weibo.cn/feed/group?gid=${gid}`, headers: { - Referer: `https://m.weibo.cn/`, + Referer: 'https://m.weibo.cn/', Cookie: config.weibo.cookies, ...weiboUtils.apiHeaders, }, diff --git a/lib/routes/weibo/utils.ts b/lib/routes/weibo/utils.ts index f33e28315..5923d6935 100644 --- a/lib/routes/weibo/utils.ts +++ b/lib/routes/weibo/utils.ts @@ -312,8 +312,8 @@ const weiboUtils = { // 处理转发的微博 if (status.retweeted_status) { html += readable - ? `
    ` - : `
    - 转发 `; + ? '
    ' + : '
    - 转发 '; if (!status.retweeted_status.user) { // 当转发的微博被删除时user为null status.retweeted_status.user = { @@ -335,10 +335,10 @@ const weiboUtils = { html += `
    原博:https://weibo.com/${status.retweeted_status.user.id}/${status.retweeted_status.bid}`; } if (showTimestampInDescription) { - html += `
    ` + new Date(status.retweeted_status.created_at).toLocaleString() + ``; + html += '
    ' + new Date(status.retweeted_status.created_at).toLocaleString() + ''; } if (readable) { - html += `
    `; + html += '
    '; } html += '
    '; @@ -548,7 +548,7 @@ const weiboUtils = { }); if (response.data && response.data.data) { const comments = response.data.data; - itemDesc += `
    `; + itemDesc += '
    '; itemDesc += '

    热门评论

    '; for (const comment of comments) { itemDesc += '

    '; diff --git a/lib/routes/wikinews/index.ts b/lib/routes/wikinews/index.ts index 1ccb16ab8..53b20f1e6 100644 --- a/lib/routes/wikinews/index.ts +++ b/lib/routes/wikinews/index.ts @@ -28,7 +28,7 @@ export const route: Route = { name: '最新新闻', maintainers: ['KotoriK'], handler, - description: `根据维基新闻的[sitemap](https://zh.wikinews.org/wiki/Special:%E6%96%B0%E9%97%BB%E8%AE%A2%E9%98%85)获取新闻全文。目前仅支持中文维基新闻。`, + description: '根据维基新闻的[sitemap](https://zh.wikinews.org/wiki/Special:%E6%96%B0%E9%97%BB%E8%AE%A2%E9%98%85)获取新闻全文。目前仅支持中文维基新闻。', }; async function handler() { diff --git a/lib/routes/wise/pair.tsx b/lib/routes/wise/pair.tsx index 0338a02cc..228c82db0 100644 --- a/lib/routes/wise/pair.tsx +++ b/lib/routes/wise/pair.tsx @@ -53,7 +53,7 @@ export const route: Route = { name: 'FX Pair Yesterday', maintainers: ['HenryQW'], handler, - description: `Refer to [the list of supported currencies](https://wise.com/tools/exchange-rate-alerts/).`, + description: 'Refer to [the list of supported currencies](https://wise.com/tools/exchange-rate-alerts/).', }; async function handler(ctx) { @@ -108,7 +108,7 @@ async function handler(ctx) { return { title: `${source} to ${target} by Wise`, link, - description: `Exchange Rate from Wise`, + description: 'Exchange Rate from Wise', item: [single], }; } diff --git a/lib/routes/wizfile/index.ts b/lib/routes/wizfile/index.ts index 81e82eef4..8d9cd87a3 100644 --- a/lib/routes/wizfile/index.ts +++ b/lib/routes/wizfile/index.ts @@ -60,7 +60,7 @@ async function handler() { }); return { - title: `WziFile - 更新日志`, + title: 'WziFile - 更新日志', link: currentUrl, item: items, }; diff --git a/lib/routes/wmpvp/index.ts b/lib/routes/wmpvp/index.ts index ea8b3e959..844ef7e11 100644 --- a/lib/routes/wmpvp/index.ts +++ b/lib/routes/wmpvp/index.ts @@ -63,7 +63,7 @@ async function handler(ctx) { return { title: `完美世界电竞 - ${TYPE_MAP[type]} 资讯`, - link: `https://news.wmpvp.com/`, + link: 'https://news.wmpvp.com/', item: items, }; } diff --git a/lib/routes/wogem/index.ts b/lib/routes/wogem/index.ts index edbebb315..38479ec9f 100644 --- a/lib/routes/wogem/index.ts +++ b/lib/routes/wogem/index.ts @@ -14,7 +14,7 @@ export const route: Route = { path: '/:page?', maintainers: ['sk22'], categories: ['other'], - description: `Pass in the name of the php file, e.g. \`angebote\` for \`/de/angebote.php\`\`.`, + description: 'Pass in the name of the php file, e.g. `angebote` for `/de/angebote.php``.', parameters: { page: 'Page name, e.g. `angebote` for `angebote.php. Defaults to `angebote`', }, diff --git a/lib/routes/xaut/index.ts b/lib/routes/xaut/index.ts index 395cd3be3..c9dc5b92b 100644 --- a/lib/routes/xaut/index.ts +++ b/lib/routes/xaut/index.ts @@ -66,7 +66,7 @@ async function handler(ctx) { // 源链接 link: 'http://www.xaut.edu.cn', // 源说明 - description: `西安理工大学官网-` + dic_title[category], + description: '西安理工大学官网-' + dic_title[category], // 遍历此前获取的数据 item: await Promise.all( list.map((item) => diff --git a/lib/routes/xaut/jwc.ts b/lib/routes/xaut/jwc.ts index 0bfc7b838..0183c7a71 100644 --- a/lib/routes/xaut/jwc.ts +++ b/lib/routes/xaut/jwc.ts @@ -70,7 +70,7 @@ async function handler(ctx) { // 源链接 link: rootUrl, // 源说明 - description: `西安理工大学教务处-` + dic_title[category], + description: '西安理工大学教务处-' + dic_title[category], // 遍历此前获取的数据 item: await Promise.all( list.map((item) => diff --git a/lib/routes/xaut/rsc.ts b/lib/routes/xaut/rsc.ts index 3c1af4ed9..cec018b79 100644 --- a/lib/routes/xaut/rsc.ts +++ b/lib/routes/xaut/rsc.ts @@ -69,7 +69,7 @@ async function handler(ctx) { // 源链接 link: 'http://renshichu.xaut.edu.cn', // 源说明 - description: `西安理工大学人事处-` + dic_title[category], + description: '西安理工大学人事处-' + dic_title[category], // 遍历此前获取的数据 item: await Promise.all( list.map((item) => diff --git a/lib/routes/xiaoheihe/add2cart.ts b/lib/routes/xiaoheihe/add2cart.ts index d6c5b5c36..79a9d42e9 100644 --- a/lib/routes/xiaoheihe/add2cart.ts +++ b/lib/routes/xiaoheihe/add2cart.ts @@ -57,7 +57,7 @@ async function handler(ctx) { return { title: `小黑盒 ${platform.toUpperCase()} 喜加一`, - link: `https://xiaoheihe.cn`, + link: 'https://xiaoheihe.cn', item: items, }; } diff --git a/lib/routes/xiaoheihe/discount.ts b/lib/routes/xiaoheihe/discount.ts index df1aa9ebf..6a1622ea9 100644 --- a/lib/routes/xiaoheihe/discount.ts +++ b/lib/routes/xiaoheihe/discount.ts @@ -139,7 +139,7 @@ async function handler(ctx) { return { title: `小黑盒 ${platformInfo.desc} 游戏折扣`, - link: `https://xiaoheihe.cn`, + link: 'https://xiaoheihe.cn', item: items, }; } diff --git a/lib/routes/xiaoheihe/news.ts b/lib/routes/xiaoheihe/news.ts index cddb0f3bb..5740b4c3c 100644 --- a/lib/routes/xiaoheihe/news.ts +++ b/lib/routes/xiaoheihe/news.ts @@ -23,7 +23,7 @@ export const route: Route = { }; async function handler() { - const feedUrl = calculate(`https://api.xiaoheihe.cn/bbs/app/feeds/news?os_type=web&app=heybox&client_type=mobile&version=999.0.3&x_client_type=web&x_os_type=Mac&x_app=heybox&heybox_id=-1&appid=900018355&offset=0&limit=20`); + const feedUrl = calculate('https://api.xiaoheihe.cn/bbs/app/feeds/news?os_type=web&app=heybox&client_type=mobile&version=999.0.3&x_client_type=web&x_os_type=Mac&x_app=heybox&heybox_id=-1&appid=900018355&offset=0&limit=20'); const response = await got({ method: 'get', url: feedUrl, @@ -55,8 +55,8 @@ async function handler() { ); return { - title: `小黑盒游戏新闻`, - link: `https://xiaoheihe.cn`, + title: '小黑盒游戏新闻', + link: 'https://xiaoheihe.cn', item: items, }; } diff --git a/lib/routes/xiaoheihe/user.ts b/lib/routes/xiaoheihe/user.ts index d708a51bc..d19838935 100644 --- a/lib/routes/xiaoheihe/user.ts +++ b/lib/routes/xiaoheihe/user.ts @@ -64,7 +64,7 @@ async function handler(ctx) { return { title: `${username} 的动态`, - link: `https://xiaoheihe.cn`, + link: 'https://xiaoheihe.cn', item: items, }; } diff --git a/lib/routes/xiaohongshu/util.ts b/lib/routes/xiaohongshu/util.ts index dcd23dd56..dec772673 100644 --- a/lib/routes/xiaohongshu/util.ts +++ b/lib/routes/xiaohongshu/util.ts @@ -151,9 +151,9 @@ const getBoard = (url, cache) => const formatText = (text) => text.replaceAll(/(\r\n|\r|\n)/g, '
    ').replaceAll('\t', ' '); // tag_list.id has nothing to do with its url -const formatTagList = (tagList) => tagList.reduce((acc, item) => acc + `#${item.name} `, ``); +const formatTagList = (tagList) => tagList.reduce((acc, item) => acc + `#${item.name} `, ''); -const formatImageList = (imageList) => imageList.reduce((acc, item) => acc + `
    `, ``); +const formatImageList = (imageList) => imageList.reduce((acc, item) => acc + `
    `, ''); const formatNote = (url, note) => ({ title: note.title, diff --git a/lib/routes/xunhupay/index.ts b/lib/routes/xunhupay/index.ts index 59b965b64..a9ad383df 100644 --- a/lib/routes/xunhupay/index.ts +++ b/lib/routes/xunhupay/index.ts @@ -32,8 +32,8 @@ async function handler() { return await buildData({ link, url: link, - title: `%title%`, - description: `%description%`, + title: '%title%', + description: '%description%', params: { title: '博客', description: '虎皮椒-博客', diff --git a/lib/routes/yande/namespace.ts b/lib/routes/yande/namespace.ts index 83371c10c..f6511722b 100644 --- a/lib/routes/yande/namespace.ts +++ b/lib/routes/yande/namespace.ts @@ -3,6 +3,6 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { name: 'yande.re', url: 'yande.re', - description: `yande post`, + description: 'yande post', lang: 'en', }; diff --git a/lib/routes/yicai/utils.ts b/lib/routes/yicai/utils.ts index 2623c8008..ed148f1b8 100644 --- a/lib/routes/yicai/utils.ts +++ b/lib/routes/yicai/utils.ts @@ -16,7 +16,7 @@ const ProcessItems = async (apiUrl, tryGet) => { const items = response.data.map((item) => ({ title: item.NewsTitle, - link: item.url.startsWith('http') ? item.url : `${rootUrl}${item.AppID === 0 ? `/vip` : ''}${item.url}`, + link: item.url.startsWith('http') ? item.url : `${rootUrl}${item.AppID === 0 ? '/vip' : ''}${item.url}`, author: item.NewsAuthor || item.NewsSource || item.CreaterName, pubDate: timezone(parseDate(item.CreateDate), +8), category: [item.ChannelName], diff --git a/lib/routes/ymgal/game.tsx b/lib/routes/ymgal/game.tsx index eb09deb7d..3efecc38d 100644 --- a/lib/routes/ymgal/game.tsx +++ b/lib/routes/ymgal/game.tsx @@ -59,7 +59,7 @@ async function handler() { }); return { - title: `月幕 Galgame - 本月新作`, + title: '月幕 Galgame - 本月新作', link: `${host}/release-list/${year}/${month}`, description: '月幕 Galgame - 本月新作', item: items, diff --git a/lib/routes/youtube/channel.ts b/lib/routes/youtube/channel.ts index fa53b06c6..bf077a4c8 100644 --- a/lib/routes/youtube/channel.ts +++ b/lib/routes/youtube/channel.ts @@ -63,7 +63,7 @@ async function handler(ctx) { const filterShorts = filterShortsStr === null || filterShortsStr === '' || filterShortsStr === 'true'; if (!utils.isYouTubeChannelId(id)) { - throw new InvalidParameterError(`Invalid YouTube channel ID. \nYou may want to use /youtube/user/:id instead.`); + throw new InvalidParameterError('Invalid YouTube channel ID. \nYou may want to use /youtube/user/:id instead.'); } const isJsonFeed = ctx.req.query('format') === 'json'; diff --git a/lib/routes/yystv/docs.ts b/lib/routes/yystv/docs.ts index 836dfe958..7912ff20b 100644 --- a/lib/routes/yystv/docs.ts +++ b/lib/routes/yystv/docs.ts @@ -31,7 +31,7 @@ export const route: Route = { }; async function handler() { - const url = `https://www.yystv.cn/docs`; + const url = 'https://www.yystv.cn/docs'; const response = await ofetch(url); const $ = load(response); @@ -62,7 +62,7 @@ async function handler() { return { title: '游研社-' + $('title').text(), - link: `https://www.yystv.cn/docs`, + link: 'https://www.yystv.cn/docs', item: items, }; } diff --git a/lib/routes/zagg/new-arrivals.tsx b/lib/routes/zagg/new-arrivals.tsx index b3fe344d7..94659caca 100644 --- a/lib/routes/zagg/new-arrivals.tsx +++ b/lib/routes/zagg/new-arrivals.tsx @@ -21,7 +21,7 @@ export const route: Route = { name: 'New Arrivals', maintainers: ['EthanWng97'], handler, - description: `For instance, in \`https://www.zagg.com/en_us/new-arrivals?brand=164&cat=3038%2C3041\`, the query is \`brand=164&cat=3038%2C3041\``, + description: 'For instance, in `https://www.zagg.com/en_us/new-arrivals?brand=164&cat=3038%2C3041`, the query is `brand=164&cat=3038%2C3041`', }; async function handler(ctx) { diff --git a/lib/routes/zaobao/other.ts b/lib/routes/zaobao/other.ts index 02b0aa05d..6f07777fe 100644 --- a/lib/routes/zaobao/other.ts +++ b/lib/routes/zaobao/other.ts @@ -12,7 +12,8 @@ export const route: Route = { name: '其他栏目', maintainers: ['shunf4'], handler, - description: `除了上面两个兼容规则之外,联合早报网站里所有页面形如 [https://www.zaobao.com/lifestyle/health](https://www.zaobao.com/lifestyle/health) 这样的栏目都能被这个规则解析到,早报的大部分栏目都是这个样式的。你可以测试之后再订阅。`, + description: + '除了上面两个兼容规则之外,联合早报网站里所有页面形如 [https://www.zaobao.com/lifestyle/health](https://www.zaobao.com/lifestyle/health) 这样的栏目都能被这个规则解析到,早报的大部分栏目都是这个样式的。你可以测试之后再订阅。', }; async function handler(ctx) { diff --git a/lib/routes/zaozao/article.ts b/lib/routes/zaozao/article.ts index 861b10a0e..18887aa26 100644 --- a/lib/routes/zaozao/article.ts +++ b/lib/routes/zaozao/article.ts @@ -35,7 +35,7 @@ async function handler(ctx) { method: 'put', url: `https://e.zaozao.run/article/page/${type}`, headers: { - Referer: `https://www.zaozao.run/`, + Referer: 'https://www.zaozao.run/', }, body: JSON.stringify({ pageNo: 1, @@ -51,9 +51,9 @@ async function handler(ctx) { const { data } = response.data; return { - title: `前端早早聊 - 文章`, + title: '前端早早聊 - 文章', link: `https://www.zaozao.run/article/${type}`, - description: `前端早早聊 - 文章`, + description: '前端早早聊 - 文章', item: data.map((item) => ({ title: item.title, link: item.url, diff --git a/lib/routes/zhihu/check-cookie.ts b/lib/routes/zhihu/check-cookie.ts index 6d0938d92..f68c25513 100644 --- a/lib/routes/zhihu/check-cookie.ts +++ b/lib/routes/zhihu/check-cookie.ts @@ -18,9 +18,9 @@ async function handler() { }; } - const response = await ofetch(`https://www.zhihu.com/api/v4/me?include=is_realname`, { + const response = await ofetch('https://www.zhihu.com/api/v4/me?include=is_realname', { headers: { - Referer: `https://www.zhihu.com/`, + Referer: 'https://www.zhihu.com/', Cookie: cookie as string, }, }); diff --git a/lib/routes/zhihu/hot.ts b/lib/routes/zhihu/hot.ts index d76011596..87eac28d0 100644 --- a/lib/routes/zhihu/hot.ts +++ b/lib/routes/zhihu/hot.ts @@ -31,7 +31,7 @@ export const route: Route = { async function handler(ctx) { const category = ctx.req.param('category'); if (category) { - ctx.set('redirect', `/zhihu/hot`); + ctx.set('redirect', '/zhihu/hot'); return null; } @@ -39,7 +39,7 @@ async function handler(ctx) { const response = await got({ method: 'get', - url: `https://api.zhihu.com/topstory/hot-lists/total?limit=10&reverse_order=0`, + url: 'https://api.zhihu.com/topstory/hot-lists/total?limit=10&reverse_order=0', headers: { Cookie: cookie, }, @@ -56,8 +56,8 @@ async function handler(ctx) { }); return { - title: `知乎热榜`, - link: `https://www.zhihu.com/hot`, + title: '知乎热榜', + link: 'https://www.zhihu.com/hot', item: items, }; } diff --git a/lib/routes/zhihu/timeline.ts b/lib/routes/zhihu/timeline.ts index 0dd545441..5d85afc35 100644 --- a/lib/routes/zhihu/timeline.ts +++ b/lib/routes/zhihu/timeline.ts @@ -39,7 +39,7 @@ async function handler(ctx) { } const response = await got({ method: 'get', - url: `https://www.zhihu.com/api/v3/moments`, + url: 'https://www.zhihu.com/api/v3/moments', headers: { Cookie: cookie, }, @@ -145,8 +145,8 @@ async function handler(ctx) { }); return { - title: `知乎关注动态`, - link: `https://www.zhihu.com/follow`, + title: '知乎关注动态', + link: 'https://www.zhihu.com/follow', item: out, }; } diff --git a/lib/routes/zhuwang/index.ts b/lib/routes/zhuwang/index.ts index f530a238e..80500f5bd 100644 --- a/lib/routes/zhuwang/index.ts +++ b/lib/routes/zhuwang/index.ts @@ -63,7 +63,7 @@ async function handler() { }); return { - title: `全国今日生猪价格`, + title: '全国今日生猪价格', desription: '中国养猪网猪价频道是中国猪价权威平台,提供每日猪评,猪价和行情分析,并且预测猪价和分析每天的猪价排行。', link: baseUrl, item: priceItems, diff --git a/lib/routes/zju/list.ts b/lib/routes/zju/list.ts index 4e86f28a0..32a498370 100644 --- a/lib/routes/zju/list.ts +++ b/lib/routes/zju/list.ts @@ -26,7 +26,7 @@ export const route: Route = { async function handler(ctx) { const type = ctx.req.param('type') ?? 'xs'; - const link = host + type + `/list.htm`; + const link = host + type + '/list.htm'; const response = await got({ method: 'get', url: link, @@ -77,7 +77,7 @@ async function handler(ctx) { }) ); return { - title: `浙江大学` + $('ul.submenu .selected').text(), + title: '浙江大学' + $('ul.submenu .selected').text(), link, item: out, }; diff --git a/lib/routes/zxcs/novel.ts b/lib/routes/zxcs/novel.ts index 6c5d19c65..30d33eb3d 100644 --- a/lib/routes/zxcs/novel.ts +++ b/lib/routes/zxcs/novel.ts @@ -52,7 +52,7 @@ export const route: Route = { async function handler(ctx) { const { type } = ctx.req.param(); - const baseUrl = `https://www.zxcs.info`; + const baseUrl = 'https://www.zxcs.info'; const link = `${baseUrl}/${type}`; const response = await ofetch(link); const $ = load(response); diff --git a/lib/setup.test.ts b/lib/setup.test.ts index c9834ab95..6779f9390 100644 --- a/lib/setup.test.ts +++ b/lib/setup.test.ts @@ -26,7 +26,7 @@ ${script} }; const server = setupServer( - http.post(`https://api.openai.mock/v1/chat/completions`, () => + http.post('https://api.openai.mock/v1/chat/completions', () => HttpResponse.json({ choices: [ { @@ -37,12 +37,12 @@ const server = setupServer( ], }) ), - http.get(`http://rsshub.test/config`, () => + http.get('http://rsshub.test/config', () => HttpResponse.json({ UA: 'test', }) ), - http.get(`http://rsshub.test/buildData`, () => + http.get('http://rsshub.test/buildData', () => HttpResponse.text(`

    • @@ -58,7 +58,7 @@ const server = setupServer(
    `) ), - http.get(`https://mp.weixin.qq.com/rsshub_test/appMsg`, () => + http.get('https://mp.weixin.qq.com/rsshub_test/appMsg', () => HttpResponse.text( genWeChatMpPage( ` @@ -83,7 +83,7 @@ window.ip_wording = { ) ) ), - http.get(`https://mp.weixin.qq.com/rsshub_test/original_empty`, () => + http.get('https://mp.weixin.qq.com/rsshub_test/original_empty', () => HttpResponse.text( ` @@ -102,10 +102,10 @@ var msg_source_url = "https://mp.weixin.qq.com/rsshub_test/fake"; ` ) ), - http.get(`https://mp.weixin.qq.com/rsshub_test/original_source`, () => + http.get('https://mp.weixin.qq.com/rsshub_test/original_source', () => HttpResponse.text( genWeChatMpPage( - `original content`, + 'original content', ` var item_show_type = "0"; var real_item_show_type = "0"; @@ -115,7 +115,7 @@ var msg_source_url = "https://mp.weixin.qq.com/rsshub_test/fake";` ) ) ), - http.get(`https://mp.weixin.qq.com/rsshub_test/original_long`, () => + http.get('https://mp.weixin.qq.com/rsshub_test/original_long', () => HttpResponse.text( genWeChatMpPage( 'long-content-'.repeat(10), @@ -128,7 +128,7 @@ var msg_source_url = "https://mp.weixin.qq.com/rsshub_test/fake";` ) ) ), - http.get(`https://mp.weixin.qq.com/rsshub_test/img`, () => + http.get('https://mp.weixin.qq.com/rsshub_test/img', () => HttpResponse.text( genWeChatMpPage('fake_description', [ ` @@ -150,7 +150,7 @@ window.picture_page_info_list = [ ]) ) ), - http.get(`https://mp.weixin.qq.com/rsshub_test/audio`, () => + http.get('https://mp.weixin.qq.com/rsshub_test/audio', () => HttpResponse.text( genWeChatMpPage('fake_description', [ ` @@ -175,7 +175,7 @@ window.cgiData = { ]) ) ), - http.get(`https://mp.weixin.qq.com/rsshub_test/video`, () => + http.get('https://mp.weixin.qq.com/rsshub_test/video', () => HttpResponse.text( genWeChatMpPage( 'fake_description', @@ -188,7 +188,7 @@ var ct = "${1_636_626_300}"; ) ) ), - http.get(`https://mp.weixin.qq.com/rsshub_test/fallback`, () => + http.get('https://mp.weixin.qq.com/rsshub_test/fallback', () => HttpResponse.text( genWeChatMpPage( 'fake_description', @@ -201,14 +201,14 @@ var ct = "${1_636_626_300}"; ) ) ), - http.get(`https://mp.weixin.qq.com/s/rsshub_test`, () => HttpResponse.redirect(`https://mp.weixin.qq.com/rsshub_test/fallback`)), - http.get(`https://mp.weixin.qq.com/s`, ({ request }) => { + http.get('https://mp.weixin.qq.com/s/rsshub_test', () => HttpResponse.redirect('https://mp.weixin.qq.com/rsshub_test/fallback')), + http.get('https://mp.weixin.qq.com/s', ({ request }) => { const url = new URL(request.url); if (url.searchParams.get('__biz') === 'rsshub_test' && url.searchParams.get('mid') === '1' && url.searchParams.get('idx') === '1' && url.searchParams.get('sn') === '1') { - return HttpResponse.redirect(`https://mp.weixin.qq.com/rsshub_test/fallback`); + return HttpResponse.redirect('https://mp.weixin.qq.com/rsshub_test/fallback'); } }), - http.get(`https://mp.weixin.qq.com/mp/rsshub_test/waf`, () => + http.get('https://mp.weixin.qq.com/mp/rsshub_test/waf', () => HttpResponse.text( ` @@ -236,8 +236,8 @@ var ct = "${1_636_626_300}"; ` ) ), - http.get(`https://mp.weixin.qq.com/s/rsshub_test_hit_waf`, () => HttpResponse.redirect(`https://mp.weixin.qq.com/mp/rsshub_test/waf`)), - http.get(`https://mp.weixin.qq.com/s/unknown_page`, () => + http.get('https://mp.weixin.qq.com/s/rsshub_test_hit_waf', () => HttpResponse.redirect('https://mp.weixin.qq.com/mp/rsshub_test/waf')), + http.get('https://mp.weixin.qq.com/s/unknown_page', () => HttpResponse.text( ` @@ -253,7 +253,7 @@ Unknown paragraph ` ) ), - http.get(`https://mp.weixin.qq.com/s/deleted_page`, () => + http.get('https://mp.weixin.qq.com/s/deleted_page', () => HttpResponse.text( ` @@ -269,17 +269,17 @@ Unknown paragraph ` ) ), - http.get(`https://mp.weixin.qq.com/s/rsshub_test_redirect_no_location`, () => HttpResponse.text('', { status: 302 })), - http.get(`https://mp.weixin.qq.com/s/rsshub_test_recursive_redirect`, () => HttpResponse.redirect(`https://mp.weixin.qq.com/s/rsshub_test_recursive_redirect`)), - http.get(`http://rsshub.test/headers`, ({ request }) => HttpResponse.json(Object.fromEntries(request.headers.entries()))), - http.post(`http://rsshub.test/form-post`, async ({ request }) => { + http.get('https://mp.weixin.qq.com/s/rsshub_test_redirect_no_location', () => HttpResponse.text('', { status: 302 })), + http.get('https://mp.weixin.qq.com/s/rsshub_test_recursive_redirect', () => HttpResponse.redirect('https://mp.weixin.qq.com/s/rsshub_test_recursive_redirect')), + http.get('http://rsshub.test/headers', ({ request }) => HttpResponse.json(Object.fromEntries(request.headers.entries()))), + http.post('http://rsshub.test/form-post', async ({ request }) => { const formData = await request.formData(); return HttpResponse.json({ test: formData.get('test'), req: { headers: Object.fromEntries(request.headers.entries()) }, }); }), - http.post(`http://rsshub.test/json-post`, async ({ request }) => { + http.post('http://rsshub.test/json-post', async ({ request }) => { const jsonData = (await request.json()) as { test: string; }; @@ -287,7 +287,7 @@ Unknown paragraph test: jsonData?.test, }); }), - http.get(`http://rsshub.test/rss`, () => HttpResponse.text('')) + http.get('http://rsshub.test/rss', () => HttpResponse.text('')) ); server.listen({ onUnhandledRequest: 'bypass' }); diff --git a/lib/utils/common-config.charset.test.ts b/lib/utils/common-config.charset.test.ts index 29b02d9b2..008141d66 100644 --- a/lib/utils/common-config.charset.test.ts +++ b/lib/utils/common-config.charset.test.ts @@ -30,7 +30,7 @@ describe('common-config charset', () => { const data = await buildData({ link: 'http://rsshub.test/buildData', url: 'http://rsshub.test/buildData', - title: `%title%`, + title: '%title%', params: { title: 'buildData', }, diff --git a/lib/utils/common-config.test.ts b/lib/utils/common-config.test.ts index 7cac7f5a6..8acb8ebd8 100644 --- a/lib/utils/common-config.test.ts +++ b/lib/utils/common-config.test.ts @@ -43,7 +43,7 @@ describe('index', () => { const data = await configUtils({ link: 'http://rsshub.test/buildData', url: 'http://rsshub.test/buildData', - title: `%title%`, + title: '%title%', params: { title: 'buildData', }, diff --git a/lib/utils/got.test.ts b/lib/utils/got.test.ts index 9f6a891b6..5b2195f7c 100644 --- a/lib/utils/got.test.ts +++ b/lib/utils/got.test.ts @@ -15,7 +15,7 @@ describe('got', () => { const requestRun = vi.fn(); const { default: server } = await import('@/setup.test'); server.use( - http.get(`http://rsshub.test/retry-test`, () => { + http.get('http://rsshub.test/retry-test', () => { requestRun(); return HttpResponse.error(); }) diff --git a/lib/utils/proxy/unify-proxy.ts b/lib/utils/proxy/unify-proxy.ts index f4c17bbab..a28f90b42 100644 --- a/lib/utils/proxy/unify-proxy.ts +++ b/lib/utils/proxy/unify-proxy.ts @@ -47,7 +47,7 @@ const unifyProxy = (proxyUri: Config['proxyUri'] | string, proxyObj: Config['pro if (Number.parseInt(proxyObj.port)) { proxyUrlHandler.port = proxyObj.port; } else { - logger.warn(`PROXY_PORT is not a number, ignoring`); + logger.warn('PROXY_PORT is not a number, ignoring'); } } else { logger.warn('PROXY_PORT is not set, leaving proxy agent to determine'); diff --git a/scripts/workflow/build-routes.ts b/scripts/workflow/build-routes.ts index 97411284f..284a39c2d 100644 --- a/scripts/workflow/build-routes.ts +++ b/scripts/workflow/build-routes.ts @@ -108,12 +108,12 @@ fs.mkdirSync(buildDir, { recursive: true }); // For Worker build, only output routes-worker.js with filtered namespaces // For regular build, output all files if (isWorkerBuild) { - fs.writeFileSync(path.join(__dirname, '../../assets/build/routes-worker.js'), `export default ${JSON.stringify(namespacesToProcess, null, 2)}`.replaceAll(/"module": "(.*)"\n/g, `"module": $1\n`)); + fs.writeFileSync(path.join(__dirname, '../../assets/build/routes-worker.js'), `export default ${JSON.stringify(namespacesToProcess, null, 2)}`.replaceAll(/"module": "(.*)"\n/g, '"module": $1\n')); } else { fs.writeFileSync(path.join(__dirname, '../../assets/build/radar-rules.json'), JSON.stringify(radar, null, 2)); fs.writeFileSync(path.join(__dirname, '../../assets/build/radar-rules.js'), `(${toSource(radar)})`); fs.writeFileSync(path.join(__dirname, '../../assets/build/maintainers.json'), JSON.stringify(maintainers, null, 2)); fs.writeFileSync(path.join(__dirname, '../../assets/build/routes.json'), JSON.stringify(namespaces, null, 2)); - fs.writeFileSync(path.join(__dirname, '../../assets/build/routes.js'), `export default ${JSON.stringify(namespaces, null, 2)}`.replaceAll(/"module": "(.*)"\n/g, `"module": $1\n`)); + fs.writeFileSync(path.join(__dirname, '../../assets/build/routes.js'), `export default ${JSON.stringify(namespaces, null, 2)}`.replaceAll(/"module": "(.*)"\n/g, '"module": $1\n')); fs.writeFileSync(path.join(__dirname, '../../assets/build/route-paths.ts'), routePathsType); }