From d88620c39c579a53bd27cae1f81ab5358886289b Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 1 Mar 2024 22:58:04 +0800 Subject: [PATCH 1/9] feat: update esm dependencies --- .github/dependabot.yml | 10 - lib/routes-deprecated/fanfou/utils.js | 2 +- lib/routes.test.ts | 3 +- lib/routes/bitbucket/commits.js | 2 +- lib/routes/bitbucket/tags.js | 2 +- lib/routes/booru/mmda.js | 2 +- lib/routes/github/file.js | 2 +- lib/routes/github/issue.js | 2 +- lib/routes/github/repos.js | 2 +- lib/routes/mckinsey/cn/index.js | 2 +- lib/routes/pixiv/api/get-bookmarks.js | 2 +- lib/routes/pixiv/api/get-illust-follows.js | 2 +- lib/routes/pixiv/api/get-illusts.js | 2 +- lib/routes/pixiv/api/get-ranking.js | 2 +- lib/routes/pixiv/api/get-user-detail.js | 2 +- lib/routes/pixiv/api/search-illust.js | 2 +- lib/routes/pixiv/api/search-popular-illust.js | 2 +- lib/routes/pixiv/pixiv-got.js | 2 +- lib/routes/saraba1st/thread.js | 2 +- lib/routes/twitter/web-api/twitter-api.js | 2 +- lib/routes/weibo/super-index.js | 2 +- lib/routes/xueqiu/favorite.js | 2 +- lib/routes/xueqiu/hots.js | 2 +- lib/routes/xueqiu/stock-info.js | 2 +- lib/routes/xueqiu/user-stock.js | 2 +- lib/routes/xueqiu/user.js | 2 +- lib/utils/got.ts | 4 +- package.json | 13 +- pnpm-lock.yaml | 1217 ++++++++++------- scripts/twitter-token/generate.js | 126 -- scripts/twitter-token/generate.sh | 17 - .../workflow/test-issue/call-maintainer.js | 3 +- 32 files changed, 753 insertions(+), 688 deletions(-) delete mode 100644 scripts/twitter-token/generate.js delete mode 100644 scripts/twitter-token/generate.sh diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 25004b0423f8ea..43912211164f74 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,16 +12,6 @@ updates: - dependency-name: jsrsasign versions: ['>=11.0.0'] # no longer includes KJUR.crypto.Cipher for RSA # ESM only packages - - dependency-name: fanfou-sdk - versions: ['>=5.0.0'] - - dependency-name: got - versions: ['>=12.0.0'] - - dependency-name: ip-regex - versions: ['>=5.0.0'] - - dependency-name: query-string - versions: ['>=8.0.0'] - - dependency-name: rand-user-agent - versions: ['>=2.0.1'] - dependency-name: remark-parse versions: ['>=10.0.0'] - dependency-name: remark-preset-prettier diff --git a/lib/routes-deprecated/fanfou/utils.js b/lib/routes-deprecated/fanfou/utils.js index 1c4d6873c2ff12..579b2cdf82d061 100644 --- a/lib/routes-deprecated/fanfou/utils.js +++ b/lib/routes-deprecated/fanfou/utils.js @@ -1,6 +1,6 @@ const logger = require('@/utils/logger'); const config = require('@/config').value; -const Fanfou = require('fanfou-sdk'); +import Fanfou from 'fanfou-sdk'; const consumerKey = config.fanfou.consumer_key; const consumerSecret = config.fanfou.consumer_secret; diff --git a/lib/routes.test.ts b/lib/routes.test.ts index a4fa40e2709ebb..4774ca7d4ad7a2 100644 --- a/lib/routes.test.ts +++ b/lib/routes.test.ts @@ -1,7 +1,6 @@ -import { describe, expect, it, afterAll, jest } from '@jest/globals'; +import { describe, expect, it, afterAll } from '@jest/globals'; process.env.SOCKET = 'socket'; -jest.mock('request-promise-native'); import app from '@/app'; import Parser from 'rss-parser'; const parser = new Parser(); diff --git a/lib/routes/bitbucket/commits.js b/lib/routes/bitbucket/commits.js index cae9c012144f64..8ea1fbe636cb81 100644 --- a/lib/routes/bitbucket/commits.js +++ b/lib/routes/bitbucket/commits.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { config } from '@/config'; -const queryString = require('query-string'); +import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; module.exports = async (ctx) => { diff --git a/lib/routes/bitbucket/tags.js b/lib/routes/bitbucket/tags.js index e123587d81c283..52d02438b36028 100644 --- a/lib/routes/bitbucket/tags.js +++ b/lib/routes/bitbucket/tags.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { config } from '@/config'; -const queryString = require('query-string'); +import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; module.exports = async (ctx) => { diff --git a/lib/routes/booru/mmda.js b/lib/routes/booru/mmda.js index d4c5d5c34ca936..68c9d00dc62b80 100644 --- a/lib/routes/booru/mmda.js +++ b/lib/routes/booru/mmda.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const queryString = require('query-string'); +import queryString from 'query-string'; import { load } from 'cheerio'; module.exports = async (ctx) => { diff --git a/lib/routes/github/file.js b/lib/routes/github/file.js index 97a023b50082f4..753ed8fe98e6e4 100644 --- a/lib/routes/github/file.js +++ b/lib/routes/github/file.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { config } from '@/config'; -const queryString = require('query-string'); +import queryString from 'query-string'; module.exports = async (ctx) => { const user = ctx.req.param('user'); diff --git a/lib/routes/github/issue.js b/lib/routes/github/issue.js index 92303c05df8d37..d53d9d1825f153 100644 --- a/lib/routes/github/issue.js +++ b/lib/routes/github/issue.js @@ -4,7 +4,7 @@ const md = require('markdown-it')({ html: true, linkify: true, }); -const queryString = require('query-string'); +import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; module.exports = async (ctx) => { diff --git a/lib/routes/github/repos.js b/lib/routes/github/repos.js index 77152893138141..96a0ca660b539f 100644 --- a/lib/routes/github/repos.js +++ b/lib/routes/github/repos.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { config } from '@/config'; -const queryString = require('query-string'); +import queryString from 'query-string'; module.exports = async (ctx) => { const user = ctx.req.param('user'); diff --git a/lib/routes/mckinsey/cn/index.js b/lib/routes/mckinsey/cn/index.js index 410c151a11de01..e1fa7195936492 100644 --- a/lib/routes/mckinsey/cn/index.js +++ b/lib/routes/mckinsey/cn/index.js @@ -1,7 +1,7 @@ // use stock `got` package as a workaround for // https://github.com/DIYgod/RSSHub/issues/8239 // https://github.com/DIYgod/RSSHub/pull/8288 -const got = require('got'); +import got from 'got'; import { parseDate } from '@/utils/parse-date'; const { categories } = require('./category-map'); diff --git a/lib/routes/pixiv/api/get-bookmarks.js b/lib/routes/pixiv/api/get-bookmarks.js index 07b5f5be43cda5..fc620c88905ec4 100644 --- a/lib/routes/pixiv/api/get-bookmarks.js +++ b/lib/routes/pixiv/api/get-bookmarks.js @@ -1,6 +1,6 @@ const got = require('../pixiv-got'); const maskHeader = require('../constants').maskHeader; -const queryString = require('query-string'); +import queryString from 'query-string'; /** * 获取用户的收藏 diff --git a/lib/routes/pixiv/api/get-illust-follows.js b/lib/routes/pixiv/api/get-illust-follows.js index 6c492edcdbe2ca..b4cdc12ee83c45 100644 --- a/lib/routes/pixiv/api/get-illust-follows.js +++ b/lib/routes/pixiv/api/get-illust-follows.js @@ -1,6 +1,6 @@ const got = require('../pixiv-got'); const maskHeader = require('../constants').maskHeader; -const queryString = require('query-string'); +import queryString from 'query-string'; /** * 获取用户关注的画师们的最新插画 diff --git a/lib/routes/pixiv/api/get-illusts.js b/lib/routes/pixiv/api/get-illusts.js index d27e29c314b011..29a4cae2d3ff29 100644 --- a/lib/routes/pixiv/api/get-illusts.js +++ b/lib/routes/pixiv/api/get-illusts.js @@ -1,6 +1,6 @@ const got = require('../pixiv-got'); const maskHeader = require('../constants').maskHeader; -const queryString = require('query-string'); +import queryString from 'query-string'; /** * 获取用户插画作品 diff --git a/lib/routes/pixiv/api/get-ranking.js b/lib/routes/pixiv/api/get-ranking.js index 7f5ad0339d42ed..cb42c19672cff8 100644 --- a/lib/routes/pixiv/api/get-ranking.js +++ b/lib/routes/pixiv/api/get-ranking.js @@ -1,7 +1,7 @@ const got = require('../pixiv-got'); const maskHeader = require('../constants').maskHeader; const assert = require('assert'); -const queryString = require('query-string'); +import queryString from 'query-string'; const allowMode = new Set(['day', 'week', 'month', 'day_male', 'day_female', 'day_ai', 'week_original', 'week_rookie', 'day_r18', 'day_r18_ai', 'day_male_r18', 'day_female_r18', 'week_r18', 'week_r18g']); diff --git a/lib/routes/pixiv/api/get-user-detail.js b/lib/routes/pixiv/api/get-user-detail.js index abc51ad47b8bef..7cf4a2d79af6aa 100644 --- a/lib/routes/pixiv/api/get-user-detail.js +++ b/lib/routes/pixiv/api/get-user-detail.js @@ -1,6 +1,6 @@ const got = require('../pixiv-got'); const maskHeader = require('../constants').maskHeader; -const queryString = require('query-string'); +import queryString from 'query-string'; /** * pixiv 用户 diff --git a/lib/routes/pixiv/api/search-illust.js b/lib/routes/pixiv/api/search-illust.js index fcc839402b87cb..8cb05bd61eee5f 100644 --- a/lib/routes/pixiv/api/search-illust.js +++ b/lib/routes/pixiv/api/search-illust.js @@ -1,6 +1,6 @@ const got = require('../pixiv-got'); const maskHeader = require('../constants').maskHeader; -const queryString = require('query-string'); +import queryString from 'query-string'; /** * 按时间排序搜索内容 diff --git a/lib/routes/pixiv/api/search-popular-illust.js b/lib/routes/pixiv/api/search-popular-illust.js index a13dab4661a8b4..01c665715ff77c 100644 --- a/lib/routes/pixiv/api/search-popular-illust.js +++ b/lib/routes/pixiv/api/search-popular-illust.js @@ -1,6 +1,6 @@ const got = require('../pixiv-got'); const maskHeader = require('../constants').maskHeader; -const queryString = require('query-string'); +import queryString from 'query-string'; /** * 按热门排序搜索内容 diff --git a/lib/routes/pixiv/pixiv-got.js b/lib/routes/pixiv/pixiv-got.js index 4e36754ac3bf34..b2862c3c702370 100644 --- a/lib/routes/pixiv/pixiv-got.js +++ b/lib/routes/pixiv/pixiv-got.js @@ -1,5 +1,5 @@ const tls = require('tls'); -const ipRegex = require('ip-regex'); +import ipRegex from 'ip-regex'; import got from '@/utils/got'; import logger from '@/utils/logger'; import { config } from '@/config'; diff --git a/lib/routes/saraba1st/thread.js b/lib/routes/saraba1st/thread.js index a74ca52bc33c2b..386b590091ac5a 100644 --- a/lib/routes/saraba1st/thread.js +++ b/lib/routes/saraba1st/thread.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -const queryString = require('query-string'); +import queryString from 'query-string'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/twitter/web-api/twitter-api.js b/lib/routes/twitter/web-api/twitter-api.js index 17559443991656..d1675d233a8555 100644 --- a/lib/routes/twitter/web-api/twitter-api.js +++ b/lib/routes/twitter/web-api/twitter-api.js @@ -4,7 +4,7 @@ import logger from '@/utils/logger'; import got from '@/utils/got'; const OAuth = require('oauth-1.0a'); const CryptoJS = require('crypto-js'); -const queryString = require('query-string'); +import queryString from 'query-string'; const { getToken } = require('./token'); import cache from '@/utils/cache'; diff --git a/lib/routes/weibo/super-index.js b/lib/routes/weibo/super-index.js index be2828655873c6..185d396a4c9eb7 100644 --- a/lib/routes/weibo/super-index.js +++ b/lib/routes/weibo/super-index.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const weiboUtils = require('./utils'); -const queryString = require('query-string'); +import queryString from 'query-string'; import { config } from '@/config'; module.exports = async (ctx) => { diff --git a/lib/routes/xueqiu/favorite.js b/lib/routes/xueqiu/favorite.js index 86586cd6910f32..dfd2a698aeae29 100644 --- a/lib/routes/xueqiu/favorite.js +++ b/lib/routes/xueqiu/favorite.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const queryString = require('query-string'); +import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; module.exports = async (ctx) => { diff --git a/lib/routes/xueqiu/hots.js b/lib/routes/xueqiu/hots.js index f6c031b8dc54d3..f0afea7189c800 100644 --- a/lib/routes/xueqiu/hots.js +++ b/lib/routes/xueqiu/hots.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const queryString = require('query-string'); +import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; const sanitizeHtml = require('sanitize-html'); diff --git a/lib/routes/xueqiu/stock-info.js b/lib/routes/xueqiu/stock-info.js index a94c100e6993c6..98e97f48940b30 100644 --- a/lib/routes/xueqiu/stock-info.js +++ b/lib/routes/xueqiu/stock-info.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -const queryString = require('query-string'); +import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; const sanitizeHtml = require('sanitize-html'); diff --git a/lib/routes/xueqiu/user-stock.js b/lib/routes/xueqiu/user-stock.js index 838d47f38f566b..5471b6a35593d2 100644 --- a/lib/routes/xueqiu/user-stock.js +++ b/lib/routes/xueqiu/user-stock.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const queryString = require('query-string'); +import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; module.exports = async (ctx) => { diff --git a/lib/routes/xueqiu/user.js b/lib/routes/xueqiu/user.js index 7eb29e6699c542..f2a758e84b6b02 100644 --- a/lib/routes/xueqiu/user.js +++ b/lib/routes/xueqiu/user.js @@ -1,6 +1,6 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; -const queryString = require('query-string'); +import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; const sanitizeHtml = require('sanitize-html'); diff --git a/lib/utils/got.ts b/lib/utils/got.ts index 1175da79a564b6..cd766f3f0fefe8 100644 --- a/lib/utils/got.ts +++ b/lib/utils/got.ts @@ -59,7 +59,9 @@ const custom: typeof got & { headers: { 'user-agent': config.ua, }, - timeout: config.requestTimeout, + timeout: { + request: config.requestTimeout, + }, }); custom.all = (list) => Promise.all(list); diff --git a/package.json b/package.json index 4d712ac1fe43b2..3a7585c0c837ef 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@koa/router": "12.0.1", "@notionhq/client": "2.2.14", "@postlight/parser": "2.2.3", - "@sentry/node": "7.103.0", + "@sentry/node": "7.104.0", "@tonyrl/rand-user-agent": "2.0.52", "@types/node": "20.11.24", "aes-js": "3.1.2", @@ -92,15 +92,15 @@ "city-timezones": "1.2.1", "crypto-js": "4.2.0", "currency-symbol-map": "5.1.0", - "dayjs": "1.11.8", + "dayjs": "1.11.10", "directory-import": "3.2.1", "dotenv": "16.4.5", "entities": "4.5.0", "etag": "1.8.1", - "fanfou-sdk": "4.2.0", + "fanfou-sdk": "5.0.0", "git-rev-sync": "3.0.2", "googleapis": "133.0.0", - "got": "11.8.6", + "got": "14.2.0", "hono": "4.0.8", "html-to-text": "9.0.5", "https-proxy-agent": "7.0.4", @@ -109,7 +109,7 @@ "instagram-private-api": "1.45.3", "ioredis": "5.3.2", "ip": "2.0.1", - "ip-regex": "4.3.0", + "ip-regex": "5.0.0", "jsdom": "24.0.0", "json-bigint": "1.0.0", "json5": "2.2.3", @@ -135,7 +135,7 @@ "puppeteer-extra-plugin-stealth": "2.11.2", "puppeteer-extra-plugin-user-data-dir": "2.4.1", "puppeteer-extra-plugin-user-preferences": "2.4.1", - "query-string": "7.1.3", + "query-string": "9.0.0", "re2js": "0.4.1", "require-all": "3.0.0", "rfc4648": "1.5.3", @@ -216,7 +216,6 @@ "remark-pangu": "2.2.0", "remark-parse": "9.0.0", "remark-preset-prettier": "0.5.1", - "request-promise-native": "1.0.9", "staged-git-files": "1.3.0", "string-width": "7.1.0", "supertest": "6.3.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 92c35181465077..757e989fc8f2de 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,8 +21,8 @@ dependencies: specifier: 2.2.3 version: 2.2.3 '@sentry/node': - specifier: 7.103.0 - version: 7.103.0 + specifier: 7.104.0 + version: 7.104.0 '@tonyrl/rand-user-agent': specifier: 2.0.52 version: 2.0.52 @@ -54,8 +54,8 @@ dependencies: specifier: 5.1.0 version: 5.1.0 dayjs: - specifier: 1.11.8 - version: 1.11.8 + specifier: 1.11.10 + version: 1.11.10 directory-import: specifier: 3.2.1 version: 3.2.1 @@ -69,8 +69,8 @@ dependencies: specifier: 1.8.1 version: 1.8.1 fanfou-sdk: - specifier: 4.2.0 - version: 4.2.0 + specifier: 5.0.0 + version: 5.0.0 git-rev-sync: specifier: 3.0.2 version: 3.0.2 @@ -78,8 +78,8 @@ dependencies: specifier: 133.0.0 version: 133.0.0 got: - specifier: 11.8.6 - version: 11.8.6 + specifier: 14.2.0 + version: 14.2.0 hono: specifier: 4.0.8 version: 4.0.8 @@ -105,8 +105,8 @@ dependencies: specifier: 2.0.1 version: 2.0.1 ip-regex: - specifier: 4.3.0 - version: 4.3.0 + specifier: 5.0.0 + version: 5.0.0 jsdom: specifier: 24.0.0 version: 24.0.0 @@ -183,8 +183,8 @@ dependencies: specifier: 2.4.1 version: 2.4.1(puppeteer-extra@3.3.6) query-string: - specifier: 7.1.3 - version: 7.1.3 + specifier: 9.0.0 + version: 9.0.0 re2js: specifier: 0.4.1 version: 0.4.1 @@ -243,10 +243,10 @@ dependencies: devDependencies: '@babel/preset-env': specifier: 7.24.0 - version: 7.24.0(@babel/core@7.23.9) + version: 7.24.0(@babel/core@7.24.0) '@babel/preset-typescript': specifier: 7.23.3 - version: 7.23.3(@babel/core@7.23.9) + version: 7.23.3(@babel/core@7.24.0) '@jest/globals': specifier: 29.7.0 version: 29.7.0 @@ -421,9 +421,6 @@ devDependencies: remark-preset-prettier: specifier: 0.5.1 version: 0.5.1(prettier@3.2.5) - request-promise-native: - specifier: 1.0.9 - version: 1.0.9(request@2.88.2) staged-git-files: specifier: 1.3.0 version: 1.3.0 @@ -441,7 +438,7 @@ devDependencies: version: 2.0.0-alpha.3 ts-jest: specifier: 29.1.2 - version: 29.1.2(@babel/core@7.23.9)(jest@29.7.0)(typescript@5.3.3) + version: 29.1.2(@babel/core@7.24.0)(jest@29.7.0)(typescript@5.3.3) typescript: specifier: 5.3.3 version: 5.3.3 @@ -470,6 +467,14 @@ packages: '@jridgewell/trace-mapping': 0.3.22 dev: true + /@ampproject/remapping@2.3.0: + resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.24 + dev: true + /@babel/code-frame@7.0.0: resolution: {integrity: sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==} dependencies: @@ -511,6 +516,29 @@ packages: - supports-color dev: true + /@babel/core@7.24.0: + resolution: {integrity: sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.3.0 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.6 + '@babel/helper-compilation-targets': 7.23.6 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.0) + '@babel/helpers': 7.24.0 + '@babel/parser': 7.24.0 + '@babel/template': 7.24.0 + '@babel/traverse': 7.24.0 + '@babel/types': 7.24.0 + convert-source-map: 2.0.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/generator@7.23.6: resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==} engines: {node: '>=6.9.0'} @@ -546,42 +574,42 @@ packages: semver: 6.3.1 dev: true - /@babel/helper-create-class-features-plugin@7.24.0(@babel/core@7.23.9): + /@babel/helper-create-class-features-plugin@7.24.0(@babel/core@7.24.0): resolution: {integrity: sha512-QAH+vfvts51BCsNZ2PhY6HAggnlS6omLLFTsIpeqZk/MmJ6cW7tgz5yRv0fMJThcr6FmbMrENh1RgrWPTYA76g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 '@babel/helper-member-expression-to-functions': 7.23.0 '@babel/helper-optimise-call-expression': 7.22.5 - '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.9) + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.24.0) '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 semver: 6.3.1 dev: true - /@babel/helper-create-regexp-features-plugin@7.22.15(@babel/core@7.23.9): + /@babel/helper-create-regexp-features-plugin@7.22.15(@babel/core@7.24.0): resolution: {integrity: sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-annotate-as-pure': 7.22.5 regexpu-core: 5.3.2 semver: 6.3.1 dev: true - /@babel/helper-define-polyfill-provider@0.5.0(@babel/core@7.23.9): + /@babel/helper-define-polyfill-provider@0.5.0(@babel/core@7.24.0): resolution: {integrity: sha512-NovQquuQLAQ5HuyjCz7WQP9MjRj7dx++yspwiyUiGl9ZyadHRSql1HZh5ogRd8W8w6YM6EQ/NTB8rgjLt5W65Q==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-plugin-utils': 7.24.0 debug: 4.3.4 @@ -639,6 +667,20 @@ packages: '@babel/helper-validator-identifier': 7.22.20 dev: true + /@babel/helper-module-transforms@7.23.3(@babel/core@7.24.0): + resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 + dev: true + /@babel/helper-optimise-call-expression@7.22.5: resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} engines: {node: '>=6.9.0'} @@ -656,25 +698,25 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-remap-async-to-generator@7.22.20(@babel/core@7.23.9): + /@babel/helper-remap-async-to-generator@7.22.20(@babel/core@7.24.0): resolution: {integrity: sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-wrap-function': 7.22.20 dev: true - /@babel/helper-replace-supers@7.22.20(@babel/core@7.23.9): + /@babel/helper-replace-supers@7.22.20(@babel/core@7.24.0): resolution: {integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-member-expression-to-functions': 7.23.0 '@babel/helper-optimise-call-expression': 7.22.5 @@ -735,6 +777,17 @@ packages: - supports-color dev: true + /@babel/helpers@7.24.0: + resolution: {integrity: sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.24.0 + '@babel/traverse': 7.24.0 + '@babel/types': 7.24.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/highlight@7.23.4: resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} engines: {node: '>=6.9.0'} @@ -751,46 +804,54 @@ packages: '@babel/types': 7.23.9 dev: true - /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.23.3(@babel/core@7.23.9): + /@babel/parser@7.24.0: + resolution: {integrity: sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.24.0 + dev: true + + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.23.3(@babel/core@7.23.9): + /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.13.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.23.9) + '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.24.0) dev: true - /@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.23.7(@babel/core@7.23.9): + /@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.23.7(@babel/core@7.24.0): resolution: {integrity: sha512-LlRT7HgaifEpQA1ZgLVOIJZZFVPWN5iReq/7/JixwBtwcoeVGDBD53ZV28rrsLYOZs1Y/EHhA8N/Z6aazHR8cw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.9): + /@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.24.0): resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 dev: true /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.23.9): @@ -802,6 +863,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.0): + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.23.9): resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: @@ -820,51 +890,60 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.23.9): + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.0): + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + + /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.24.0): resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.23.9): + /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.24.0): resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.23.9): + /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.24.0): resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-import-assertions@7.23.3(@babel/core@7.23.9): + /@babel/plugin-syntax-import-assertions@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-import-attributes@7.23.3(@babel/core@7.23.9): + /@babel/plugin-syntax-import-attributes@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true @@ -877,6 +956,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.0): + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.23.9): resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: @@ -886,6 +974,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.0): + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.23.9): resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} engines: {node: '>=6.9.0'} @@ -896,6 +993,16 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: true + /@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.24.0): + resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.23.9): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: @@ -905,6 +1012,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.0): + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.23.9): resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: @@ -914,6 +1030,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.0): + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.23.9): resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: @@ -923,6 +1048,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.0): + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.23.9): resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: @@ -932,6 +1066,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.0): + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.23.9): resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: @@ -941,6 +1084,15 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.0): + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.23.9): resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: @@ -950,13 +1102,22 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.23.9): + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.0): + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + + /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.24.0): resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true @@ -970,6 +1131,16 @@ packages: '@babel/helper-plugin-utils': 7.24.0 dev: true + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.0): + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.24.0 + dev: true + /@babel/plugin-syntax-typescript@7.23.3(@babel/core@7.23.9): resolution: {integrity: sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==} engines: {node: '>=6.9.0'} @@ -980,676 +1151,686 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.23.9): + /@babel/plugin-syntax-typescript@7.23.3(@babel/core@7.24.0): + resolution: {integrity: sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.24.0 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.24.0): resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-arrow-functions@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-arrow-functions@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-async-generator-functions@7.23.9(@babel/core@7.23.9): + /@babel/plugin-transform-async-generator-functions@7.23.9(@babel/core@7.24.0): resolution: {integrity: sha512-8Q3veQEDGe14dTYuwagbRtwxQDnytyg1JFu4/HwEMETeofocrB0U0ejBJIXoeG/t2oXZ8kzCyI0ZZfbT80VFNQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.9) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.9) + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.24.0) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-async-to-generator@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-async-to-generator@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-module-imports': 7.22.15 '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.9) + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-block-scoped-functions@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-block-scoped-functions@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-block-scoping@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-block-scoping@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-class-properties@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-class-properties@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-class-static-block@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-class-static-block@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.12.0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.9) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-classes@7.23.8(@babel/core@7.23.9): + /@babel/plugin-transform-classes@7.23.8(@babel/core@7.24.0): resolution: {integrity: sha512-yAYslGsY1bX6Knmg46RjiCiNSwJKv2IUC8qOdYKqMMr0491SXFhcHqOdRDeCRohOOIzwN/90C6mQ9qAKgrP7dg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.9) + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.24.0) '@babel/helper-split-export-declaration': 7.22.6 globals: 11.12.0 dev: true - /@babel/plugin-transform-computed-properties@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-computed-properties@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 '@babel/template': 7.23.9 dev: true - /@babel/plugin-transform-destructuring@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-destructuring@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-dotall-regex@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-dotall-regex@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-duplicate-keys@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-duplicate-keys@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-dynamic-import@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-dynamic-import@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.9) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-exponentiation-operator@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-exponentiation-operator@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.15 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-export-namespace-from@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-export-namespace-from@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.9) + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-for-of@7.23.6(@babel/core@7.23.9): + /@babel/plugin-transform-for-of@7.23.6(@babel/core@7.24.0): resolution: {integrity: sha512-aYH4ytZ0qSuBbpfhuofbg/e96oQ7U2w1Aw/UQmKT+1l39uEhUPoFS3fHevDc1G0OvewyDudfMKY1OulczHzWIw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 dev: true - /@babel/plugin-transform-function-name@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-function-name@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-function-name': 7.23.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-json-strings@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-json-strings@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.9) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-literals@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-literals@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-logical-assignment-operators@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-logical-assignment-operators@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.9) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-member-expression-literals@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-member-expression-literals@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-modules-amd@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-modules-amd@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-simple-access': 7.22.5 dev: true - /@babel/plugin-transform-modules-systemjs@7.23.9(@babel/core@7.23.9): + /@babel/plugin-transform-modules-systemjs@7.23.9(@babel/core@7.24.0): resolution: {integrity: sha512-KDlPRM6sLo4o1FkiSlXoAa8edLXFsKKIda779fbLrvmeuc3itnjCtaO6RrtoaANsIJANj+Vk1zqbZIMhkCAHVw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.9) + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-validator-identifier': 7.22.20 dev: true - /@babel/plugin-transform-modules-umd@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-modules-umd@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-named-capturing-groups-regex@7.22.5(@babel/core@7.23.9): + /@babel/plugin-transform-named-capturing-groups-regex@7.22.5(@babel/core@7.24.0): resolution: {integrity: sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-new-target@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-new-target@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-nullish-coalescing-operator@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-nullish-coalescing-operator@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.9) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-numeric-separator@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-numeric-separator@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.9) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-object-rest-spread@7.24.0(@babel/core@7.23.9): + /@babel/plugin-transform-object-rest-spread@7.24.0(@babel/core@7.24.0): resolution: {integrity: sha512-y/yKMm7buHpFFXfxVFS4Vk1ToRJDilIa6fKRioB9Vjichv58TDGXTvqV0dN7plobAmTW5eSEGXDngE+Mm+uO+w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/compat-data': 7.23.5 - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.9) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.0) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-object-super@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-object-super@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.9) + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-optional-catch-binding@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-optional-catch-binding@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.9) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-optional-chaining@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-optional-chaining@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.9) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-parameters@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-parameters@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-private-methods@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-private-methods@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-private-property-in-object@7.23.4(@babel/core@7.23.9): + /@babel/plugin-transform-private-property-in-object@7.23.4(@babel/core@7.24.0): resolution: {integrity: sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.23.9) + '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.9) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-property-literals@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-property-literals@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-regenerator@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-regenerator@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 regenerator-transform: 0.15.2 dev: true - /@babel/plugin-transform-reserved-words@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-reserved-words@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-shorthand-properties@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-shorthand-properties@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-spread@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-spread@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 dev: true - /@babel/plugin-transform-sticky-regex@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-sticky-regex@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-template-literals@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-template-literals@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-typeof-symbol@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-typeof-symbol@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-typescript@7.23.6(@babel/core@7.23.9): + /@babel/plugin-transform-typescript@7.23.6(@babel/core@7.24.0): resolution: {integrity: sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.23.9) + '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.23.9) + '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.24.0) dev: true - /@babel/plugin-transform-unicode-escapes@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-unicode-escapes@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-unicode-property-regex@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-unicode-property-regex@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-unicode-regex@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-unicode-regex@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-unicode-sets-regex@7.23.3(@babel/core@7.23.9): + /@babel/plugin-transform-unicode-sets-regex@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.0) '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/preset-env@7.24.0(@babel/core@7.23.9): + /@babel/preset-env@7.24.0(@babel/core@7.24.0): resolution: {integrity: sha512-ZxPEzV9IgvGn73iK0E6VB9/95Nd7aMFpbE0l8KQFDG70cOV9IxRP7Y2FUPmlK0v6ImlLqYX50iuZ3ZTVhOF2lA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/compat-data': 7.23.5 - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-validator-option': 7.23.5 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.23.7(@babel/core@7.23.9) - '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.9) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.9) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.9) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.9) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-import-assertions': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-syntax-import-attributes': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.9) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.23.9) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.23.9) - '@babel/plugin-transform-arrow-functions': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-async-generator-functions': 7.23.9(@babel/core@7.23.9) - '@babel/plugin-transform-async-to-generator': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-block-scoped-functions': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-block-scoping': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-class-properties': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-class-static-block': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-classes': 7.23.8(@babel/core@7.23.9) - '@babel/plugin-transform-computed-properties': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-destructuring': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-dotall-regex': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-duplicate-keys': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-dynamic-import': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-exponentiation-operator': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-export-namespace-from': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-for-of': 7.23.6(@babel/core@7.23.9) - '@babel/plugin-transform-function-name': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-json-strings': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-literals': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-logical-assignment-operators': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-member-expression-literals': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-modules-amd': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-modules-systemjs': 7.23.9(@babel/core@7.23.9) - '@babel/plugin-transform-modules-umd': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/core@7.23.9) - '@babel/plugin-transform-new-target': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-nullish-coalescing-operator': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-numeric-separator': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-object-rest-spread': 7.24.0(@babel/core@7.23.9) - '@babel/plugin-transform-object-super': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-optional-catch-binding': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-private-methods': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-private-property-in-object': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-transform-property-literals': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-regenerator': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-reserved-words': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-shorthand-properties': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-spread': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-sticky-regex': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-template-literals': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-typeof-symbol': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-unicode-escapes': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-unicode-property-regex': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-unicode-regex': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-unicode-sets-regex': 7.23.3(@babel/core@7.23.9) - '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.23.9) - babel-plugin-polyfill-corejs2: 0.4.8(@babel/core@7.23.9) - babel-plugin-polyfill-corejs3: 0.9.0(@babel/core@7.23.9) - babel-plugin-polyfill-regenerator: 0.5.5(@babel/core@7.23.9) + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.23.7(@babel/core@7.24.0) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.24.0) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.0) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.0) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.24.0) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.24.0) + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.24.0) + '@babel/plugin-syntax-import-assertions': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-syntax-import-attributes': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.0) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.0) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.0) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.0) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.0) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.0) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.0) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.0) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.0) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.0) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.24.0) + '@babel/plugin-transform-arrow-functions': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-async-generator-functions': 7.23.9(@babel/core@7.24.0) + '@babel/plugin-transform-async-to-generator': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-block-scoped-functions': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-block-scoping': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-class-properties': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-class-static-block': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-classes': 7.23.8(@babel/core@7.24.0) + '@babel/plugin-transform-computed-properties': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-destructuring': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-dotall-regex': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-duplicate-keys': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-dynamic-import': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-exponentiation-operator': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-export-namespace-from': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-for-of': 7.23.6(@babel/core@7.24.0) + '@babel/plugin-transform-function-name': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-json-strings': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-literals': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-logical-assignment-operators': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-member-expression-literals': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-modules-amd': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-modules-systemjs': 7.23.9(@babel/core@7.24.0) + '@babel/plugin-transform-modules-umd': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/core@7.24.0) + '@babel/plugin-transform-new-target': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-nullish-coalescing-operator': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-numeric-separator': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-object-rest-spread': 7.24.0(@babel/core@7.24.0) + '@babel/plugin-transform-object-super': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-optional-catch-binding': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-private-methods': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-private-property-in-object': 7.23.4(@babel/core@7.24.0) + '@babel/plugin-transform-property-literals': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-regenerator': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-reserved-words': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-shorthand-properties': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-spread': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-sticky-regex': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-template-literals': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-typeof-symbol': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-unicode-escapes': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-unicode-property-regex': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-unicode-regex': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-unicode-sets-regex': 7.23.3(@babel/core@7.24.0) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.24.0) + babel-plugin-polyfill-corejs2: 0.4.8(@babel/core@7.24.0) + babel-plugin-polyfill-corejs3: 0.9.0(@babel/core@7.24.0) + babel-plugin-polyfill-regenerator: 0.5.5(@babel/core@7.24.0) core-js-compat: 3.36.0 semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.23.9): + /@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.24.0): resolution: {integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==} peerDependencies: '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 '@babel/types': 7.23.9 esutils: 2.0.3 dev: true - /@babel/preset-typescript@7.23.3(@babel/core@7.23.9): + /@babel/preset-typescript@7.23.3(@babel/core@7.24.0): resolution: {integrity: sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-validator-option': 7.23.5 - '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-typescript': 7.23.6(@babel/core@7.23.9) + '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.24.0) + '@babel/plugin-transform-typescript': 7.23.6(@babel/core@7.24.0) dev: true /@babel/regjsgen@0.8.0: @@ -1680,6 +1861,15 @@ packages: '@babel/types': 7.23.9 dev: true + /@babel/template@7.24.0: + resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/parser': 7.24.0 + '@babel/types': 7.24.0 + dev: true + /@babel/traverse@7.23.9: resolution: {integrity: sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==} engines: {node: '>=6.9.0'} @@ -1698,6 +1888,24 @@ packages: - supports-color dev: true + /@babel/traverse@7.24.0: + resolution: {integrity: sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.6 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.24.0 + '@babel/types': 7.24.0 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/types@7.23.9: resolution: {integrity: sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==} engines: {node: '>=6.9.0'} @@ -1707,6 +1915,15 @@ packages: to-fast-properties: 2.0.0 dev: true + /@babel/types@7.24.0: + resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: true + /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true @@ -2258,6 +2475,15 @@ packages: '@jridgewell/trace-mapping': 0.3.22 dev: true + /@jridgewell/gen-mapping@0.3.5: + resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.2.1 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.24 + dev: true + /@jridgewell/resolve-uri@3.1.2: resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} @@ -2268,6 +2494,11 @@ packages: engines: {node: '>=6.0.0'} dev: true + /@jridgewell/set-array@1.2.1: + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} + engines: {node: '>=6.0.0'} + dev: true + /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true @@ -2279,6 +2510,13 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true + /@jridgewell/trace-mapping@0.3.24: + resolution: {integrity: sha512-+VaWXDa6+l6MhflBvVXjIEAzb59nQ2JUK3bwRp2zRpPtU+8TFRy9Gg/5oIcNlkEL5PGlBFGfemUVvIgLnTzq7Q==} + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + /@koa/router@12.0.1: resolution: {integrity: sha512-ribfPYfHb+Uw3b27Eiw6NPqjhIhTpVFzEWLwyc/1Xp+DCdwRRyIlAUODX+9bPARF6aQtUu1+/PHzdNvRzcs/+Q==} engines: {node: '>= 12'} @@ -2489,57 +2727,57 @@ packages: selderee: 0.11.0 dev: false - /@sentry-internal/tracing@7.103.0: - resolution: {integrity: sha512-sZ/Wao8HOvGaBs7WlOdflMpHGAFkOBWL6hBiirHaOy5d+IDm7n7et5U6zhvcfiyYBO4nY36gy1Tg5mw+aNO0Vw==} + /@sentry-internal/tracing@7.104.0: + resolution: {integrity: sha512-2z7OijM1J5ndJUiJJElC3iH9qb/Eb8eYm2v8oJhM8WVdc5uCKfrQuYHNgGOnmY2FOCfEUlTmMQGpDw7DJ67L5w==} engines: {node: '>=8'} dependencies: - '@sentry/core': 7.103.0 - '@sentry/types': 7.103.0 - '@sentry/utils': 7.103.0 + '@sentry/core': 7.104.0 + '@sentry/types': 7.104.0 + '@sentry/utils': 7.104.0 dev: false - /@sentry/core@7.103.0: - resolution: {integrity: sha512-LCI+PIDoF/RLqN41fNXum3ilmS6ukni6L7t38vSdibbe2G0804EbPLtOIpv2PkS8E6CFuRW5zOb+8OwEAAtZWw==} + /@sentry/core@7.104.0: + resolution: {integrity: sha512-XPndD6IGQGd07/EntvYVzOWQUo/Gd7L3DwYFeEKeBv6ByWjbBNmVZFRhU0GPPsCHKyW9yMU9OO9diLSS4ijsRg==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.103.0 - '@sentry/utils': 7.103.0 + '@sentry/types': 7.104.0 + '@sentry/utils': 7.104.0 dev: false - /@sentry/node@7.103.0: - resolution: {integrity: sha512-/bS/WNeO+PEd0r3o3LN0XGJV+l7hLNy1dTcn61VRgWGVs8SqMBb3uAvXAibZ9zGTCkaX/Ky3JumMcOOoxmNCtg==} + /@sentry/node@7.104.0: + resolution: {integrity: sha512-Ixt8qg6IV8gywi4+H1cAtQeglAAww2nwLHybCxAvnu3czdF8w7ifF+o5BY1FmO5UYVCAfr8vEb+XG4CuRrFb7g==} engines: {node: '>=8'} dependencies: - '@sentry-internal/tracing': 7.103.0 - '@sentry/core': 7.103.0 - '@sentry/types': 7.103.0 - '@sentry/utils': 7.103.0 + '@sentry-internal/tracing': 7.104.0 + '@sentry/core': 7.104.0 + '@sentry/types': 7.104.0 + '@sentry/utils': 7.104.0 dev: false - /@sentry/types@7.103.0: - resolution: {integrity: sha512-NCvKyx8d2AGBQKPARrJemZmZ16DiMo688OEikZg4BbvFNDUzK5Egm2BH0vfLDhbNkU19o3maJowrYo42m8r9Zw==} + /@sentry/types@7.104.0: + resolution: {integrity: sha512-5bs0xe0+GZR4QBm9Nrqw59o0sv3kBtCosrZDVxBru/dQbrfnB+/kVorvuM0rV3+coNITTKcKDegSZmK1d2uOGQ==} engines: {node: '>=8'} dev: false - /@sentry/utils@7.103.0: - resolution: {integrity: sha512-phkUJt3F0UOkVq+M4GfdAh2ewI3ASrNiJddx9aO7GnT0aDwwVBHZltnqt95qgAB8W+BipTSt1dAh8yUbbq1Ceg==} + /@sentry/utils@7.104.0: + resolution: {integrity: sha512-ZVg+xZirI9DlOi0NegNVocswdh/8p6QkzlQzDQY2LP2CC6JQdmwi64o0S4rPH4YIHNKQJTpIjduoxeKgd1EO5g==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.103.0 + '@sentry/types': 7.104.0 dev: false /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true - /@sindresorhus/is@2.1.1: - resolution: {integrity: sha512-/aPsuoj/1Dw/kzhkgz+ES6TxG0zfTMGLwuK2ZG00k/iJzYHTLCE8mVU8EPqEOp/lmxPoq1C1C9RYToRKb2KEfg==} - engines: {node: '>=10'} + /@sindresorhus/is@5.6.0: + resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} + engines: {node: '>=14.16'} dev: false - /@sindresorhus/is@4.6.0: - resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} - engines: {node: '>=10'} + /@sindresorhus/is@6.2.0: + resolution: {integrity: sha512-yM/IGPkVnYGblhDosFBwq0ZGdnVSBkNV4onUtipGMOjZd4kB6GAu3ys91aftSbyMHh6A2GPdt+KDI5NoWP63MQ==} + engines: {node: '>=16'} dev: false /@sinonjs/commons@3.0.1: @@ -2568,9 +2806,9 @@ packages: espree: 9.6.1 dev: true - /@szmarczak/http-timer@4.0.6: - resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} - engines: {node: '>=10'} + /@szmarczak/http-timer@5.0.1: + resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} + engines: {node: '>=14.16'} dependencies: defer-to-connect: 2.0.1 dev: false @@ -2640,15 +2878,6 @@ packages: '@types/node': 20.11.24 dev: true - /@types/cacheable-request@6.0.3: - resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} - dependencies: - '@types/http-cache-semantics': 4.0.4 - '@types/keyv': 3.1.4 - '@types/node': 20.11.24 - '@types/responselike': 1.0.3 - dev: false - /@types/caseless@0.12.5: resolution: {integrity: sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==} @@ -2820,12 +3049,6 @@ packages: resolution: {integrity: sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==} dev: true - /@types/keyv@3.1.4: - resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} - dependencies: - '@types/node': 20.11.24 - dev: false - /@types/koa-basic-auth@2.0.6: resolution: {integrity: sha512-1/FdT3KiHIkVf+TxYiPPey0wnPBzuts6lz/Obskgo9ZY485J02+uI6STnD114L2iG+Wi5MBqU7EYNphKdKwZWQ==} dependencies: @@ -2995,12 +3218,6 @@ packages: resolution: {integrity: sha512-93iiG8N8kovFL08oenE76F7adIE00uzTdGV7FlFE9uPDtZ2f3pSuOS0ICWjG9OMhsn38eJjhf5CKFp9s7fzz/A==} dev: true - /@types/responselike@1.0.3: - resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} - dependencies: - '@types/node': 20.11.24 - dev: false - /@types/semver@7.5.8: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true @@ -3449,10 +3666,12 @@ packages: resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} dependencies: safer-buffer: 2.1.2 + dev: false /assert-plus@1.0.0: resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} engines: {node: '>=0.8'} + dev: false /ast-types@0.13.4: resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==} @@ -3485,9 +3704,11 @@ packages: /aws-sign2@0.7.0: resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==} + dev: false /aws4@1.12.0: resolution: {integrity: sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==} + dev: false /b4a@1.6.6: resolution: {integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==} @@ -3534,38 +3755,38 @@ packages: '@types/babel__traverse': 7.20.5 dev: true - /babel-plugin-polyfill-corejs2@0.4.8(@babel/core@7.23.9): + /babel-plugin-polyfill-corejs2@0.4.8(@babel/core@7.24.0): resolution: {integrity: sha512-OtIuQfafSzpo/LhnJaykc0R/MMnuLSSVjVYy9mHArIZ9qTCSZ6TpWCuEKZYVoN//t8HqBNScHrOtCrIK5IaGLg==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: '@babel/compat-data': 7.23.5 - '@babel/core': 7.23.9 - '@babel/helper-define-polyfill-provider': 0.5.0(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-define-polyfill-provider': 0.5.0(@babel/core@7.24.0) semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /babel-plugin-polyfill-corejs3@0.9.0(@babel/core@7.23.9): + /babel-plugin-polyfill-corejs3@0.9.0(@babel/core@7.24.0): resolution: {integrity: sha512-7nZPG1uzK2Ymhy/NbaOWTg3uibM2BmGASS4vHS4szRZAIR8R6GwA/xAujpdrXU5iyklrimWnLWU+BLF9suPTqg==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-define-polyfill-provider': 0.5.0(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-define-polyfill-provider': 0.5.0(@babel/core@7.24.0) core-js-compat: 3.36.0 transitivePeerDependencies: - supports-color dev: true - /babel-plugin-polyfill-regenerator@0.5.5(@babel/core@7.23.9): + /babel-plugin-polyfill-regenerator@0.5.5(@babel/core@7.24.0): resolution: {integrity: sha512-OJGYZlhLqBh2DDHeqAxWB1XIvr49CxiJ2gIt61/PU55CQK4Z58OzMqjDe1zwQdQk+rBYsRc+1rJmdajM3gimHg==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-define-polyfill-provider': 0.5.0(@babel/core@7.23.9) + '@babel/core': 7.24.0 + '@babel/helper-define-polyfill-provider': 0.5.0(@babel/core@7.24.0) transitivePeerDependencies: - supports-color dev: true @@ -3618,8 +3839,8 @@ packages: dev: false optional: true - /bare-fs@2.1.5: - resolution: {integrity: sha512-5t0nlecX+N2uJqdxe9d18A98cp2u9BETelbjKpiVgQqzzmVNFYWEAjQHqS+2Khgto1vcwhik9cXucaj5ve2WWA==} + /bare-fs@2.2.1: + resolution: {integrity: sha512-+CjmZANQDFZWy4PGbVdmALIwmt33aJg8qTkVjClU6X4WmZkTPBDxRHiBn7fpqEWEfF3AC2io++erpViAIQbSjg==} requiresBuild: true dependencies: bare-events: 2.2.0 @@ -3666,6 +3887,7 @@ packages: resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} dependencies: tweetnacl: 0.14.5 + dev: false /big-integer@1.6.52: resolution: {integrity: sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==} @@ -3803,30 +4025,22 @@ packages: ylru: 1.3.2 dev: false - /cacheable-lookup@2.0.1: - resolution: {integrity: sha512-EMMbsiOTcdngM/K6gV/OxF2x0t07+vMOWxZNSCRQMjO2MY2nhZQ6OYhOOpyQrbhqsgtvKGI7hcq6xjnA92USjg==} - engines: {node: '>=10'} - dependencies: - '@types/keyv': 3.1.4 - keyv: 4.5.4 - dev: false - - /cacheable-lookup@5.0.4: - resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} - engines: {node: '>=10.6.0'} + /cacheable-lookup@7.0.0: + resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} + engines: {node: '>=14.16'} dev: false - /cacheable-request@7.0.4: - resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==} - engines: {node: '>=8'} + /cacheable-request@10.2.14: + resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} + engines: {node: '>=14.16'} dependencies: - clone-response: 1.0.3 - get-stream: 5.2.0 + '@types/http-cache-semantics': 4.0.4 + get-stream: 6.0.1 http-cache-semantics: 4.1.1 keyv: 4.5.4 - lowercase-keys: 2.0.0 - normalize-url: 6.1.0 - responselike: 2.0.1 + mimic-response: 4.0.0 + normalize-url: 8.0.0 + responselike: 3.0.0 dev: false /call-bind@1.0.7: @@ -3850,6 +4064,16 @@ packages: upper-case: 1.1.3 dev: false + /camelcase-keys@7.0.2: + resolution: {integrity: sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==} + engines: {node: '>=12'} + dependencies: + camelcase: 6.3.0 + map-obj: 4.3.0 + quick-lru: 5.1.1 + type-fest: 1.4.0 + dev: false + /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -3857,7 +4081,6 @@ packages: /camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - dev: true /caniuse-lite@1.0.30001587: resolution: {integrity: sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==} @@ -3865,6 +4088,7 @@ packages: /caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} + dev: false /ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -4017,7 +4241,7 @@ packages: resolution: {integrity: sha512-VJWqFN5rWmXVvXAxOD4i0jX8Tb4cLswaslyaAFhxM45zNXPsZleygPbgiaYBD7ORb9fj07zBgJb0Q6eKL+0iJg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: - dayjs: 1.11.8 + dayjs: 1.11.10 dev: false /ci-info@3.9.0: @@ -4117,12 +4341,6 @@ packages: shallow-clone: 0.1.2 dev: false - /clone-response@1.0.3: - resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} - dependencies: - mimic-response: 1.0.1 - dev: false - /clone@1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} @@ -4260,6 +4478,7 @@ packages: /core-util-is@1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} + dev: false /cosmiconfig@9.0.0(typescript@5.3.3): resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} @@ -4384,6 +4603,7 @@ packages: engines: {node: '>=0.10'} dependencies: assert-plus: 1.0.0 + dev: false /data-uri-to-buffer@6.0.2: resolution: {integrity: sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==} @@ -4398,8 +4618,8 @@ packages: whatwg-url: 14.0.0 dev: false - /dayjs@1.11.8: - resolution: {integrity: sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ==} + /dayjs@1.11.10: + resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} dev: false /debug@2.6.9: @@ -4435,6 +4655,14 @@ packages: dependencies: ms: 2.1.2 + /decamelize-keys@1.1.1: + resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} + engines: {node: '>=0.10.0'} + dependencies: + decamelize: 1.2.0 + map-obj: 1.0.1 + dev: false + /decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} @@ -4455,11 +4683,9 @@ packages: engines: {node: '>=0.10'} dev: false - /decompress-response@5.0.0: - resolution: {integrity: sha512-TLZWWybuxWgoW7Lykv+gq9xvzOsUjQ9tF09Tj6NSTYGMTCHNXzrPnD6Hi+TgZq19PyTAGH4Ll/NIM/eTGglnMw==} - engines: {node: '>=10'} - dependencies: - mimic-response: 2.1.0 + /decode-uri-component@0.4.1: + resolution: {integrity: sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==} + engines: {node: '>=14.16'} dev: false /decompress-response@6.0.0: @@ -4700,15 +4926,12 @@ packages: engines: {node: '>=6'} dev: false - /duplexer3@0.1.5: - resolution: {integrity: sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==} - dev: false - /ecc-jsbn@0.1.2: resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==} dependencies: jsbn: 0.1.1 safer-buffer: 2.1.2 + dev: false /ecdsa-sig-formatter@1.0.11: resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} @@ -5317,17 +5540,20 @@ packages: /extsprintf@1.3.0: resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} engines: {'0': node >=0.6.0} + dev: false - /fanfou-sdk@4.2.0: - resolution: {integrity: sha512-foL7p4ZtdLIJa7DtBYn/jhx2maQ++yYLcsaGDoWAAQ4FpAQ1Rv16e2vRtfFtgOln3FNE1SBnF8ChiYow9htjJw==} - engines: {node: '>=10'} + /fanfou-sdk@5.0.0: + resolution: {integrity: sha512-i/I3Py9A/JloJ6qU5HUvzo+iywiloGWOJ8MDzIjtNIr6rGZB5SBAzBDh29h7ybywRJZhdO2C+ZslqCk66Rl6ig==} + engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} dependencies: - form-data: 3.0.1 - got: 10.7.0 + camelcase-keys: 7.0.2 + decamelize-keys: 1.1.1 + form-data: 4.0.0 + got: 12.6.1 he: 1.2.0 hmacsha1: 1.0.0 oauth-1.0a: 2.2.6 - query-string: 6.14.1 + query-string: 7.1.3 dev: false /fast-deep-equal@3.1.3: @@ -5425,6 +5651,11 @@ packages: engines: {node: '>=0.10.0'} dev: false + /filter-obj@5.1.0: + resolution: {integrity: sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==} + engines: {node: '>=14.16'} + dev: false + /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -5477,6 +5708,17 @@ packages: /forever-agent@0.6.1: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} + dev: false + + /form-data-encoder@2.1.4: + resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} + engines: {node: '>= 14.17'} + dev: false + + /form-data-encoder@4.0.2: + resolution: {integrity: sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==} + engines: {node: '>= 18'} + dev: false /form-data@2.3.3: resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} @@ -5485,6 +5727,7 @@ packages: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 + dev: false /form-data@2.5.1: resolution: {integrity: sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==} @@ -5494,15 +5737,6 @@ packages: combined-stream: 1.0.8 mime-types: 2.1.35 - /form-data@3.0.1: - resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: false - /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -5650,12 +5884,10 @@ packages: /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} - dev: true /get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} - dev: true /get-tsconfig@4.7.2: resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} @@ -5678,6 +5910,7 @@ packages: resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} dependencies: assert-plus: 1.0.0 + dev: false /git-rev-sync@3.0.2: resolution: {integrity: sha512-Nd5RiYpyncjLv0j6IONy0lGzAqdRXUaBctuGBbrEA2m6Bn4iDrN/9MeQTXuiquw8AEKL9D2BW0nw5m/lQvxqnQ==} @@ -5781,44 +6014,38 @@ packages: dependencies: get-intrinsic: 1.2.4 - /got@10.7.0: - resolution: {integrity: sha512-aWTDeNw9g+XqEZNcTjMMZSy7B7yE9toWOFYip7ofFTLleJhvZwUxxTxkTpKvF+p1SAA4VHmuEy7PiHTHyq8tJg==} - engines: {node: '>=10'} + /got@12.6.1: + resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} + engines: {node: '>=14.16'} dependencies: - '@sindresorhus/is': 2.1.1 - '@szmarczak/http-timer': 4.0.6 - '@types/cacheable-request': 6.0.3 - '@types/keyv': 3.1.4 - '@types/responselike': 1.0.3 - cacheable-lookup: 2.0.1 - cacheable-request: 7.0.4 - decompress-response: 5.0.0 - duplexer3: 0.1.5 - get-stream: 5.2.0 - lowercase-keys: 2.0.0 - mimic-response: 2.1.0 - p-cancelable: 2.1.1 - p-event: 4.2.0 - responselike: 2.0.1 - to-readable-stream: 2.1.0 - type-fest: 0.10.0 + '@sindresorhus/is': 5.6.0 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 10.2.14 + decompress-response: 6.0.0 + form-data-encoder: 2.1.4 + get-stream: 6.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 3.0.0 dev: false - /got@11.8.6: - resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==} - engines: {node: '>=10.19.0'} + /got@14.2.0: + resolution: {integrity: sha512-dBq2KkHcQl3AwPoIWsLsQScCPpUgRulz1qZVthjPYKYOPmYfBnekR3vxecjZbm91Vc3JUGnV9mqFX7B+Fe2quw==} + engines: {node: '>=20'} dependencies: - '@sindresorhus/is': 4.6.0 - '@szmarczak/http-timer': 4.0.6 - '@types/cacheable-request': 6.0.3 - '@types/responselike': 1.0.3 - cacheable-lookup: 5.0.4 - cacheable-request: 7.0.4 + '@sindresorhus/is': 6.2.0 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 10.2.14 decompress-response: 6.0.0 - http2-wrapper: 1.0.3 - lowercase-keys: 2.0.0 - p-cancelable: 2.1.1 - responselike: 2.0.1 + form-data-encoder: 4.0.2 + get-stream: 8.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 4.0.1 + responselike: 3.0.0 dev: false /graceful-fs@4.1.15: @@ -5846,6 +6073,7 @@ packages: /har-schema@2.0.0: resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==} engines: {node: '>=4'} + dev: false /har-validator@5.1.5: resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==} @@ -5854,6 +6082,7 @@ packages: dependencies: ajv: 6.12.6 har-schema: 2.0.0 + dev: false /has-ansi@2.0.0: resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} @@ -6059,6 +6288,7 @@ packages: assert-plus: 1.0.0 jsprim: 1.4.2 sshpk: 1.18.0 + dev: false /http-signature@1.3.6: resolution: {integrity: sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==} @@ -6069,8 +6299,8 @@ packages: sshpk: 1.18.0 dev: false - /http2-wrapper@1.0.3: - resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==} + /http2-wrapper@2.2.1: + resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} engines: {node: '>=10.19.0'} dependencies: quick-lru: 5.1.1 @@ -6289,6 +6519,11 @@ packages: engines: {node: '>=8'} dev: false + /ip-regex@5.0.0: + resolution: {integrity: sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: false + /ip@2.0.1: resolution: {integrity: sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==} dev: false @@ -6466,6 +6701,7 @@ packages: /is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} + dev: false /is-unicode-supported@0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} @@ -6482,6 +6718,7 @@ packages: /isstream@0.1.2: resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} + dev: false /istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} @@ -6985,6 +7222,7 @@ packages: /jsbn@0.1.1: resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} + dev: false /jsbn@1.1.0: resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} @@ -7065,6 +7303,7 @@ packages: /json-schema@0.4.0: resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} + dev: false /json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} @@ -7093,6 +7332,7 @@ packages: extsprintf: 1.3.0 json-schema: 0.4.0 verror: 1.10.0 + dev: false /jsprim@2.0.2: resolution: {integrity: sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==} @@ -7302,15 +7542,6 @@ packages: libqp: 2.0.1 dev: false - /libmime@5.2.1: - resolution: {integrity: sha512-A0z9O4+5q+ZTj7QwNe/Juy1KARNb4WaviO4mYeFC4b8dBT2EEqK2pkM+GC8MVnkOjqhl5nYQxRgnPYRRTNmuSQ==} - dependencies: - encoding-japanese: 2.0.0 - iconv-lite: 0.6.3 - libbase64: 1.2.1 - libqp: 2.0.1 - dev: false - /libmime@5.3.4: resolution: {integrity: sha512-TsqPdercr6DHrnoQx1F0nS2Y4yPT+fWuOjEP2rqzvV77hMYWomTe/rpm0u9JORQ/FavEXybAGcBJsQbLr9+hjA==} dependencies: @@ -7488,9 +7719,9 @@ packages: resolution: {integrity: sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==} dev: false - /lowercase-keys@2.0.0: - resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} - engines: {node: '>=8'} + /lowercase-keys@3.0.0: + resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: false /lru-cache@10.2.0: @@ -7578,6 +7809,11 @@ packages: tmpl: 1.0.5 dev: true + /map-obj@1.0.1: + resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} + engines: {node: '>=0.10.0'} + dev: false + /map-obj@4.3.0: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} @@ -8480,21 +8716,16 @@ packages: engines: {node: '>=12'} dev: true - /mimic-response@1.0.1: - resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} - engines: {node: '>=4'} - dev: false - - /mimic-response@2.1.0: - resolution: {integrity: sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==} - engines: {node: '>=8'} - dev: false - /mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} dev: false + /mimic-response@4.0.0: + resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: false + /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -8670,11 +8901,6 @@ packages: engines: {node: '>=6.0.0'} dev: false - /nodemailer@6.9.9: - resolution: {integrity: sha512-dexTll8zqQoVJEZPwQAKzxxtFn0qTnjdQTchoU6Re9BUUGBJiOy3YMn/0ShTW6J5M0dfQ1NeDeRTTl4oIWgQMA==} - engines: {node: '>=6.0.0'} - dev: false - /nopt@5.0.0: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} @@ -8697,9 +8923,9 @@ packages: engines: {node: '>=0.10.0'} dev: true - /normalize-url@6.1.0: - resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} - engines: {node: '>=10'} + /normalize-url@8.0.0: + resolution: {integrity: sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==} + engines: {node: '>=14.16'} dev: false /notion-to-md@3.1.1: @@ -8764,6 +8990,7 @@ packages: /oauth-sign@0.9.0: resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} + dev: false /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} @@ -8865,16 +9092,14 @@ packages: '@otplib/preset-v11': 12.0.1 dev: false - /p-cancelable@2.1.1: - resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} - engines: {node: '>=8'} + /p-cancelable@3.0.0: + resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} + engines: {node: '>=12.20'} dev: false - /p-event@4.2.0: - resolution: {integrity: sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==} - engines: {node: '>=8'} - dependencies: - p-timeout: 3.2.0 + /p-cancelable@4.0.1: + resolution: {integrity: sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==} + engines: {node: '>=14.16'} dev: false /p-finally@1.0.0: @@ -8910,13 +9135,6 @@ packages: p-limit: 3.1.0 dev: true - /p-timeout@3.2.0: - resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==} - engines: {node: '>=8'} - dependencies: - p-finally: 1.0.0 - dev: false - /p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} @@ -9078,6 +9296,7 @@ packages: /performance-now@2.1.0: resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} + dev: false /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -9276,6 +9495,7 @@ packages: /psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} + dev: false /pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} @@ -9445,15 +9665,6 @@ packages: /qs@6.5.3: resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==} engines: {node: '>=0.6'} - - /query-string@6.14.1: - resolution: {integrity: sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==} - engines: {node: '>=6'} - dependencies: - decode-uri-component: 0.2.2 - filter-obj: 1.1.0 - split-on-first: 1.1.0 - strict-uri-encode: 2.0.0 dev: false /query-string@7.1.3: @@ -9466,6 +9677,15 @@ packages: strict-uri-encode: 2.0.0 dev: false + /query-string@9.0.0: + resolution: {integrity: sha512-4EWwcRGsO2H+yzq6ddHcVqkCQ2EFUSfDMEjF8ryp8ReymyZhIuaFRGLomeOQLkrzacMHoyky2HW0Qe30UbzkKw==} + engines: {node: '>=18'} + dependencies: + decode-uri-component: 0.4.1 + filter-obj: 5.1.0 + split-on-first: 3.0.0 + dev: false + /querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} dev: false @@ -9738,19 +9958,7 @@ packages: dependencies: lodash: 4.17.21 request: 2.88.2 - - /request-promise-native@1.0.9(request@2.88.2): - resolution: {integrity: sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==} - engines: {node: '>=0.12.0'} - deprecated: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 - peerDependencies: - request: ^2.34 - dependencies: - request: 2.88.2 - request-promise-core: 1.1.4(request@2.88.2) - stealthy-require: 1.1.1 - tough-cookie: 2.5.0 - dev: true + dev: false /request-promise@4.2.6(request@2.88.2): resolution: {integrity: sha512-HCHI3DJJUakkOr8fNoCc73E5nU5bqITjOYFMDrKHYOXWXrgD/SBaC7LjwuPymUprRyuF06UK7hd/lMHkmUXglQ==} @@ -9791,6 +9999,7 @@ packages: tough-cookie: 2.5.0 tunnel-agent: 0.6.0 uuid: 3.4.0 + dev: false /require-all@3.0.0: resolution: {integrity: sha512-jPGN876lc5exWYrMcgZSd7U42P0PmVQzxnQB13fCSzmyGnqQWW4WUz5DosZ/qe24hz+5o9lSvW2epBNZ1xa6Fw==} @@ -9849,10 +10058,11 @@ packages: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - /responselike@2.0.1: - resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} + /responselike@3.0.0: + resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} + engines: {node: '>=14.16'} dependencies: - lowercase-keys: 2.0.0 + lowercase-keys: 3.0.0 dev: false /restore-cursor@3.1.0: @@ -10215,6 +10425,11 @@ packages: engines: {node: '>=6'} dev: false + /split-on-first@3.0.0: + resolution: {integrity: sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==} + engines: {node: '>=12'} + dev: false + /split2@4.2.0: resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} engines: {node: '>= 10.x'} @@ -10242,6 +10457,7 @@ packages: jsbn: 0.1.1 safer-buffer: 2.1.2 tweetnacl: 0.14.5 + dev: false /stack-trace@0.0.10: resolution: {integrity: sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==} @@ -10276,6 +10492,7 @@ packages: /stealthy-require@1.1.1: resolution: {integrity: sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g==} engines: {node: '>=0.10.0'} + dev: false /store2@2.14.3: resolution: {integrity: sha512-4QcZ+yx7nzEFiV4BMLnr/pRa5HYzNITX2ri0Zh6sT9EyQHbBHacC6YigllUPU9X3D0f/22QCgfokpKs52YRrUg==} @@ -10488,7 +10705,7 @@ packages: pump: 3.0.0 tar-stream: 3.1.7 optionalDependencies: - bare-fs: 2.1.5 + bare-fs: 2.2.1 bare-path: 2.1.0 dev: false @@ -10635,11 +10852,6 @@ packages: resolution: {integrity: sha512-Z3g735FxuZY8rodxV4gH7LxClE4H0hTIyHNIHdk+vpQxjLm0cwnKXq/OFVZ76SOQmto7txVcwSCwkU5kqp+FKg==} dev: false - /to-readable-stream@2.1.0: - resolution: {integrity: sha512-o3Qa6DGg1CEXshSdvWNX2sN4QHqg03SPq7U6jPXRahlQdl5dK8oXjkU/2/sGrnOZKeGV1zLSO8qPwyKklPPE7w==} - engines: {node: '>=8'} - dev: false - /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -10681,6 +10893,7 @@ packages: dependencies: psl: 1.9.0 punycode: 2.3.1 + dev: false /tough-cookie@4.1.3: resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==} @@ -10743,7 +10956,7 @@ packages: typescript: 5.3.3 dev: false - /ts-jest@29.1.2(@babel/core@7.23.9)(jest@29.7.0)(typescript@5.3.3): + /ts-jest@29.1.2(@babel/core@7.24.0)(jest@29.7.0)(typescript@5.3.3): resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==} engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true @@ -10764,7 +10977,7 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.0 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 29.7.0(@types/node@20.11.24) @@ -10808,6 +11021,7 @@ packages: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} dependencies: safe-buffer: 5.2.1 + dev: false /turndown@7.1.2: resolution: {integrity: sha512-ntI9R7fcUKjqBP6QU8rBK2Ehyt8LAzt3UBT9JR9tgo6GtuKvyUzpayWmeMKJw1DPdXzktvtIT8m2mVXz+bL/Qg==} @@ -10817,6 +11031,7 @@ packages: /tweetnacl@0.14.5: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} + dev: false /twitter-api-v2@1.16.0: resolution: {integrity: sha512-e7wzWqx5oQZ9IUc2xt8JiJ84ioVGlmjmca1h0NwCKx2AFfKXDePmQa42gcBDe0qau9YaHsIpzO9z5SX1fmb+IQ==} @@ -10841,11 +11056,6 @@ packages: engines: {node: '>=4'} dev: true - /type-fest@0.10.0: - resolution: {integrity: sha512-EUV9jo4sffrwlg8s0zDhP0T2WD3pru5Xi0+HTE3zTUmBaZNhfkite9PdSJwdXLwPVW0jnAHT56pZHIOYckPEiw==} - engines: {node: '>=8'} - dev: false - /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} @@ -10866,6 +11076,11 @@ packages: engines: {node: '>=8'} dev: true + /type-fest@1.4.0: + resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} + engines: {node: '>=10'} + dev: false + /type-fest@3.13.1: resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} engines: {node: '>=14.16'} @@ -11153,6 +11368,7 @@ packages: resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. hasBin: true + dev: false /uuid@8.3.2: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} @@ -11206,6 +11422,7 @@ packages: assert-plus: 1.0.0 core-util-is: 1.0.2 extsprintf: 1.3.0 + dev: false /vfile-message@2.0.4: resolution: {integrity: sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==} diff --git a/scripts/twitter-token/generate.js b/scripts/twitter-token/generate.js deleted file mode 100644 index cf69aea417b228..00000000000000 --- a/scripts/twitter-token/generate.js +++ /dev/null @@ -1,126 +0,0 @@ -const got = require('got'); -const { HttpsProxyAgent } = require('https-proxy-agent'); -const fs = require('fs'); -const path = require('path'); - -const concurrency = 5; // Please do not set it too large to avoid Twitter discovering our little secret -const proxyUrl = ''; // Add your proxy here - -const baseURL = 'https://api.twitter.com/1.1/'; -const headers = { - Authorization: 'Bearer AAAAAAAAAAAAAAAAAAAAAFXzAwAAAAAAMHCxpeSDG1gLNLghVe8d74hl6k4%3DRUMF4xAQLsbeBhTSRrCiQpJtxoGWeyHrDb5te2jpGskWDFW82F', - 'User-Agent': 'TwitterAndroid/10.10.0', -}; - -const accounts = []; - -function generateOne() { - // eslint-disable-next-line no-async-promise-executor - return new Promise(async (resolve) => { - const timeout = setTimeout(() => { - // eslint-disable-next-line no-console - console.log(`Failed to generate account, continue... timeout`); - resolve(); - }, 30000); - - const agent = { - https: proxyUrl && new HttpsProxyAgent(proxyUrl), - }; - - try { - const response = await got.post(`${baseURL}guest/activate.json`, { - headers: { - Authorization: headers.Authorization, - }, - agent, - timeout: { - request: 20000, - }, - }); - const guestToken = JSON.parse(response.body).guest_token; - - const flowResponse = await got.post(`${baseURL}onboarding/task.json?flow_name=welcome`, { - json: { - flow_token: null, - input_flow_data: { - flow_context: { - start_location: { - location: 'splash_screen', - }, - }, - }, - }, - headers: { - ...headers, - 'X-Guest-Token': guestToken, - }, - agent, - timeout: { - request: 20000, - }, - }); - const flowToken = JSON.parse(flowResponse.body).flow_token; - - const finalResponse = await got.post(`${baseURL}onboarding/task.json`, { - json: { - flow_token: flowToken, - subtask_inputs: [ - { - open_link: { - link: 'next_link', - }, - subtask_id: 'NextTaskOpenLink', - }, - ], - }, - headers: { - ...headers, - 'X-Guest-Token': guestToken, - }, - agent, - timeout: { - request: 20000, - }, - }); - - const account = JSON.parse(finalResponse.body).subtasks[0].open_account; - - if (account) { - accounts.push({ - t: account.oauth_token, - s: account.oauth_token_secret, - }); - } else { - // eslint-disable-next-line no-console - console.log(`Failed to generate account, continue... no account`); - } - } catch (error) { - // eslint-disable-next-line no-console - console.log(`Failed to generate account, continue... ${error}`); - } - - clearTimeout(timeout); - resolve(); - }); -} - -(async () => { - const oldAccounts = fs.readFileSync(path.join(__dirname, 'accounts.txt')); - const tokens = oldAccounts.toString().split('\n')[0].split('=')[1].split(','); - const secrets = oldAccounts.toString().split('\n')[1].split('=')[1].split(','); - for (const [i, token] of tokens.entries()) { - accounts.push({ - t: token, - s: secrets[i], - }); - } - - for (let i = 0; i < 1000; i++) { - // eslint-disable-next-line no-console - console.log(`Generating accounts ${i * concurrency}-${(i + 1) * concurrency - 1}, total ${accounts.length}`); - - // eslint-disable-next-line no-await-in-loop - await Promise.all(Array.from({ length: concurrency }, () => generateOne())); - fs.writeFileSync(path.join(__dirname, 'accounts.txt'), [`TWITTER_OAUTH_TOKEN=${accounts.map((account) => account.t).join(',')}`, `TWITTER_OAUTH_TOKEN_SECRET=${accounts.map((account) => account.s).join(',')}`].join('\n')); - } -})(); diff --git a/scripts/twitter-token/generate.sh b/scripts/twitter-token/generate.sh deleted file mode 100644 index 8f26691f16452c..00000000000000 --- a/scripts/twitter-token/generate.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -guest_token=$(curl -s -XPOST https://api.twitter.com/1.1/guest/activate.json -H 'Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAFXzAwAAAAAAMHCxpeSDG1gLNLghVe8d74hl6k4%3DRUMF4xAQLsbeBhTSRrCiQpJtxoGWeyHrDb5te2jpGskWDFW82F' | jq -r '.guest_token') - -flow_token=$(curl -s -XPOST 'https://api.twitter.com/1.1/onboarding/task.json?flow_name=welcome' \ - -H 'Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAFXzAwAAAAAAMHCxpeSDG1gLNLghVe8d74hl6k4%3DRUMF4xAQLsbeBhTSRrCiQpJtxoGWeyHrDb5te2jpGskWDFW82F' \ - -H 'Content-Type: application/json' \ - -H "User-Agent: TwitterAndroid/10.10.0" \ - -H "X-Guest-Token: ${guest_token}" \ - -d '{"flow_token":null,"input_flow_data":{"flow_context":{"start_location":{"location":"splash_screen"}}}}' | jq -r .flow_token) - -curl -s -XPOST 'https://api.twitter.com/1.1/onboarding/task.json' \ - -H 'Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAFXzAwAAAAAAMHCxpeSDG1gLNLghVe8d74hl6k4%3DRUMF4xAQLsbeBhTSRrCiQpJtxoGWeyHrDb5te2jpGskWDFW82F' \ - -H 'Content-Type: application/json' \ - -H "User-Agent: TwitterAndroid/10.10.0" \ - -H "X-Guest-Token: ${guest_token}" \ - -d "{\"flow_token\":\"${flow_token}\",\"subtask_inputs\":[{\"open_link\":{\"link\":\"next_link\"},\"subtask_id\":\"NextTaskOpenLink\"}]}" | jq -c -r '.subtasks[0]|if(.open_account) then {oauth_token: .open_account.oauth_token, oauth_token_secret: .open_account.oauth_token_secret} else empty end' diff --git a/scripts/workflow/test-issue/call-maintainer.js b/scripts/workflow/test-issue/call-maintainer.js index 406ba9f25fc59d..dacaf9c1a1ef90 100644 --- a/scripts/workflow/test-issue/call-maintainer.js +++ b/scripts/workflow/test-issue/call-maintainer.js @@ -1,6 +1,5 @@ const unified = require('unified'); const parse = require('remark-parse'); -const got = require('got'); // @TODO maybe we could use label or some other better ways to distinguish bug/feature issues const matchTitle = ['路由地址', 'Routes']; @@ -44,6 +43,8 @@ async function parseBodyRoutes(body, core) { } async function getMaintainersByRoutes(routes, core) { + const got = await import('got'); + // TODO: change me when https://github.com/actions/github-script is run on node20 // const response = await fetch(maintainerURL); // const maintainers = await response.json(); From 52074bdfa0dfef52d283f02cf3e74fdd12458fd7 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 2 Mar 2024 01:38:34 +0800 Subject: [PATCH 2/9] chore: rollback dayjs --- package.json | 2 +- pnpm-lock.yaml | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3a7585c0c837ef..0c8865748c9fdd 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "city-timezones": "1.2.1", "crypto-js": "4.2.0", "currency-symbol-map": "5.1.0", - "dayjs": "1.11.10", + "dayjs": "1.11.8", "directory-import": "3.2.1", "dotenv": "16.4.5", "entities": "4.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 757e989fc8f2de..c49fdd366f4f72 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,8 @@ dependencies: specifier: 5.1.0 version: 5.1.0 dayjs: - specifier: 1.11.10 - version: 1.11.10 + specifier: 1.11.8 + version: 1.11.8 directory-import: specifier: 3.2.1 version: 3.2.1 @@ -4622,6 +4622,10 @@ packages: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} dev: false + /dayjs@1.11.8: + resolution: {integrity: sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ==} + dev: false + /debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: From f0e09ee9e013d900ae7c0c921cce1da1134a35d9 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 2 Mar 2024 02:20:43 +0800 Subject: [PATCH 3/9] chore: rollback got --- .github/dependabot.yml | 2 + package.json | 2 +- pnpm-lock.yaml | 145 ++++++++++++++---- .../workflow/test-issue/call-maintainer.js | 3 +- 4 files changed, 115 insertions(+), 37 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 43912211164f74..0a5d8d95b335a4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,6 +12,8 @@ updates: - dependency-name: jsrsasign versions: ['>=11.0.0'] # no longer includes KJUR.crypto.Cipher for RSA # ESM only packages + - dependency-name: got + versions: ['>=12.0.0'] - dependency-name: remark-parse versions: ['>=10.0.0'] - dependency-name: remark-preset-prettier diff --git a/package.json b/package.json index 0c8865748c9fdd..e8ab13d1958bf1 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "fanfou-sdk": "5.0.0", "git-rev-sync": "3.0.2", "googleapis": "133.0.0", - "got": "14.2.0", + "got": "11.8.6", "hono": "4.0.8", "html-to-text": "9.0.5", "https-proxy-agent": "7.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c49fdd366f4f72..0083ad85cbe45c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,8 +78,8 @@ dependencies: specifier: 133.0.0 version: 133.0.0 got: - specifier: 14.2.0 - version: 14.2.0 + specifier: 11.8.6 + version: 11.8.6 hono: specifier: 4.0.8 version: 4.0.8 @@ -2770,16 +2770,16 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true + /@sindresorhus/is@4.6.0: + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + dev: false + /@sindresorhus/is@5.6.0: resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} engines: {node: '>=14.16'} dev: false - /@sindresorhus/is@6.2.0: - resolution: {integrity: sha512-yM/IGPkVnYGblhDosFBwq0ZGdnVSBkNV4onUtipGMOjZd4kB6GAu3ys91aftSbyMHh6A2GPdt+KDI5NoWP63MQ==} - engines: {node: '>=16'} - dev: false - /@sinonjs/commons@3.0.1: resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} dependencies: @@ -2806,6 +2806,13 @@ packages: espree: 9.6.1 dev: true + /@szmarczak/http-timer@4.0.6: + resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} + engines: {node: '>=10'} + dependencies: + defer-to-connect: 2.0.1 + dev: false + /@szmarczak/http-timer@5.0.1: resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} @@ -2878,6 +2885,15 @@ packages: '@types/node': 20.11.24 dev: true + /@types/cacheable-request@6.0.3: + resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} + dependencies: + '@types/http-cache-semantics': 4.0.4 + '@types/keyv': 3.1.4 + '@types/node': 20.11.24 + '@types/responselike': 1.0.3 + dev: false + /@types/caseless@0.12.5: resolution: {integrity: sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==} @@ -3049,6 +3065,12 @@ packages: resolution: {integrity: sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==} dev: true + /@types/keyv@3.1.4: + resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} + dependencies: + '@types/node': 20.11.24 + dev: false + /@types/koa-basic-auth@2.0.6: resolution: {integrity: sha512-1/FdT3KiHIkVf+TxYiPPey0wnPBzuts6lz/Obskgo9ZY485J02+uI6STnD114L2iG+Wi5MBqU7EYNphKdKwZWQ==} dependencies: @@ -3218,6 +3240,12 @@ packages: resolution: {integrity: sha512-93iiG8N8kovFL08oenE76F7adIE00uzTdGV7FlFE9uPDtZ2f3pSuOS0ICWjG9OMhsn38eJjhf5CKFp9s7fzz/A==} dev: true + /@types/responselike@1.0.3: + resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} + dependencies: + '@types/node': 20.11.24 + dev: false + /@types/semver@7.5.8: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true @@ -4025,6 +4053,11 @@ packages: ylru: 1.3.2 dev: false + /cacheable-lookup@5.0.4: + resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} + engines: {node: '>=10.6.0'} + dev: false + /cacheable-lookup@7.0.0: resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} engines: {node: '>=14.16'} @@ -4043,6 +4076,19 @@ packages: responselike: 3.0.0 dev: false + /cacheable-request@7.0.4: + resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==} + engines: {node: '>=8'} + dependencies: + clone-response: 1.0.3 + get-stream: 5.2.0 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + lowercase-keys: 2.0.0 + normalize-url: 6.1.0 + responselike: 2.0.1 + dev: false + /call-bind@1.0.7: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} @@ -4341,6 +4387,12 @@ packages: shallow-clone: 0.1.2 dev: false + /clone-response@1.0.3: + resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} + dependencies: + mimic-response: 1.0.1 + dev: false + /clone@1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} @@ -5719,11 +5771,6 @@ packages: engines: {node: '>= 14.17'} dev: false - /form-data-encoder@4.0.2: - resolution: {integrity: sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==} - engines: {node: '>= 18'} - dev: false - /form-data@2.3.3: resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} engines: {node: '>= 0.12'} @@ -5892,6 +5939,7 @@ packages: /get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} + dev: true /get-tsconfig@4.7.2: resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} @@ -6018,6 +6066,23 @@ packages: dependencies: get-intrinsic: 1.2.4 + /got@11.8.6: + resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==} + engines: {node: '>=10.19.0'} + dependencies: + '@sindresorhus/is': 4.6.0 + '@szmarczak/http-timer': 4.0.6 + '@types/cacheable-request': 6.0.3 + '@types/responselike': 1.0.3 + cacheable-lookup: 5.0.4 + cacheable-request: 7.0.4 + decompress-response: 6.0.0 + http2-wrapper: 1.0.3 + lowercase-keys: 2.0.0 + p-cancelable: 2.1.1 + responselike: 2.0.1 + dev: false + /got@12.6.1: resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} engines: {node: '>=14.16'} @@ -6035,23 +6100,6 @@ packages: responselike: 3.0.0 dev: false - /got@14.2.0: - resolution: {integrity: sha512-dBq2KkHcQl3AwPoIWsLsQScCPpUgRulz1qZVthjPYKYOPmYfBnekR3vxecjZbm91Vc3JUGnV9mqFX7B+Fe2quw==} - engines: {node: '>=20'} - dependencies: - '@sindresorhus/is': 6.2.0 - '@szmarczak/http-timer': 5.0.1 - cacheable-lookup: 7.0.0 - cacheable-request: 10.2.14 - decompress-response: 6.0.0 - form-data-encoder: 4.0.2 - get-stream: 8.0.1 - http2-wrapper: 2.2.1 - lowercase-keys: 3.0.0 - p-cancelable: 4.0.1 - responselike: 3.0.0 - dev: false - /graceful-fs@4.1.15: resolution: {integrity: sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==} dev: false @@ -6303,6 +6351,14 @@ packages: sshpk: 1.18.0 dev: false + /http2-wrapper@1.0.3: + resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==} + engines: {node: '>=10.19.0'} + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + dev: false + /http2-wrapper@2.2.1: resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} engines: {node: '>=10.19.0'} @@ -7723,6 +7779,11 @@ packages: resolution: {integrity: sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==} dev: false + /lowercase-keys@2.0.0: + resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} + engines: {node: '>=8'} + dev: false + /lowercase-keys@3.0.0: resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -8720,6 +8781,11 @@ packages: engines: {node: '>=12'} dev: true + /mimic-response@1.0.1: + resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} + engines: {node: '>=4'} + dev: false + /mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} @@ -8927,6 +8993,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /normalize-url@6.1.0: + resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} + engines: {node: '>=10'} + dev: false + /normalize-url@8.0.0: resolution: {integrity: sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==} engines: {node: '>=14.16'} @@ -9096,16 +9167,16 @@ packages: '@otplib/preset-v11': 12.0.1 dev: false + /p-cancelable@2.1.1: + resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} + engines: {node: '>=8'} + dev: false + /p-cancelable@3.0.0: resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} engines: {node: '>=12.20'} dev: false - /p-cancelable@4.0.1: - resolution: {integrity: sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==} - engines: {node: '>=14.16'} - dev: false - /p-finally@1.0.0: resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} engines: {node: '>=4'} @@ -10062,6 +10133,12 @@ packages: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + /responselike@2.0.1: + resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} + dependencies: + lowercase-keys: 2.0.0 + dev: false + /responselike@3.0.0: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} engines: {node: '>=14.16'} diff --git a/scripts/workflow/test-issue/call-maintainer.js b/scripts/workflow/test-issue/call-maintainer.js index dacaf9c1a1ef90..406ba9f25fc59d 100644 --- a/scripts/workflow/test-issue/call-maintainer.js +++ b/scripts/workflow/test-issue/call-maintainer.js @@ -1,5 +1,6 @@ const unified = require('unified'); const parse = require('remark-parse'); +const got = require('got'); // @TODO maybe we could use label or some other better ways to distinguish bug/feature issues const matchTitle = ['路由地址', 'Routes']; @@ -43,8 +44,6 @@ async function parseBodyRoutes(body, core) { } async function getMaintainersByRoutes(routes, core) { - const got = await import('got'); - // TODO: change me when https://github.com/actions/github-script is run on node20 // const response = await fetch(maintainerURL); // const maintainers = await response.json(); From df57bb5d50927dbcb18fb195ec01c9ff5ebecd37 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 2 Mar 2024 03:25:26 +0800 Subject: [PATCH 4/9] feat: esm standard for routes --- lib/routes.ts | 8 ++++++-- lib/routes/0818tuan/index.js | 2 +- lib/routes/0818tuan/router.js | 2 +- lib/routes/12306/index.js | 2 +- lib/routes/12306/router.js | 2 +- lib/routes/12306/zxdt.js | 2 +- lib/routes/141jav/index.js | 2 +- lib/routes/141jav/router.js | 2 +- lib/routes/141ppv/index.js | 2 +- lib/routes/141ppv/router.js | 2 +- lib/routes/163/ds.js | 2 +- lib/routes/163/dy.js | 2 +- lib/routes/163/dy2.js | 2 +- lib/routes/163/exclusive.js | 2 +- lib/routes/163/music/artist-songs.js | 2 +- lib/routes/163/music/artist.js | 2 +- lib/routes/163/music/djradio.js | 2 +- lib/routes/163/music/playlist.js | 2 +- lib/routes/163/music/userevents.js | 2 +- lib/routes/163/music/userplaylist.js | 2 +- lib/routes/163/music/userplayrecords.js | 2 +- lib/routes/163/news/rank.js | 2 +- lib/routes/163/news/special.js | 2 +- lib/routes/163/open/vip.js | 2 +- lib/routes/163/renjian.js | 2 +- lib/routes/163/router.js | 2 +- lib/routes/163/today.js | 2 +- lib/routes/18comic/album.js | 2 +- lib/routes/18comic/blogs.js | 2 +- lib/routes/18comic/index.js | 2 +- lib/routes/18comic/router.js | 2 +- lib/routes/18comic/search.js | 2 +- lib/routes/19lou/index.js | 2 +- lib/routes/19lou/router.js | 2 +- lib/routes/1lou/index.js | 2 +- lib/routes/1lou/router.js | 2 +- lib/routes/1point3acres/blog.js | 2 +- lib/routes/1point3acres/category.js | 2 +- lib/routes/1point3acres/offer.js | 2 +- lib/routes/1point3acres/router.js | 2 +- lib/routes/1point3acres/section.js | 2 +- lib/routes/1point3acres/thread.js | 2 +- lib/routes/1point3acres/user/post.js | 2 +- lib/routes/1point3acres/user/thread.js | 2 +- lib/routes/2048/index.js | 2 +- lib/routes/2048/router.js | 2 +- lib/routes/2cycd/index.js | 2 +- lib/routes/2cycd/router.js | 2 +- lib/routes/36kr/hot-list.js | 2 +- lib/routes/36kr/index.js | 2 +- lib/routes/36kr/router.js | 2 +- lib/routes/3dmgame/game.js | 2 +- lib/routes/3dmgame/news-center.js | 2 +- lib/routes/3dmgame/router.js | 2 +- lib/routes/423down/index.js | 2 +- lib/routes/423down/router.js | 2 +- lib/routes/4gamers/category.js | 2 +- lib/routes/4gamers/router.js | 2 +- lib/routes/4gamers/tag.js | 2 +- lib/routes/4gamers/topic.js | 2 +- lib/routes/4ksj/forum.js | 2 +- lib/routes/4ksj/router.js | 2 +- lib/routes/500px/router.js | 2 +- lib/routes/500px/tribe-set.js | 2 +- lib/routes/500px/user.js | 2 +- lib/routes/50forum/router.js | 2 +- lib/routes/50forum/zhuanjia.js | 2 +- lib/routes/52hrtt/index.js | 2 +- lib/routes/52hrtt/router.js | 2 +- lib/routes/52hrtt/symposium.js | 2 +- lib/routes/56kog/class.js | 2 +- lib/routes/56kog/router.js | 2 +- lib/routes/56kog/top.js | 2 +- lib/routes/591/list.js | 2 +- lib/routes/591/router.js | 2 +- lib/routes/5eplay/index.js | 2 +- lib/routes/5eplay/router.js | 2 +- lib/routes/6park/index.js | 2 +- lib/routes/6park/news.js | 2 +- lib/routes/6park/router.js | 2 +- lib/routes/6v123/latest-movies.js | 2 +- lib/routes/6v123/latest-tvseries.js | 2 +- lib/routes/6v123/router.js | 2 +- lib/routes/78dm/index.js | 2 +- lib/routes/78dm/router.js | 2 +- lib/routes/7mmtv/index.js | 2 +- lib/routes/7mmtv/router.js | 2 +- lib/routes/81/81rc/index.js | 2 +- lib/routes/81/router.js | 2 +- lib/routes/8264/list.js | 2 +- lib/routes/8264/router.js | 2 +- lib/routes/8kcos/cat.js | 2 +- lib/routes/8kcos/latest.js | 2 +- lib/routes/8kcos/router.js | 2 +- lib/routes/8kcos/tag.js | 2 +- lib/routes/8world/index.js | 2 +- lib/routes/8world/router.js | 2 +- lib/routes/91porn/author.js | 2 +- lib/routes/91porn/index.js | 2 +- lib/routes/91porn/router.js | 2 +- lib/routes/95mm/category.js | 2 +- lib/routes/95mm/router.js | 2 +- lib/routes/95mm/tab.js | 2 +- lib/routes/95mm/tag.js | 2 +- lib/routes/9to5/router.js | 2 +- lib/routes/9to5/subsite.js | 2 +- lib/routes/aamacau/index.js | 2 +- lib/routes/aamacau/router.js | 2 +- lib/routes/abc/index.js | 2 +- lib/routes/abc/router.js | 2 +- lib/routes/abmedia/category.js | 2 +- lib/routes/abmedia/index.js | 2 +- lib/routes/abmedia/router.js | 2 +- lib/routes/abskoop/index.js | 2 +- lib/routes/abskoop/nsfw.js | 2 +- lib/routes/abskoop/router.js | 2 +- lib/routes/acfun/article.js | 2 +- lib/routes/acfun/bangumi.js | 2 +- lib/routes/acfun/router.js | 2 +- lib/routes/acfun/video.js | 2 +- lib/routes/acg17/post.js | 2 +- lib/routes/acg17/router.js | 2 +- lib/routes/acpaa/index.js | 2 +- lib/routes/acpaa/router.js | 2 +- lib/routes/acs/journal.js | 2 +- lib/routes/acs/router.js | 2 +- lib/routes/aeaweb/index.js | 2 +- lib/routes/aeaweb/router.js | 2 +- lib/routes/aeon/category.js | 2 +- lib/routes/aeon/router.js | 2 +- lib/routes/aeon/type.js | 2 +- lib/routes/agefans/detail.js | 2 +- lib/routes/agefans/router.js | 2 +- lib/routes/agefans/update.js | 2 +- lib/routes/agirls/index.js | 2 +- lib/routes/agirls/router.js | 2 +- lib/routes/agirls/topic-list.js | 2 +- lib/routes/agirls/topic.js | 2 +- lib/routes/agora0/index.js | 2 +- lib/routes/agora0/pen0.js | 2 +- lib/routes/agora0/router.js | 2 +- lib/routes/ahjzu/news.js | 2 +- lib/routes/ahjzu/router.js | 2 +- lib/routes/aicaijing/index.js | 2 +- lib/routes/aicaijing/router.js | 2 +- lib/routes/aiea/index.js | 2 +- lib/routes/aiea/router.js | 4 +--- lib/routes/aijishu/index.js | 2 +- lib/routes/aijishu/router.js | 2 +- lib/routes/ainvest/article.js | 2 +- lib/routes/ainvest/news.js | 2 +- lib/routes/ainvest/router.js | 2 +- lib/routes/aip/journal-pupp.js | 2 +- lib/routes/aip/journal.js | 2 +- lib/routes/aip/router.js | 2 +- lib/routes/airchina/index.js | 2 +- lib/routes/airchina/router.js | 2 +- lib/routes/aisixiang/column.js | 2 +- lib/routes/aisixiang/router.js | 2 +- lib/routes/aisixiang/thinktank.js | 2 +- lib/routes/aisixiang/toplist.js | 2 +- lib/routes/aisixiang/zhuanti.js | 2 +- lib/routes/ajmide/index.js | 2 +- lib/routes/ajmide/router.js | 2 +- lib/routes/aliresearch/information.js | 2 +- lib/routes/aliresearch/router.js | 2 +- lib/routes/alistapart/index.js | 2 +- lib/routes/alistapart/router.js | 2 +- lib/routes/alistapart/topic.js | 2 +- lib/routes/aliyun/database-month.js | 2 +- lib/routes/aliyun/developer/group.js | 2 +- lib/routes/aliyun/notice.js | 2 +- lib/routes/aliyun/router.js | 2 +- lib/routes/aljazeera/index.js | 2 +- lib/routes/aljazeera/router.js | 2 +- lib/routes/ally/rail.js | 2 +- lib/routes/ally/router.js | 2 +- lib/routes/alternativeto/platform.js | 2 +- lib/routes/alternativeto/router.js | 2 +- lib/routes/alternativeto/software.js | 2 +- lib/routes/amazon/awsblogs.js | 2 +- lib/routes/amazon/kindle-software-updates.js | 2 +- lib/routes/amazon/router.js | 2 +- lib/routes/android/platform-tools-releases.js | 2 +- lib/routes/android/router.js | 2 +- lib/routes/annualreviews/index.js | 2 +- lib/routes/annualreviews/router.js | 2 +- lib/routes/anquanke/category.js | 2 +- lib/routes/anquanke/router.js | 2 +- lib/routes/anquanke/vul.js | 2 +- lib/routes/apache/apisix/blog.js | 2 +- lib/routes/apache/router.js | 2 +- lib/routes/apiseven/blog.js | 2 +- lib/routes/apiseven/router.js | 2 +- lib/routes/apkpure/router.js | 2 +- lib/routes/apkpure/versions.js | 2 +- lib/routes/apnews/router.js | 2 +- lib/routes/apnews/topics.js | 2 +- lib/routes/app-center/release.js | 2 +- lib/routes/app-center/router.js | 2 +- lib/routes/apple/apps.js | 2 +- lib/routes/apple/exchange-repair.js | 2 +- lib/routes/apple/router.js | 2 +- lib/routes/appleinsider/index.js | 2 +- lib/routes/appleinsider/router.js | 2 +- lib/routes/appstore/in-app-purchase.js | 2 +- lib/routes/appstore/price.js | 2 +- lib/routes/appstore/router.js | 2 +- lib/routes/appstore/xianmian.js | 2 +- lib/routes/aqara/community.js | 2 +- lib/routes/aqara/news.js | 2 +- lib/routes/aqara/post.js | 2 +- lib/routes/aqara/region.js | 2 +- lib/routes/aqara/router.js | 2 +- lib/routes/arcteryx/new-arrivals.js | 2 +- lib/routes/arcteryx/outlet.js | 2 +- lib/routes/arcteryx/regear-new-arrivals.js | 2 +- lib/routes/arcteryx/router.js | 2 +- lib/routes/arknights/announce.js | 2 +- lib/routes/arknights/japan.js | 2 +- lib/routes/arknights/news.js | 2 +- lib/routes/arknights/router.js | 2 +- lib/routes/artstation/router.js | 2 +- lib/routes/artstation/user.js | 2 +- lib/routes/asiantolick/index.js | 2 +- lib/routes/asiantolick/router.js | 2 +- lib/routes/asus/bios.js | 2 +- lib/routes/asus/gpu-tweak.js | 2 +- lib/routes/asus/router.js | 2 +- lib/routes/atcoder/contest.js | 2 +- lib/routes/atcoder/post.js | 2 +- lib/routes/atcoder/router.js | 2 +- lib/routes/auto-stats/index.js | 2 +- lib/routes/auto-stats/router.js | 2 +- lib/routes/baai/comments.js | 2 +- lib/routes/baai/events.js | 2 +- lib/routes/baai/hub.js | 2 +- lib/routes/baai/router.js | 2 +- lib/routes/backlinko/blog.js | 2 +- lib/routes/backlinko/router.js | 2 +- lib/routes/bad/index.js | 2 +- lib/routes/bad/router.js | 2 +- lib/routes/baidu/gushitong/index.js | 2 +- lib/routes/baidu/router.js | 2 +- lib/routes/baidu/search.js | 2 +- lib/routes/baidu/tieba/forum.js | 2 +- lib/routes/baidu/tieba/post.js | 2 +- lib/routes/baidu/tieba/search.js | 2 +- lib/routes/baidu/tieba/user.js | 2 +- lib/routes/baidu/top.js | 2 +- lib/routes/bandcamp/live.js | 2 +- lib/routes/bandcamp/router.js | 2 +- lib/routes/bandcamp/tag.js | 2 +- lib/routes/bandcamp/weekly.js | 2 +- lib/routes/bangumi/moe/index.js | 2 +- lib/routes/bangumi/online/online.js | 2 +- lib/routes/bangumi/router.js | 2 +- lib/routes/bangumi/tv/calendar/today.js | 2 +- lib/routes/bangumi/tv/group/reply.js | 2 +- lib/routes/bangumi/tv/group/topic.js | 2 +- lib/routes/bangumi/tv/other/followrank.js | 2 +- lib/routes/bangumi/tv/person/index.js | 2 +- lib/routes/bangumi/tv/subject/index.js | 2 +- lib/routes/bangumi/tv/user/blog.js | 2 +- lib/routes/bangumi/tv/user/wish.js | 2 +- lib/routes/baozimh/index.js | 2 +- lib/routes/baozimh/router.js | 2 +- lib/routes/barronschina/index.js | 2 +- lib/routes/barronschina/router.js | 2 +- lib/routes/bast/index.js | 2 +- lib/routes/bast/router.js | 2 +- lib/routes/bbc/index.js | 2 +- lib/routes/bbc/router.js | 2 +- lib/routes/bbcnewslabs/news.js | 2 +- lib/routes/bbcnewslabs/router.js | 2 +- lib/routes/bdys/index.js | 2 +- lib/routes/bdys/router.js | 2 +- lib/routes/behance/router.js | 2 +- lib/routes/behance/user.js | 2 +- lib/routes/bellroy/new-releases.js | 2 +- lib/routes/bellroy/router.js | 2 +- lib/routes/bendibao/news.js | 2 +- lib/routes/bendibao/router.js | 2 +- lib/routes/bgmlist/onair.js | 2 +- lib/routes/bgmlist/router.js | 2 +- lib/routes/bigquant/collections.js | 2 +- lib/routes/bigquant/router.js | 2 +- lib/routes/bilibili/app.js | 2 +- lib/routes/bilibili/article.js | 2 +- lib/routes/bilibili/audio.js | 2 +- lib/routes/bilibili/bangumi.js | 2 +- lib/routes/bilibili/coin.js | 2 +- lib/routes/bilibili/danmaku.js | 2 +- lib/routes/bilibili/dynamic.js | 2 +- lib/routes/bilibili/fav.js | 2 +- lib/routes/bilibili/followers.js | 2 +- lib/routes/bilibili/followings-article.js | 2 +- lib/routes/bilibili/followings-dynamic.js | 2 +- lib/routes/bilibili/followings-video.js | 2 +- lib/routes/bilibili/followings.js | 2 +- lib/routes/bilibili/hot-search.js | 2 +- lib/routes/bilibili/link-news.js | 2 +- lib/routes/bilibili/live-area.js | 2 +- lib/routes/bilibili/live-room.js | 2 +- lib/routes/bilibili/live-search.js | 2 +- lib/routes/bilibili/mall-ip.js | 2 +- lib/routes/bilibili/mall-new.js | 2 +- lib/routes/bilibili/manga-followings.js | 2 +- lib/routes/bilibili/manga-update.js | 2 +- lib/routes/bilibili/page.js | 2 +- lib/routes/bilibili/partion-ranking.js | 2 +- lib/routes/bilibili/partion.js | 2 +- lib/routes/bilibili/platform.js | 2 +- lib/routes/bilibili/popular.js | 2 +- lib/routes/bilibili/ranking.js | 2 +- lib/routes/bilibili/readlist.js | 2 +- lib/routes/bilibili/reply.js | 2 +- lib/routes/bilibili/router.js | 2 +- lib/routes/bilibili/user-bangumi.js | 2 +- lib/routes/bilibili/user-channel.js | 2 +- lib/routes/bilibili/user-collection.js | 2 +- lib/routes/bilibili/user-fav.js | 2 +- lib/routes/bilibili/video-all.js | 2 +- lib/routes/bilibili/video.js | 2 +- lib/routes/bilibili/vsearch.js | 2 +- lib/routes/bilibili/watchlater.js | 2 +- lib/routes/bilibili/weekly-recommend.js | 2 +- lib/routes/bing/daily-wallpaper.js | 2 +- lib/routes/bing/router.js | 2 +- lib/routes/bing/search.js | 2 +- lib/routes/biodiscover/index.js | 2 +- lib/routes/biodiscover/router.js | 2 +- lib/routes/bioone/featured.js | 2 +- lib/routes/bioone/journal.js | 2 +- lib/routes/bioone/router.js | 2 +- lib/routes/biquge/index.js | 2 +- lib/routes/biquge/router.js | 2 +- lib/routes/bit/cs/cs.js | 2 +- lib/routes/bit/jwc/jwc.js | 2 +- lib/routes/bit/router.js | 2 +- lib/routes/bit/rszhaopin.js | 2 +- lib/routes/bit/yjs.js | 2 +- lib/routes/bitbucket/commits.js | 2 +- lib/routes/bitbucket/router.js | 2 +- lib/routes/bitbucket/tags.js | 2 +- lib/routes/bitmovin/blog.js | 2 +- lib/routes/bitmovin/router.js | 2 +- lib/routes/bjfu/grs.js | 2 +- lib/routes/bjfu/it/index.js | 2 +- lib/routes/bjfu/jwc/index.js | 2 +- lib/routes/bjfu/kjc.js | 2 +- lib/routes/bjfu/news/index.js | 2 +- lib/routes/bjfu/router.js | 2 +- lib/routes/bjp/apod.js | 2 +- lib/routes/bjp/router.js | 2 +- lib/routes/bjsk/index.js | 2 +- lib/routes/bjsk/keti.js | 2 +- lib/routes/bjsk/router.js | 2 +- lib/routes/bjwxdxh/index.js | 2 +- lib/routes/bjwxdxh/router.js | 2 +- lib/routes/bjx/huanbao.js | 2 +- lib/routes/bjx/router.js | 2 +- lib/routes/bjx/types.js | 2 +- lib/routes/blizzard/news.js | 2 +- lib/routes/blizzard/router.js | 2 +- lib/routes/bloomberg/authors.js | 2 +- lib/routes/bloomberg/index.js | 2 +- lib/routes/bloomberg/router.js | 2 +- lib/routes/bluestacks/release.js | 2 +- lib/routes/bluestacks/router.js | 2 +- lib/routes/bmkg/earthquake.js | 2 +- lib/routes/bmkg/news.js | 2 +- lib/routes/bmkg/router.js | 2 +- lib/routes/bnu/bs.js | 2 +- lib/routes/bnu/dwxgb.js | 2 +- lib/routes/bnu/fdy.js | 2 +- lib/routes/bnu/lib.js | 2 +- lib/routes/bnu/router.js | 2 +- lib/routes/boc/router.js | 2 +- lib/routes/boc/whpj.js | 2 +- lib/routes/bookfere/category.js | 2 +- lib/routes/bookfere/router.js | 2 +- lib/routes/booru/mmda.js | 2 +- lib/routes/booru/router.js | 2 +- lib/routes/bossdesign/index.js | 2 +- lib/routes/bossdesign/router.js | 2 +- lib/routes/brave/latest.js | 2 +- lib/routes/brave/router.js | 2 +- lib/routes/brooklynmuseum/exhibitions.js | 2 +- lib/routes/brooklynmuseum/router.js | 2 +- lib/routes/bse/index.js | 2 +- lib/routes/bse/router.js | 2 +- lib/routes/bsky/keyword.js | 2 +- lib/routes/bsky/posts.js | 2 +- lib/routes/bsky/router.js | 2 +- lib/routes/btzj/index.js | 2 +- lib/routes/btzj/router.js | 2 +- lib/routes/buaa/news/index.js | 2 +- lib/routes/buaa/router.js | 2 +- lib/routes/buaa/sme.js | 2 +- lib/routes/bulianglin/bulianglin.js | 2 +- lib/routes/bulianglin/router.js | 2 +- lib/routes/bupt/rczp.js | 2 +- lib/routes/bupt/router.js | 2 +- lib/routes/byteclicks/index.js | 2 +- lib/routes/byteclicks/router.js | 2 +- lib/routes/byteclicks/tag.js | 2 +- lib/routes/bytes/bytes.js | 2 +- lib/routes/bytes/router.js | 2 +- lib/routes/c114/roll.js | 2 +- lib/routes/c114/router.js | 2 +- lib/routes/caai/index.js | 2 +- lib/routes/caai/router.js | 2 +- lib/routes/caam/index.js | 2 +- lib/routes/caam/router.js | 2 +- lib/routes/caareviews/book.js | 2 +- lib/routes/caareviews/essay.js | 2 +- lib/routes/caareviews/exhibition.js | 2 +- lib/routes/caareviews/router.js | 2 +- lib/routes/cahkms/index.js | 2 +- lib/routes/cahkms/router.js | 2 +- lib/routes/caijing/roll.js | 2 +- lib/routes/caijing/router.js | 2 +- lib/routes/caixin/article.js | 2 +- lib/routes/caixin/blog.js | 2 +- lib/routes/caixin/category.js | 2 +- lib/routes/caixin/database.js | 2 +- lib/routes/caixin/k.js | 2 +- lib/routes/caixin/latest.js | 2 +- lib/routes/caixin/router.js | 2 +- lib/routes/caixin/weekly.js | 2 +- lib/routes/caixinglobal/latest.js | 2 +- lib/routes/caixinglobal/router.js | 2 +- lib/routes/camchina/index.js | 2 +- lib/routes/camchina/router.js | 2 +- lib/routes/cankaoxiaoxi/index.js | 2 +- lib/routes/cankaoxiaoxi/router.js | 2 +- lib/routes/cartoonmad/comic.js | 2 +- lib/routes/cartoonmad/router.js | 2 +- lib/routes/cas/cg/index.js | 2 +- lib/routes/cas/genetics/index.js | 2 +- lib/routes/cas/ia/yjs.js | 2 +- lib/routes/cas/iee/kydt.js | 2 +- lib/routes/cas/is/index.js | 2 +- lib/routes/cas/mesalab/kb.js | 2 +- lib/routes/cas/router.js | 2 +- lib/routes/cas/sim/kyjz.js | 2 +- lib/routes/cast/index.js | 2 +- lib/routes/cast/router.js | 2 +- lib/routes/cau/ele.js | 2 +- lib/routes/cau/router.js | 2 +- lib/routes/cau/yjs.js | 2 +- lib/routes/caus/index.js | 2 +- lib/routes/caus/router.js | 2 +- lib/routes/cbaigui/index.js | 2 +- lib/routes/cbaigui/router.js | 2 +- lib/routes/cbc/router.js | 2 +- lib/routes/cbc/topics.js | 2 +- lib/routes/cbirc/index.js | 2 +- lib/routes/cbirc/router.js | 2 +- lib/routes/cbnweek/index.js | 2 +- lib/routes/cbnweek/router.js | 2 +- lib/routes/ccac/news.js | 2 +- lib/routes/ccac/router.js | 2 +- lib/routes/ccf/ccfcv/index.js | 2 +- lib/routes/ccf/news.js | 2 +- lib/routes/ccf/router.js | 2 +- lib/routes/ccf/tfbd/index.js | 2 +- lib/routes/ccnu/career.js | 2 +- lib/routes/ccnu/cs.js | 2 +- lib/routes/ccnu/router.js | 2 +- lib/routes/ccnu/wu.js | 2 +- lib/routes/ccnu/yjs.js | 2 +- lib/routes/ccreports/index.js | 2 +- lib/routes/ccreports/router.js | 2 +- lib/routes/cctv/category.js | 2 +- lib/routes/cctv/jx.js | 2 +- lib/routes/cctv/lm.js | 2 +- lib/routes/cctv/router.js | 2 +- lib/routes/cctv/xwlb.js | 2 +- lib/routes/cde/index.js | 2 +- lib/routes/cde/router.js | 2 +- lib/routes/cde/xxgk.js | 2 +- lib/routes/cde/zdyz.js | 2 +- lib/routes/cdi/index.js | 2 +- lib/routes/cdi/router.js | 2 +- lib/routes/cdzjryb/project-list.js | 2 +- lib/routes/cdzjryb/router.js | 2 +- lib/routes/cebbank/all.js | 2 +- lib/routes/cebbank/history.js | 2 +- lib/routes/cebbank/router.js | 2 +- lib/routes/cfachina/analygarden.js | 2 +- lib/routes/cfachina/router.js | 2 +- lib/routes/cfmmc/index.js | 2 +- lib/routes/cfmmc/router.js | 2 +- lib/routes/cgtn/podcast.js | 2 +- lib/routes/cgtn/router.js | 2 +- lib/routes/chaincatcher/home.js | 2 +- lib/routes/chaincatcher/news.js | 2 +- lib/routes/chaincatcher/router.js | 2 +- lib/routes/changba/router.js | 2 +- lib/routes/changba/user.js | 2 +- lib/routes/chaoxing/qk.js | 2 +- lib/routes/chaoxing/router.js | 2 +- lib/routes/chaping/banner.js | 2 +- lib/routes/chaping/news.js | 2 +- lib/routes/chaping/newsflash.js | 2 +- lib/routes/chaping/router.js | 2 +- lib/routes/chiculture/router.js | 2 +- lib/routes/chiculture/topic.js | 2 +- lib/routes/china/finance/finance.js | 2 +- lib/routes/china/news/highlights/news.js | 2 +- lib/routes/china/news/military/news.js | 2 +- lib/routes/china/router.js | 2 +- lib/routes/chinadegrees/province.js | 2 +- lib/routes/chinadegrees/router.js | 2 +- lib/routes/chinafactcheck/index.js | 2 +- lib/routes/chinafactcheck/router.js | 2 +- lib/routes/chinaisa/index.js | 2 +- lib/routes/chinaisa/router.js | 2 +- lib/routes/chinamoney/notice.js | 2 +- lib/routes/chinamoney/router.js | 2 +- lib/routes/chinanews/index.js | 2 +- lib/routes/chinanews/router.js | 2 +- lib/routes/chinathinktanks/router.js | 2 +- lib/routes/chinathinktanks/viewpoint.js | 2 +- lib/routes/chinaventure/index.js | 2 +- lib/routes/chinaventure/router.js | 2 +- lib/routes/chinawriter/index.js | 2 +- lib/routes/chinawriter/router.js | 2 +- lib/routes/chsi/hotnews.js | 2 +- lib/routes/chsi/kydt.js | 2 +- lib/routes/chsi/kyzx.js | 2 +- lib/routes/chsi/router.js | 2 +- lib/routes/chuanliu/nice.js | 2 +- lib/routes/chuanliu/router.js | 2 +- lib/routes/cib/router.js | 2 +- lib/routes/cib/whpj.js | 2 +- lib/routes/ciidbnu/index.js | 2 +- lib/routes/ciidbnu/router.js | 2 +- lib/routes/civitai/discussions.js | 2 +- lib/routes/civitai/models.js | 2 +- lib/routes/civitai/router.js | 2 +- lib/routes/ciweimao/chapter.js | 2 +- lib/routes/ciweimao/router.js | 2 +- lib/routes/clickme/index.js | 2 +- lib/routes/clickme/router.js | 2 +- lib/routes/cloudnative/blog.js | 2 +- lib/routes/cloudnative/router.js | 2 +- lib/routes/cls/depth.js | 2 +- lib/routes/cls/hot.js | 2 +- lib/routes/cls/router.js | 2 +- lib/routes/cls/telegraph.js | 2 +- lib/routes/cma/channel.js | 2 +- lib/routes/cma/router.js | 2 +- lib/routes/cmde/index.js | 2 +- lib/routes/cmde/router.js | 2 +- lib/routes/cmpxchg8b/articles.js | 2 +- lib/routes/cmpxchg8b/router.js | 2 +- lib/routes/cn-healthcare/index.js | 2 +- lib/routes/cn-healthcare/router.js | 2 +- lib/routes/cna/index.js | 2 +- lib/routes/cna/router.js | 2 +- lib/routes/cna/web/index.js | 2 +- lib/routes/cnbc/router.js | 2 +- lib/routes/cnbc/rss.js | 2 +- lib/routes/cnbeta/router.js | 2 +- lib/routes/cnbeta/type.js | 2 +- lib/routes/cnblogs/common.js | 2 +- lib/routes/cnblogs/router.js | 2 +- lib/routes/cncf/index.js | 2 +- lib/routes/cncf/reports.js | 2 +- lib/routes/cncf/router.js | 2 +- lib/routes/cneb/router.js | 2 +- lib/routes/cneb/yjxw.js | 2 +- lib/routes/cneb/yjxx.js | 2 +- lib/routes/cngal/entry.js | 2 +- lib/routes/cngal/router.js | 2 +- lib/routes/cngal/weekly.js | 2 +- lib/routes/cnjxol/index.js | 2 +- lib/routes/cnjxol/router.js | 2 +- lib/routes/cnki/author.js | 2 +- lib/routes/cnki/debut.js | 2 +- lib/routes/cnki/journals.js | 2 +- lib/routes/cnki/router.js | 2 +- lib/routes/cnljxh/index.js | 2 +- lib/routes/cnljxh/router.js | 2 +- lib/routes/cntheory/paper.js | 2 +- lib/routes/cntheory/router.js | 2 +- lib/routes/cntv/column.js | 2 +- lib/routes/cntv/router.js | 2 +- lib/routes/codeforces/contests.js | 2 +- lib/routes/codeforces/recent-actions.js | 2 +- lib/routes/codeforces/router.js | 2 +- lib/routes/coindesk/index.js | 2 +- lib/routes/coindesk/router.js | 2 +- lib/routes/comicat/router.js | 2 +- lib/routes/comicat/search.js | 2 +- lib/routes/comicskingdom/index.js | 2 +- lib/routes/comicskingdom/router.js | 2 +- lib/routes/consumer/index.js | 2 +- lib/routes/consumer/router.js | 2 +- lib/routes/consumer/shopping-guide.js | 2 +- lib/routes/cool18/index.js | 2 +- lib/routes/cool18/router.js | 2 +- lib/routes/coolapk/dyh.js | 2 +- lib/routes/coolapk/hot.js | 2 +- lib/routes/coolapk/huati.js | 2 +- lib/routes/coolapk/router.js | 2 +- lib/routes/coolapk/toutiao.js | 2 +- lib/routes/coolapk/tuwen.js | 2 +- lib/routes/coolapk/user-dynamic.js | 2 +- lib/routes/coomer/artist.js | 2 +- lib/routes/coomer/posts.js | 2 +- lib/routes/coomer/router.js | 2 +- lib/routes/copymanga/comic.js | 2 +- lib/routes/copymanga/router.js | 2 +- lib/routes/cpcey/index.js | 2 +- lib/routes/cpcey/router.js | 2 +- lib/routes/cpuid/news.js | 2 +- lib/routes/cpuid/router.js | 2 +- lib/routes/cqgas/router.js | 2 +- lib/routes/cqgas/tqtz.js | 2 +- lib/routes/cqwu/index.js | 2 +- lib/routes/cqwu/router.js | 2 +- lib/routes/crac/index.js | 2 +- lib/routes/crac/router.js | 2 +- lib/routes/creative-comic/book.js | 2 +- lib/routes/creative-comic/router.js | 2 +- lib/routes/crossbell/feeds/following.js | 2 +- lib/routes/crossbell/notes/character.js | 2 +- lib/routes/crossbell/notes/index.js | 2 +- lib/routes/crossbell/notes/source.js | 2 +- lib/routes/crossbell/router.js | 2 +- lib/routes/cs/index.js | 2 +- lib/routes/cs/router.js | 2 +- lib/routes/cs/video.js | 2 +- lib/routes/csdn/blog.js | 2 +- lib/routes/csdn/router.js | 2 +- lib/routes/cssn/iolaw.js | 2 +- lib/routes/cssn/router.js | 2 +- lib/routes/cste/index.js | 2 +- lib/routes/cste/router.js | 2 +- lib/routes/csu/career.js | 2 +- lib/routes/csu/cse.js | 2 +- lib/routes/csu/mail.js | 2 +- lib/routes/csu/router.js | 2 +- lib/routes/cts/news.js | 2 +- lib/routes/cts/router.js | 2 +- lib/routes/cuc/router.js | 2 +- lib/routes/cuc/yz.js | 2 +- lib/routes/curiouscat/router.js | 2 +- lib/routes/curiouscat/user.js | 2 +- lib/routes/curius/links.js | 2 +- lib/routes/curius/router.js | 2 +- lib/routes/cw/author.js | 2 +- lib/routes/cw/master.js | 2 +- lib/routes/cw/router.js | 2 +- lib/routes/cw/sub.js | 2 +- lib/routes/cw/today.js | 2 +- lib/routes/cyzone/author.js | 2 +- lib/routes/cyzone/index.js | 2 +- lib/routes/cyzone/label.js | 2 +- lib/routes/cyzone/router.js | 2 +- lib/routes/cztv/daily.js | 2 +- lib/routes/cztv/router.js | 2 +- lib/routes/cztv/zjxwlb.js | 2 +- lib/routes/dahecube/index.js | 2 +- lib/routes/dahecube/router.js | 2 +- lib/routes/daily/discussed.js | 2 +- lib/routes/daily/index.js | 2 +- lib/routes/daily/router.js | 2 +- lib/routes/daily/upvoted.js | 2 +- lib/routes/damai/activity.js | 2 +- lib/routes/damai/router.js | 2 +- lib/routes/dapenti/router.js | 2 +- lib/routes/dapenti/subject.js | 2 +- lib/routes/dapenti/tugua.js | 2 +- lib/routes/darwinawards/index.js | 2 +- lib/routes/darwinawards/router.js | 2 +- lib/routes/dayanzai/index.js | 2 +- lib/routes/dayanzai/router.js | 2 +- lib/routes/dblp/publication.js | 2 +- lib/routes/dblp/router.js | 2 +- lib/routes/dcard/router.js | 2 +- lib/routes/dcard/section.js | 2 +- lib/routes/dcfever/news.js | 2 +- lib/routes/dcfever/reviews.js | 2 +- lib/routes/dcfever/router.js | 2 +- lib/routes/dcfever/trading-search.js | 2 +- lib/routes/dcfever/trading.js | 2 +- lib/routes/ddosi/category.js | 2 +- lib/routes/ddosi/index.js | 2 +- lib/routes/ddosi/router.js | 2 +- lib/routes/deadline/posts.js | 2 +- lib/routes/deadline/router.js | 2 +- lib/routes/dedao/index.js | 2 +- lib/routes/dedao/knowledge.js | 2 +- lib/routes/dedao/list.js | 2 +- lib/routes/dedao/router.js | 2 +- lib/routes/dedao/user.js | 2 +- lib/routes/deeplearning/router.js | 2 +- lib/routes/deeplearning/thebatch.js | 2 +- lib/routes/deepmind/blog.js | 2 +- lib/routes/deepmind/router.js | 2 +- lib/routes/deltaio/blog.js | 2 +- lib/routes/deltaio/router.js | 2 +- lib/routes/devolverdigital/blog.js | 2 +- lib/routes/devolverdigital/router.js | 2 +- lib/routes/dgjyw/index.js | 2 +- lib/routes/dgjyw/router.js | 2 +- lib/routes/dhu/jiaowu/news.js | 2 +- lib/routes/dhu/news/xsxx.js | 2 +- lib/routes/dhu/router.js | 2 +- lib/routes/dhu/xxgk/news.js | 2 +- lib/routes/dhu/yjs/news.js | 2 +- lib/routes/dhu/yjs/zs.js | 2 +- lib/routes/diandong/news.js | 2 +- lib/routes/diandong/router.js | 2 +- lib/routes/diershoubing/news.js | 2 +- lib/routes/diershoubing/router.js | 2 +- lib/routes/discord/channel.js | 2 +- lib/routes/discord/router.js | 2 +- lib/routes/discourse/notifications.js | 2 +- lib/routes/discourse/posts.js | 2 +- lib/routes/discourse/router.js | 2 +- lib/routes/discuz/discuz.js | 2 +- lib/routes/discuz/router.js | 2 +- lib/routes/disinfo/publications.js | 2 +- lib/routes/disinfo/router.js | 2 +- lib/routes/diskanalyzer/router.js | 2 +- lib/routes/diskanalyzer/whats-new.js | 2 +- lib/routes/distill/index.js | 2 +- lib/routes/distill/router.js | 2 +- lib/routes/dlnews/category.js | 2 +- lib/routes/dlnews/router.js | 2 +- lib/routes/dlsite/campaign.js | 2 +- lib/routes/dlsite/ci-en/article.js | 2 +- lib/routes/dlsite/index.js | 2 +- lib/routes/dlsite/new.js | 2 +- lib/routes/dlsite/router.js | 2 +- lib/routes/dmzj/news.js | 2 +- lib/routes/dmzj/router.js | 2 +- lib/routes/dn/news.js | 2 +- lib/routes/dn/router.js | 2 +- lib/routes/dnaindia/category.js | 2 +- lib/routes/dnaindia/router.js | 2 +- lib/routes/dockerhub/build.js | 2 +- lib/routes/dockerhub/router.js | 2 +- lib/routes/dockerhub/tag.js | 2 +- lib/routes/docschina/jsweekly.js | 2 +- lib/routes/docschina/router.js | 2 +- lib/routes/dol/announce.js | 2 +- lib/routes/dol/router.js | 2 +- lib/routes/domp4/detail.js | 2 +- lib/routes/domp4/latest.js | 2 +- lib/routes/domp4/router.js | 2 +- lib/routes/dongqiudi/daily.js | 2 +- lib/routes/dongqiudi/player-news.js | 2 +- lib/routes/dongqiudi/result.js | 2 +- lib/routes/dongqiudi/router.js | 2 +- lib/routes/dongqiudi/special.js | 2 +- lib/routes/dongqiudi/team-news.js | 2 +- lib/routes/dongqiudi/top-news.js | 2 +- lib/routes/dorohedoro/news.js | 2 +- lib/routes/dorohedoro/router.js | 2 +- lib/routes/douban/book/rank.js | 2 +- lib/routes/douban/channel/subject.js | 2 +- lib/routes/douban/channel/topic.js | 2 +- lib/routes/douban/commercialpress/latest.js | 2 +- lib/routes/douban/event/hot.js | 2 +- lib/routes/douban/other/bookstore.js | 2 +- lib/routes/douban/other/celebrity.js | 2 +- lib/routes/douban/other/classification.js | 2 +- lib/routes/douban/other/discussion.js | 2 +- lib/routes/douban/other/doulist.js | 2 +- lib/routes/douban/other/explore-column.js | 2 +- lib/routes/douban/other/explore.js | 2 +- lib/routes/douban/other/group.js | 2 +- lib/routes/douban/other/jobs.js | 2 +- lib/routes/douban/other/later.js | 2 +- lib/routes/douban/other/latest-book.js | 2 +- lib/routes/douban/other/latest-music.js | 2 +- lib/routes/douban/other/list.js | 2 +- lib/routes/douban/other/playing.js | 2 +- lib/routes/douban/other/recommended.js | 2 +- lib/routes/douban/other/replied.js | 2 +- lib/routes/douban/other/replies.js | 2 +- lib/routes/douban/other/topic.js | 2 +- lib/routes/douban/other/ustop.js | 2 +- lib/routes/douban/other/weekly-best.js | 2 +- lib/routes/douban/people/status.js | 2 +- lib/routes/douban/people/wish.js | 2 +- lib/routes/douban/router.js | 2 +- lib/routes/douyin/hashtag.js | 2 +- lib/routes/douyin/live.js | 2 +- lib/routes/douyin/router.js | 2 +- lib/routes/douyin/user.js | 2 +- lib/routes/douyu/group.js | 2 +- lib/routes/douyu/post.js | 2 +- lib/routes/douyu/room.js | 2 +- lib/routes/douyu/router.js | 2 +- lib/routes/dribbble/keyword.js | 2 +- lib/routes/dribbble/popular.js | 2 +- lib/routes/dribbble/router.js | 2 +- lib/routes/dribbble/user.js | 2 +- lib/routes/dtcj/datahero.js | 2 +- lib/routes/dtcj/datainsight.js | 2 +- lib/routes/dtcj/router.js | 2 +- lib/routes/duozhuayu/router.js | 2 +- lib/routes/duozhuayu/search.js | 2 +- lib/routes/dushu/fuzhou/index.js | 2 +- lib/routes/dushu/router.js | 2 +- lib/routes/dut/index.js | 2 +- lib/routes/dut/router.js | 2 +- lib/routes/dx2025/index.js | 2 +- lib/routes/dx2025/router.js | 2 +- lib/routes/dxy/profile/thread.js | 2 +- lib/routes/dxy/router.js | 2 +- lib/routes/dxy/special.js | 2 +- lib/routes/e-hentai/index.js | 2 +- lib/routes/e-hentai/router.js | 2 +- lib/routes/eagle/blog.js | 2 +- lib/routes/eagle/changelog.js | 2 +- lib/routes/eagle/router.js | 2 +- lib/routes/earthquake/ceic.js | 2 +- lib/routes/earthquake/index.js | 2 +- lib/routes/earthquake/router.js | 2 +- lib/routes/eastday/24.js | 2 +- lib/routes/eastday/portrait.js | 2 +- lib/routes/eastday/router.js | 2 +- lib/routes/eastday/sh.js | 2 +- lib/routes/eastmoney/report/index.js | 2 +- lib/routes/eastmoney/router.js | 2 +- lib/routes/eastmoney/search/index.js | 2 +- lib/routes/eastmoney/ttjj/user.js | 2 +- lib/routes/ecnu/contest.js | 2 +- lib/routes/ecnu/router.js | 2 +- lib/routes/ecnu/yjs.js | 2 +- lib/routes/economist/espresso.js | 2 +- lib/routes/economist/full.js | 2 +- lib/routes/economist/global-business-review.js | 2 +- lib/routes/economist/router.js | 2 +- lib/routes/ecust/e/news.js | 2 +- lib/routes/ecust/gschool/yjs.js | 2 +- lib/routes/ecust/jwc/notice.js | 2 +- lib/routes/ecust/router.js | 2 +- lib/routes/egsea/flash.js | 2 +- lib/routes/egsea/router.js | 2 +- lib/routes/ehentai/favorites.js | 2 +- lib/routes/ehentai/router.js | 2 +- lib/routes/ehentai/search.js | 2 +- lib/routes/ehentai/tag.js | 2 +- lib/routes/ekantipur/issue.js | 2 +- lib/routes/ekantipur/router.js | 2 +- lib/routes/elasticsearch-cn/index.js | 2 +- lib/routes/elasticsearch-cn/router.js | 2 +- lib/routes/eleduck/jobs.js | 2 +- lib/routes/eleduck/posts.js | 2 +- lib/routes/eleduck/router.js | 2 +- lib/routes/elsevier/issue.js | 2 +- lib/routes/elsevier/journal.js | 2 +- lib/routes/elsevier/router.js | 2 +- lib/routes/embassy/index.js | 2 +- lib/routes/embassy/router.js | 2 +- lib/routes/epicgames/index.js | 2 +- lib/routes/epicgames/router.js | 2 +- lib/routes/eprice/router.js | 2 +- lib/routes/eprice/rss.js | 2 +- lib/routes/eventernote/actors.js | 2 +- lib/routes/eventernote/router.js | 2 +- lib/routes/famitsu/category.js | 2 +- lib/routes/famitsu/router.js | 2 +- lib/routes/fansly/post.js | 2 +- lib/routes/fansly/router.js | 2 +- lib/routes/fansly/tag.js | 2 +- lib/routes/fantia/router.js | 2 +- lib/routes/fantia/search.js | 2 +- lib/routes/fantia/user.js | 2 +- lib/routes/farmatters/index.js | 2 +- lib/routes/farmatters/router.js | 2 +- lib/routes/fastbull/express-news.js | 2 +- lib/routes/fastbull/news.js | 2 +- lib/routes/fastbull/router.js | 2 +- lib/routes/fda/cdrh.js | 2 +- lib/routes/fda/router.js | 2 +- lib/routes/feng/forum.js | 2 +- lib/routes/feng/router.js | 2 +- lib/routes/ff14/ff14-global.js | 2 +- lib/routes/ff14/ff14-zh.js | 2 +- lib/routes/ff14/router.js | 2 +- lib/routes/fffdm/manhua/manhua.js | 2 +- lib/routes/fffdm/router.js | 2 +- lib/routes/finology/bullets.js | 2 +- lib/routes/finology/most-viewed.js | 2 +- lib/routes/finology/router.js | 2 +- lib/routes/finology/tag.js | 2 +- lib/routes/finviz/news.js | 2 +- lib/routes/finviz/quote.js | 2 +- lib/routes/finviz/router.js | 2 +- lib/routes/firecore/index.js | 2 +- lib/routes/firecore/router.js | 2 +- lib/routes/firefox/addons.js | 2 +- lib/routes/firefox/breaches.js | 2 +- lib/routes/firefox/release.js | 2 +- lib/routes/firefox/router.js | 2 +- lib/routes/fisher-spb/news.js | 2 +- lib/routes/fisher-spb/router.js | 2 +- lib/routes/fishshell/index.js | 2 +- lib/routes/fishshell/router.js | 2 +- lib/routes/fjksbm/index.js | 2 +- lib/routes/fjksbm/router.js | 2 +- lib/routes/flyert/creditcard.js | 2 +- lib/routes/flyert/preferential.js | 2 +- lib/routes/flyert/router.js | 2 +- lib/routes/focustaiwan/index.js | 2 +- lib/routes/focustaiwan/router.js | 2 +- lib/routes/followin/index.js | 2 +- lib/routes/followin/kol.js | 2 +- lib/routes/followin/news.js | 2 +- lib/routes/followin/router.js | 2 +- lib/routes/followin/tag.js | 2 +- lib/routes/followin/topic.js | 2 +- lib/routes/foresightnews/article.js | 2 +- lib/routes/foresightnews/column.js | 2 +- lib/routes/foresightnews/index.js | 2 +- lib/routes/foresightnews/news.js | 2 +- lib/routes/foresightnews/router.js | 2 +- lib/routes/foreverblog/feeds.js | 2 +- lib/routes/foreverblog/router.js | 2 +- lib/routes/fortnite/news.js | 2 +- lib/routes/fortnite/router.js | 2 +- lib/routes/fortunechina/index.js | 2 +- lib/routes/fortunechina/router.js | 2 +- lib/routes/fosshub/index.js | 2 +- lib/routes/fosshub/router.js | 2 +- lib/routes/free/router.js | 2 +- lib/routes/free/rss.js | 2 +- lib/routes/freebuf/index.js | 2 +- lib/routes/freebuf/router.js | 2 +- lib/routes/freecomputerbooks/index.js | 2 +- lib/routes/freecomputerbooks/router.js | 2 +- lib/routes/freewechat/profile.js | 2 +- lib/routes/freewechat/router.js | 2 +- lib/routes/ft/channel.js | 2 +- lib/routes/ft/myft.js | 2 +- lib/routes/ft/router.js | 2 +- lib/routes/fuliba/latest.js | 2 +- lib/routes/fuliba/router.js | 2 +- lib/routes/furstar/archive.js | 2 +- lib/routes/furstar/artists.js | 2 +- lib/routes/furstar/index.js | 2 +- lib/routes/furstar/router.js | 2 +- lib/routes/futunn/main.js | 2 +- lib/routes/futunn/router.js | 2 +- lib/routes/fx-markets/channel.js | 2 +- lib/routes/fx-markets/router.js | 2 +- lib/routes/fx678/kx.js | 2 +- lib/routes/fx678/router.js | 2 +- lib/routes/fxiaoke/crm.js | 2 +- lib/routes/fxiaoke/router.js | 2 +- lib/routes/fzmtr/announcements.js | 2 +- lib/routes/fzmtr/router.js | 2 +- lib/routes/gameapps/index.js | 2 +- lib/routes/gameapps/router.js | 2 +- lib/routes/gamebase/news.js | 2 +- lib/routes/gamebase/router.js | 2 +- lib/routes/gamegene/news.js | 2 +- lib/routes/gamegene/router.js | 2 +- lib/routes/gamer/gnn-index.js | 2 +- lib/routes/gamer/hot.js | 2 +- lib/routes/gamer/router.js | 2 +- lib/routes/gamersecret/index.js | 2 +- lib/routes/gamersecret/router.js | 2 +- lib/routes/gamme/category.js | 2 +- lib/routes/gamme/router.js | 2 +- lib/routes/gamme/tag.js | 2 +- lib/routes/gcores/category.js | 2 +- lib/routes/gcores/collection.js | 2 +- lib/routes/gcores/radio.js | 2 +- lib/routes/gcores/router.js | 2 +- lib/routes/gcores/tag.js | 2 +- lib/routes/gdsrx/index.js | 2 +- lib/routes/gdsrx/router.js | 2 +- lib/routes/gdut/news.js | 2 +- lib/routes/gdut/oa-news.js | 2 +- lib/routes/gdut/router.js | 2 +- lib/routes/gelonghui/home.js | 2 +- lib/routes/gelonghui/hot-article.js | 2 +- lib/routes/gelonghui/keyword.js | 2 +- lib/routes/gelonghui/live.js | 2 +- lib/routes/gelonghui/router.js | 2 +- lib/routes/gelonghui/subject.js | 2 +- lib/routes/gelonghui/user.js | 2 +- lib/routes/geocaching/blogs.js | 2 +- lib/routes/geocaching/router.js | 2 +- lib/routes/getdr/index.js | 2 +- lib/routes/getdr/router.js | 2 +- lib/routes/getitfree/index.js | 2 +- lib/routes/getitfree/router.js | 2 +- lib/routes/gettr/router.js | 2 +- lib/routes/gettr/user.js | 2 +- lib/routes/gf-cn/news.js | 2 +- lib/routes/gf-cn/router.js | 2 +- lib/routes/gihyo/group.js | 2 +- lib/routes/gihyo/router.js | 2 +- lib/routes/gitee/repos/commits.js | 2 +- lib/routes/gitee/repos/events.js | 2 +- lib/routes/gitee/repos/releases.js | 2 +- lib/routes/gitee/router.js | 2 +- lib/routes/gitee/users/events.js | 2 +- lib/routes/github/branches.js | 2 +- lib/routes/github/comments.js | 2 +- lib/routes/github/contributors.js | 2 +- lib/routes/github/file.js | 2 +- lib/routes/github/follower.js | 2 +- lib/routes/github/gist.js | 2 +- lib/routes/github/issue.js | 2 +- lib/routes/github/notifications.js | 2 +- lib/routes/github/pulls.js | 2 +- lib/routes/github/pulse.js | 2 +- lib/routes/github/repos.js | 2 +- lib/routes/github/router.js | 2 +- lib/routes/github/search.js | 2 +- lib/routes/github/star.js | 2 +- lib/routes/github/starred-repos.js | 2 +- lib/routes/github/topic.js | 2 +- lib/routes/github/trending.js | 2 +- lib/routes/github/wiki.js | 2 +- lib/routes/gitpod/blog.js | 2 +- lib/routes/gitpod/changelog.js | 2 +- lib/routes/gitpod/router.js | 2 +- lib/routes/globallawreview/index.js | 2 +- lib/routes/globallawreview/router.js | 2 +- lib/routes/gocn/jobs.js | 2 +- lib/routes/gocn/news.js | 2 +- lib/routes/gocn/router.js | 2 +- lib/routes/gocn/topics.js | 2 +- lib/routes/gofans/index.js | 2 +- lib/routes/gofans/router.js | 2 +- lib/routes/gogoanimehd/recent-releases.js | 2 +- lib/routes/gogoanimehd/router.js | 2 +- lib/routes/google/album.js | 2 +- lib/routes/google/alerts.js | 2 +- lib/routes/google/citations.js | 2 +- lib/routes/google/doodles.js | 2 +- lib/routes/google/fonts.js | 2 +- lib/routes/google/news.js | 2 +- lib/routes/google/router.js | 2 +- lib/routes/google/scholar.js | 2 +- lib/routes/google/search.js | 2 +- lib/routes/gov/anhui/kjt.js | 2 +- lib/routes/gov/beijing/bjedu/gh.js | 2 +- lib/routes/gov/beijing/bphc/index.js | 2 +- lib/routes/gov/beijing/jw/tzgg.js | 2 +- lib/routes/gov/beijing/kw/index.js | 2 +- lib/routes/gov/caac/cjwt.js | 2 +- lib/routes/gov/cac/index.js | 2 +- lib/routes/gov/ccdi/index.js | 2 +- lib/routes/gov/chinamine-safety/xw.js | 2 +- lib/routes/gov/chinamine-safety/zfxxgk.js | 2 +- lib/routes/gov/chinatax/latest.js | 2 +- lib/routes/gov/chongqing/gzw.js | 2 +- lib/routes/gov/chongqing/rsks.js | 2 +- lib/routes/gov/chongqing/sydwgkzp.js | 2 +- lib/routes/gov/cmse/fxrw.js | 2 +- lib/routes/gov/cmse/index.js | 2 +- lib/routes/gov/cnnic/index.js | 2 +- lib/routes/gov/csrc/auditstatus.js | 2 +- lib/routes/gov/csrc/news.js | 2 +- lib/routes/gov/customs/list.js | 2 +- lib/routes/gov/dianbai/dianbai.js | 2 +- lib/routes/gov/forestry/gjlckjdjt.js | 2 +- lib/routes/gov/gaozhou/gaozhou.js | 2 +- lib/routes/gov/general/general.js | 2 +- lib/routes/gov/guangdong/tqyb/sncsyjxh.js | 2 +- lib/routes/gov/guangdong/tqyb/tfxtq.js | 2 +- lib/routes/gov/gz/index.js | 2 +- lib/routes/gov/hebei/czt.js | 2 +- lib/routes/gov/huazhou/huazhou.js | 2 +- lib/routes/gov/huizhou/zwgk/index.js | 2 +- lib/routes/gov/hunan/changsha/major-email.js | 2 +- lib/routes/gov/immiau/news.js | 2 +- lib/routes/gov/jgjcndrc/index.js | 2 +- .../gov/jinan/healthcommission/medical-exam-notice.js | 2 +- lib/routes/gov/maoming/maoming.js | 2 +- lib/routes/gov/maonan/maonan.js | 2 +- lib/routes/gov/mee/ywdt.js | 2 +- lib/routes/gov/mem/sgcc.js | 2 +- lib/routes/gov/mfa/wjdt.js | 2 +- lib/routes/gov/mgs/mgs.js | 2 +- lib/routes/gov/miit/wjfb.js | 2 +- lib/routes/gov/miit/wjgs.js | 2 +- lib/routes/gov/miit/yjzj.js | 2 +- lib/routes/gov/miit/zcjd.js | 2 +- lib/routes/gov/miit/zcwj.js | 2 +- lib/routes/gov/mmht/mmht.js | 2 +- lib/routes/gov/moa/moa.js | 2 +- lib/routes/gov/moa/zdscxx.js | 2 +- lib/routes/gov/moe/moe.js | 2 +- lib/routes/gov/moe/s78.js | 2 +- lib/routes/gov/mof/bond.js | 2 +- lib/routes/gov/mofcom/article.js | 2 +- lib/routes/gov/moj/aac/news.js | 2 +- lib/routes/gov/moj/lfyjzj.js | 2 +- lib/routes/gov/mot/index.js | 2 +- lib/routes/gov/ndrc/fggz.js | 2 +- lib/routes/gov/ndrc/xwdt.js | 2 +- lib/routes/gov/nea/ghs.js | 2 +- lib/routes/gov/news/index.js | 2 +- lib/routes/gov/nifdc/index.js | 2 +- lib/routes/gov/nmpa/generic.js | 2 +- lib/routes/gov/nopss/index.js | 2 +- lib/routes/gov/npc/index.js | 2 +- lib/routes/gov/nrta/dsj.js | 2 +- lib/routes/gov/nrta/news.js | 2 +- lib/routes/gov/nsfc/index.js | 2 +- lib/routes/gov/pbc/goutongjiaoliu.js | 2 +- lib/routes/gov/pbc/gzlw.js | 2 +- lib/routes/gov/pbc/trade-announcement.js | 2 +- lib/routes/gov/pbc/zcyj.js | 2 +- lib/routes/gov/router.js | 2 +- lib/routes/gov/safe/business.js | 2 +- lib/routes/gov/safe/complaint.js | 2 +- lib/routes/gov/samr/xgzlyhd.js | 2 +- lib/routes/gov/sasac/generic.js | 2 +- lib/routes/gov/sdb/sdb.js | 2 +- lib/routes/gov/shaanxi/kjt.js | 2 +- lib/routes/gov/shanghai/rsj/ksxm.js | 2 +- lib/routes/gov/shanghai/wgj/wgj.js | 2 +- lib/routes/gov/shanghai/wsjkw/yqtb/index.js | 2 +- lib/routes/gov/shanghai/yjj/index.js | 2 +- lib/routes/gov/shenzhen/hrss/szksy/index.js | 2 +- lib/routes/gov/shenzhen/xxgk/zfxxgj.js | 2 +- lib/routes/gov/shenzhen/zjj/index.js | 2 +- lib/routes/gov/shenzhen/zzb/index.js | 2 +- lib/routes/gov/sichuan/deyang/govpublicinfo.js | 2 +- lib/routes/gov/sichuan/deyang/mztoday.js | 2 +- lib/routes/gov/stats/index.js | 2 +- lib/routes/gov/suzhou/doc.js | 2 +- lib/routes/gov/suzhou/fg.js | 2 +- lib/routes/gov/suzhou/news.js | 2 +- lib/routes/gov/taiyuan/rsj.js | 2 +- lib/routes/gov/wuhan/whyw.js | 2 +- lib/routes/gov/xinyi/xinyi.js | 2 +- lib/routes/gov/xuzhou/hrss.js | 2 +- lib/routes/gov/zhejiang/gwy.js | 2 +- lib/routes/gov/zhengce/govall.js | 2 +- lib/routes/gov/zhengce/index.js | 2 +- lib/routes/gov/zhengce/wenjian.js | 2 +- lib/routes/gov/zhengce/zhengceku.js | 2 +- lib/routes/greasyfork/feedback.js | 2 +- lib/routes/greasyfork/router.js | 2 +- lib/routes/greasyfork/scripts.js | 2 +- lib/routes/greasyfork/versions.js | 2 +- lib/routes/grist/featured.js | 2 +- lib/routes/grist/index.js | 2 +- lib/routes/grist/router.js | 2 +- lib/routes/grist/series.js | 2 +- lib/routes/grist/topic.js | 2 +- lib/routes/grubstreet/index.js | 2 +- lib/routes/grubstreet/router.js | 2 +- lib/routes/guancha/headline.js | 2 +- lib/routes/guancha/index.js | 2 +- lib/routes/guancha/member.js | 2 +- lib/routes/guancha/personalpage.js | 2 +- lib/routes/guancha/router.js | 2 +- lib/routes/guancha/topic.js | 2 +- lib/routes/guangdiu/cheaps.js | 2 +- lib/routes/guangdiu/index.js | 2 +- lib/routes/guangdiu/rank.js | 2 +- lib/routes/guangdiu/router.js | 2 +- lib/routes/guangdiu/search.js | 2 +- lib/routes/guangzhoumetro/news.js | 2 +- lib/routes/guangzhoumetro/router.js | 2 +- lib/routes/guanhai/index.js | 2 +- lib/routes/guanhai/router.js | 2 +- lib/routes/guduodata/daily.js | 2 +- lib/routes/guduodata/router.js | 2 +- lib/routes/gumroad/index.js | 2 +- lib/routes/gumroad/router.js | 2 +- lib/routes/guokr/channel.js | 2 +- lib/routes/guokr/router.js | 2 +- lib/routes/guokr/scientific.js | 2 +- lib/routes/gxmzu/ai.js | 2 +- lib/routes/gxmzu/lib.js | 2 +- lib/routes/gxmzu/router.js | 2 +- lib/routes/gxmzu/yjs.js | 2 +- lib/routes/gzdaily/app.js | 2 +- lib/routes/gzdaily/router.js | 2 +- lib/routes/gzhu/router.js | 2 +- lib/routes/gzhu/yjs.js | 2 +- lib/routes/hackernews/index.js | 2 +- lib/routes/hackernews/router.js | 2 +- lib/routes/hackertalk/index.js | 2 +- lib/routes/hackertalk/router.js | 2 +- lib/routes/hacking8/index.js | 2 +- lib/routes/hacking8/router.js | 2 +- lib/routes/hacking8/search.js | 2 +- lib/routes/hackmd/profile.js | 2 +- lib/routes/hackmd/router.js | 2 +- lib/routes/hackyournews/index.js | 2 +- lib/routes/hackyournews/router.js | 2 +- lib/routes/hafu/news.js | 2 +- lib/routes/hafu/router.js | 2 +- lib/routes/hakkatv/router.js | 2 +- lib/routes/hakkatv/type.js | 2 +- lib/routes/hameln/chapter.js | 2 +- lib/routes/hameln/router.js | 2 +- lib/routes/harvard/health/blog.js | 2 +- lib/routes/harvard/router.js | 2 +- lib/routes/hashnode/blog.js | 2 +- lib/routes/hashnode/router.js | 2 +- lib/routes/hbooker/chapter.js | 2 +- lib/routes/hbooker/router.js | 2 +- lib/routes/hbr/router.js | 2 +- lib/routes/hbr/topic.js | 2 +- lib/routes/hdu/cs/notice.js | 2 +- lib/routes/hdu/cs/pg.js | 2 +- lib/routes/hdu/router.js | 2 +- lib/routes/hebtv/nong-bo-shi-zai-xing-dong.js | 2 +- lib/routes/hebtv/router.js | 2 +- lib/routes/hellobtc/information.js | 2 +- lib/routes/hellobtc/kepu.js | 2 +- lib/routes/hellobtc/news.js | 2 +- lib/routes/hellobtc/router.js | 2 +- lib/routes/hellogithub/index.js | 2 +- lib/routes/hellogithub/report.js | 2 +- lib/routes/hellogithub/router.js | 2 +- lib/routes/hellogithub/volume.js | 2 +- lib/routes/hex-rays/index.js | 2 +- lib/routes/hex-rays/router.js | 2 +- lib/routes/hicairo/router.js | 2 +- lib/routes/hicairo/rss.js | 2 +- lib/routes/hinatazaka46/blog.js | 2 +- lib/routes/hinatazaka46/news.js | 2 +- lib/routes/hinatazaka46/router.js | 2 +- lib/routes/hit/hitgs.js | 2 +- lib/routes/hit/jwc.js | 2 +- lib/routes/hit/router.js | 2 +- lib/routes/hit/today.js | 2 +- lib/routes/hitsz/article.js | 2 +- lib/routes/hitsz/router.js | 2 +- lib/routes/hitwh/router.js | 2 +- lib/routes/hitwh/today.js | 2 +- lib/routes/hizu/index.js | 2 +- lib/routes/hizu/router.js | 2 +- lib/routes/hk01/channel.js | 2 +- lib/routes/hk01/hot.js | 2 +- lib/routes/hk01/issue.js | 2 +- lib/routes/hk01/latest.js | 2 +- lib/routes/hk01/router.js | 2 +- lib/routes/hk01/tag.js | 2 +- lib/routes/hk01/zone.js | 2 +- lib/routes/hkej/index.js | 2 +- lib/routes/hkej/router.js | 2 +- lib/routes/hkepc/index.js | 2 +- lib/routes/hkepc/router.js | 2 +- lib/routes/hket/index.js | 2 +- lib/routes/hket/router.js | 2 +- lib/routes/hkjunkcall/index.js | 2 +- lib/routes/hkjunkcall/router.js | 2 +- lib/routes/hljucm/router.js | 2 +- lib/routes/hljucm/yjsy.js | 2 +- lib/routes/hnrb/index.js | 2 +- lib/routes/hnrb/router.js | 2 +- lib/routes/hnu/careers.js | 2 +- lib/routes/hnu/router.js | 2 +- lib/routes/hongkong/chp.js | 2 +- lib/routes/hongkong/dh.js | 2 +- lib/routes/hongkong/router.js | 2 +- lib/routes/hostmonit/cloudflareyes.js | 2 +- lib/routes/hostmonit/cloudflareyesv6.js | 2 +- lib/routes/hostmonit/router.js | 2 +- lib/routes/hotukdeals/hottest.js | 2 +- lib/routes/hotukdeals/index.js | 2 +- lib/routes/hotukdeals/router.js | 2 +- lib/routes/houxu/events.js | 2 +- lib/routes/houxu/index.js | 2 +- lib/routes/houxu/lives.js | 2 +- lib/routes/houxu/memory.js | 2 +- lib/routes/houxu/router.js | 2 +- lib/routes/howtoforge/router.js | 2 +- lib/routes/howtoforge/rss.js | 2 +- lib/routes/hoyolab/news.js | 2 +- lib/routes/hoyolab/router.js | 2 +- lib/routes/hpoi/banner-item.js | 2 +- lib/routes/hpoi/info.js | 2 +- lib/routes/hpoi/router.js | 2 +- lib/routes/hpoi/user.js | 2 +- lib/routes/hrbeu/gx/card.js | 2 +- lib/routes/hrbeu/gx/list.js | 2 +- lib/routes/hrbeu/job/bigemploy.js | 2 +- lib/routes/hrbeu/job/calendar.js | 2 +- lib/routes/hrbeu/job/list.js | 2 +- lib/routes/hrbeu/router.js | 2 +- lib/routes/hrbeu/uae/news.js | 2 +- lib/routes/hrbeu/ugs/news.js | 2 +- lib/routes/hrbeu/yjsy/list.js | 2 +- lib/routes/hrbust/jwzx.js | 2 +- lib/routes/hrbust/router.js | 2 +- lib/routes/huanqiu/index.js | 2 +- lib/routes/huanqiu/router.js | 2 +- lib/routes/huggingface/blog-zh.js | 2 +- lib/routes/huggingface/daily-papers.js | 2 +- lib/routes/huggingface/router.js | 2 +- lib/routes/hunanpea/router.js | 2 +- lib/routes/hunanpea/rsks.js | 2 +- lib/routes/hunau/gfxy/index.js | 2 +- lib/routes/hunau/ied.js | 2 +- lib/routes/hunau/jwc.js | 2 +- lib/routes/hunau/router.js | 2 +- lib/routes/hunau/xky/index.js | 2 +- lib/routes/huoxian/router.js | 2 +- lib/routes/huoxian/zone.js | 2 +- lib/routes/hupu/all.js | 2 +- lib/routes/hupu/bbs.js | 2 +- lib/routes/hupu/index.js | 2 +- lib/routes/hupu/router.js | 2 +- lib/routes/hust/aia/news.js | 2 +- lib/routes/hust/aia/notice.js | 2 +- lib/routes/hust/router.js | 2 +- lib/routes/hust/yjs.js | 2 +- lib/routes/huxiu/brief-column.js | 2 +- lib/routes/huxiu/channel.js | 2 +- lib/routes/huxiu/club.js | 2 +- lib/routes/huxiu/collection.js | 2 +- lib/routes/huxiu/member.js | 2 +- lib/routes/huxiu/moment.js | 2 +- lib/routes/huxiu/router.js | 2 +- lib/routes/huxiu/search.js | 2 +- lib/routes/huxiu/tag.js | 2 +- lib/routes/ianspriggs/index.js | 2 +- lib/routes/ianspriggs/router.js | 2 +- lib/routes/icac/news.js | 2 +- lib/routes/icac/router.js | 2 +- lib/routes/icbc/router.js | 2 +- lib/routes/icbc/whpj.js | 2 +- lib/routes/idolypride/news.js | 2 +- lib/routes/idolypride/router.js | 2 +- lib/routes/ieee-security/router.js | 2 +- lib/routes/ieee-security/sp.js | 2 +- lib/routes/ieee/earlyaccess.js | 2 +- lib/routes/ieee/journal.js | 2 +- lib/routes/ieee/recent.js | 2 +- lib/routes/ieee/router.js | 2 +- lib/routes/ielts/index.js | 2 +- lib/routes/ielts/router.js | 2 +- lib/routes/ifeng/feng.js | 2 +- lib/routes/ifeng/news.js | 2 +- lib/routes/ifeng/router.js | 2 +- lib/routes/ifi-audio/download.js | 2 +- lib/routes/ifi-audio/router.js | 2 +- lib/routes/iguoguo/index.js | 2 +- lib/routes/iguoguo/router.js | 2 +- lib/routes/iiilab/index.js | 2 +- lib/routes/iiilab/router.js | 2 +- lib/routes/ikea/cn/family-offers.js | 2 +- lib/routes/ikea/cn/low-price.js | 2 +- lib/routes/ikea/cn/new.js | 2 +- lib/routes/ikea/gb/new.js | 2 +- lib/routes/ikea/gb/offer.js | 2 +- lib/routes/ikea/router.js | 2 +- lib/routes/imagemagick/changelog.js | 2 +- lib/routes/imagemagick/router.js | 2 +- lib/routes/imiker/jinghua.js | 2 +- lib/routes/imiker/router.js | 2 +- lib/routes/indiansinkuwait/latest.js | 2 +- lib/routes/indiansinkuwait/router.js | 2 +- lib/routes/indienova/article.js | 2 +- lib/routes/indienova/column.js | 2 +- lib/routes/indienova/gamedb.js | 2 +- lib/routes/indienova/router.js | 2 +- lib/routes/indienova/usergames.js | 2 +- lib/routes/inewsweek/index.js | 2 +- lib/routes/inewsweek/router.js | 2 +- lib/routes/infoq/recommend.js | 2 +- lib/routes/infoq/router.js | 2 +- lib/routes/infoq/topic.js | 2 +- lib/routes/informs/index.js | 2 +- lib/routes/informs/router.js | 2 +- lib/routes/inoreader/index.js | 2 +- lib/routes/inoreader/router.js | 2 +- lib/routes/inoreader/rss.js | 2 +- lib/routes/instagram/private-api/index.js | 2 +- lib/routes/instagram/router.js | 2 +- lib/routes/instagram/web-api/index.js | 2 +- lib/routes/instructables/projects.js | 2 +- lib/routes/instructables/router.js | 2 +- lib/routes/iqilu/program.js | 2 +- lib/routes/iqilu/router.js | 2 +- lib/routes/iqiyi/album.js | 2 +- lib/routes/iqiyi/router.js | 2 +- lib/routes/iqiyi/video.js | 2 +- lib/routes/iqnew/latest.js | 2 +- lib/routes/iqnew/router.js | 2 +- lib/routes/iresearch/report.js | 2 +- lib/routes/iresearch/router.js | 2 +- lib/routes/iresearch/weekly.js | 2 +- lib/routes/issuehunt/funded.js | 2 +- lib/routes/issuehunt/router.js | 2 +- lib/routes/itch/devlog.js | 2 +- lib/routes/itch/index.js | 2 +- lib/routes/itch/posts.js | 2 +- lib/routes/itch/router.js | 2 +- lib/routes/ithome/index.js | 2 +- lib/routes/ithome/ranking.js | 2 +- lib/routes/ithome/router.js | 2 +- lib/routes/ithome/tag.js | 2 +- lib/routes/ithome/tw/feeds.js | 2 +- lib/routes/ithome/zt.js | 2 +- lib/routes/iwara/index.js | 2 +- lib/routes/iwara/router.js | 2 +- lib/routes/iwara/subscriptions.js | 2 +- lib/routes/ixigua/router.js | 2 +- lib/routes/ixigua/user-video.js | 2 +- lib/routes/jandan/index.js | 2 +- lib/routes/jandan/router.js | 2 +- lib/routes/jandan/section.js | 2 +- lib/routes/japanpost/router.js | 2 +- lib/routes/japanpost/track.js | 2 +- lib/routes/javbus/index.js | 2 +- lib/routes/javbus/router.js | 2 +- lib/routes/javdb/actors.js | 2 +- lib/routes/javdb/index.js | 2 +- lib/routes/javdb/lists.js | 2 +- lib/routes/javdb/makers.js | 2 +- lib/routes/javdb/rankings.js | 2 +- lib/routes/javdb/router.js | 2 +- lib/routes/javdb/search.js | 2 +- lib/routes/javdb/series.js | 2 +- lib/routes/javdb/tags.js | 2 +- lib/routes/javlibrary/bestrated.js | 2 +- lib/routes/javlibrary/bestreviews.js | 2 +- lib/routes/javlibrary/genre.js | 2 +- lib/routes/javlibrary/maker.js | 2 +- lib/routes/javlibrary/mostwanted.js | 2 +- lib/routes/javlibrary/newentries.js | 2 +- lib/routes/javlibrary/newrelease.js | 2 +- lib/routes/javlibrary/router.js | 2 +- lib/routes/javlibrary/star.js | 2 +- lib/routes/javlibrary/update.js | 2 +- lib/routes/javlibrary/user.js | 2 +- lib/routes/jd/price.js | 2 +- lib/routes/jd/router.js | 2 +- lib/routes/jewishmuseum/exhibitions.js | 2 +- lib/routes/jewishmuseum/router.js | 2 +- lib/routes/jianshu/collection.js | 2 +- lib/routes/jianshu/home.js | 2 +- lib/routes/jianshu/router.js | 2 +- lib/routes/jianshu/user.js | 2 +- lib/routes/jiaoliudao/index.js | 2 +- lib/routes/jiaoliudao/router.js | 2 +- lib/routes/jiemian/list.js | 2 +- lib/routes/jiemian/lists.js | 2 +- lib/routes/jiemian/router.js | 2 +- lib/routes/jike/router.js | 2 +- lib/routes/jike/topic-text.js | 2 +- lib/routes/jike/topic.js | 2 +- lib/routes/jike/user.js | 2 +- lib/routes/jin10/index.js | 2 +- lib/routes/jin10/router.js | 2 +- lib/routes/jin10/topic.js | 2 +- lib/routes/jinse/catalogue.js | 2 +- lib/routes/jinse/lives.js | 2 +- lib/routes/jinse/router.js | 2 +- lib/routes/jinse/timeline.js | 2 +- lib/routes/jisilu/index.js | 2 +- lib/routes/jisilu/router.js | 2 +- lib/routes/jjwxc/author.js | 2 +- lib/routes/jjwxc/book.js | 2 +- lib/routes/jjwxc/router.js | 2 +- lib/routes/jornada/index.js | 2 +- lib/routes/jornada/router.js | 2 +- lib/routes/jou/home.js | 2 +- lib/routes/jou/router.js | 2 +- lib/routes/jou/yz.js | 2 +- lib/routes/jseea/news.js | 2 +- lib/routes/jseea/router.js | 2 +- lib/routes/jsu/cxzx.js | 2 +- lib/routes/jsu/jwc.js | 2 +- lib/routes/jsu/math.js | 2 +- lib/routes/jsu/rjxy.js | 2 +- lib/routes/jsu/router.js | 2 +- lib/routes/jsu/universityindex.js | 2 +- lib/routes/juejin/books.js | 2 +- lib/routes/juejin/category.js | 2 +- lib/routes/juejin/collection.js | 2 +- lib/routes/juejin/column.js | 2 +- lib/routes/juejin/favorites.js | 2 +- lib/routes/juejin/pins.js | 2 +- lib/routes/juejin/posts.js | 2 +- lib/routes/juejin/router.js | 2 +- lib/routes/juejin/tag.js | 2 +- lib/routes/juejin/trending.js | 2 +- lib/routes/jump/discount.js | 2 +- lib/routes/jump/router.js | 2 +- lib/routes/kamen-rider-official/news.js | 2 +- lib/routes/kamen-rider-official/router.js | 2 +- lib/routes/kantarworldpanel/index.js | 2 +- lib/routes/kantarworldpanel/router.js | 2 +- lib/routes/kbs/news.js | 2 +- lib/routes/kbs/router.js | 2 +- lib/routes/kbs/today.js | 2 +- lib/routes/kcna/news.js | 2 +- lib/routes/kcna/router.js | 2 +- lib/routes/ke/results.js | 2 +- lib/routes/ke/router.js | 2 +- lib/routes/keep/router.js | 2 +- lib/routes/keep/user.js | 2 +- lib/routes/keepass/news.js | 2 +- lib/routes/keepass/router.js | 2 +- lib/routes/kemono/index.js | 2 +- lib/routes/kemono/router.js | 2 +- lib/routes/kepu/live.js | 2 +- lib/routes/kepu/router.js | 2 +- lib/routes/keylol/index.js | 2 +- lib/routes/keylol/router.js | 2 +- lib/routes/kimlaw/router.js | 2 +- lib/routes/kimlaw/thesis.js | 2 +- lib/routes/konghq/blog-posts.js | 2 +- lib/routes/konghq/router.js | 2 +- lib/routes/kuaidi100/index.js | 2 +- lib/routes/kuaidi100/router.js | 2 +- lib/routes/kuaidi100/supported-company.js | 2 +- lib/routes/kunchengblog/essay.js | 2 +- lib/routes/kunchengblog/router.js | 2 +- lib/routes/kuwaitlocal/index.js | 2 +- lib/routes/kuwaitlocal/router.js | 2 +- lib/routes/kyodonews/index.js | 2 +- lib/routes/kyodonews/router.js | 2 +- lib/routes/laimanhua/index.js | 2 +- lib/routes/laimanhua/router.js | 2 +- lib/routes/lala/router.js | 2 +- lib/routes/lala/rss.js | 2 +- lib/routes/lang/room.js | 2 +- lib/routes/lang/router.js | 2 +- lib/routes/lanqiao/author.js | 2 +- lib/routes/lanqiao/courses.js | 2 +- lib/routes/lanqiao/questions.js | 2 +- lib/routes/lanqiao/router.js | 2 +- lib/routes/laohu8/personal.js | 2 +- lib/routes/laohu8/router.js | 2 +- lib/routes/latepost/index.js | 2 +- lib/routes/latepost/router.js | 2 +- lib/routes/layoffs/index.js | 2 +- lib/routes/layoffs/router.js | 2 +- lib/routes/learnblockchain/posts.js | 2 +- lib/routes/learnblockchain/router.js | 2 +- lib/routes/learnku/router.js | 2 +- lib/routes/learnku/topic.js | 2 +- lib/routes/leetcode/articles.js | 2 +- lib/routes/leetcode/dailyquestion-cn.js | 2 +- lib/routes/leetcode/dailyquestion-en.js | 2 +- lib/routes/leetcode/dailyquestion-solution-cn.js | 2 +- lib/routes/leetcode/dailyquestion-solution-en.js | 2 +- lib/routes/leetcode/router.js | 2 +- lib/routes/leiphone/index.js | 2 +- lib/routes/leiphone/newsflash.js | 2 +- lib/routes/leiphone/router.js | 2 +- lib/routes/lemmy/index.js | 2 +- lib/routes/lemmy/router.js | 2 +- lib/routes/lfsyd/home.js | 2 +- lib/routes/lfsyd/old-home.js | 2 +- lib/routes/lfsyd/router.js | 2 +- lib/routes/lfsyd/tag.js | 2 +- lib/routes/lfsyd/user.js | 2 +- lib/routes/lifeweek/channel.js | 2 +- lib/routes/lifeweek/router.js | 2 +- lib/routes/lifeweek/tag.js | 2 +- lib/routes/lightnovel/light-novel.js | 2 +- lib/routes/lightnovel/router.js | 2 +- lib/routes/line/publisher.js | 2 +- lib/routes/line/router.js | 2 +- lib/routes/line/today.js | 2 +- lib/routes/linkedin/cn/index.js | 2 +- lib/routes/linkedin/jobs.js | 2 +- lib/routes/linkedin/router.js | 2 +- lib/routes/linkresearcher/index.js | 2 +- lib/routes/linkresearcher/router.js | 2 +- lib/routes/linovelib/novel.js | 2 +- lib/routes/linovelib/router.js | 2 +- lib/routes/liquipedia/cs-matches.js | 2 +- lib/routes/liquipedia/dota2-matches.js | 2 +- lib/routes/liquipedia/router.js | 2 +- lib/routes/literotica/category.js | 2 +- lib/routes/literotica/new.js | 2 +- lib/routes/literotica/router.js | 2 +- lib/routes/liulinblog/index.js | 2 +- lib/routes/liulinblog/itnews.js | 2 +- lib/routes/liulinblog/router.js | 2 +- lib/routes/liveuamap/index.js | 2 +- lib/routes/liveuamap/router.js | 2 +- lib/routes/lkong/forum.js | 2 +- lib/routes/lkong/router.js | 2 +- lib/routes/lkong/thread.js | 2 +- lib/routes/lofter/router.js | 2 +- lib/routes/lofter/tag.js | 2 +- lib/routes/lofter/user.js | 2 +- lib/routes/logclub/index.js | 2 +- lib/routes/logclub/report.js | 2 +- lib/routes/logclub/router.js | 2 +- lib/routes/logonews/index.js | 2 +- lib/routes/logonews/router.js | 2 +- lib/routes/loltw/news.js | 2 +- lib/routes/loltw/router.js | 2 +- lib/routes/lovelive-anime/news.js | 2 +- lib/routes/lovelive-anime/router.js | 2 +- lib/routes/lovelive-anime/schedules.js | 2 +- lib/routes/lovelive-anime/topics.js | 2 +- lib/routes/lsnu/jiaowc/tzgg.js | 2 +- lib/routes/lsnu/router.js | 2 +- lib/routes/luogu/contest.js | 2 +- lib/routes/luogu/daily.js | 2 +- lib/routes/luogu/router.js | 2 +- lib/routes/luogu/user-blog.js | 2 +- lib/routes/luogu/user-feed.js | 2 +- lib/routes/luxiangdong/archive.js | 2 +- lib/routes/luxiangdong/router.js | 2 +- lib/routes/lvv2/news.js | 2 +- lib/routes/lvv2/router.js | 2 +- lib/routes/lvv2/top.js | 2 +- lib/routes/lxixsxa/discography.js | 2 +- lib/routes/lxixsxa/information.js | 2 +- lib/routes/lxixsxa/router.js | 2 +- lib/routes/m4/index.js | 2 +- lib/routes/m4/router.js | 2 +- lib/routes/macfilos/blog.js | 2 +- lib/routes/macfilos/router.js | 2 +- lib/routes/macmenubar/recently.js | 2 +- lib/routes/macmenubar/router.js | 2 +- lib/routes/macupdate/app.js | 2 +- lib/routes/macupdate/router.js | 2 +- lib/routes/magazinelib/latest-magazine.js | 2 +- lib/routes/magazinelib/router.js | 2 +- lib/routes/mail/imap.js | 2 +- lib/routes/mail/router.js | 2 +- lib/routes/mangadex/index.js | 2 +- lib/routes/mangadex/router.js | 2 +- lib/routes/manhuagui/comic.js | 2 +- lib/routes/manhuagui/router.js | 2 +- lib/routes/manhuagui/subscribe.js | 2 +- lib/routes/mastodon/account-id.js | 2 +- lib/routes/mastodon/acct.js | 2 +- lib/routes/mastodon/router.js | 2 +- lib/routes/mastodon/timeline-local.js | 2 +- lib/routes/mastodon/timeline-remote.js | 2 +- lib/routes/mckinsey/cn/index.js | 2 +- lib/routes/mckinsey/router.js | 2 +- lib/routes/mdpi/journal.js | 2 +- lib/routes/mdpi/router.js | 2 +- lib/routes/medieval-china/post.js | 2 +- lib/routes/medieval-china/router.js | 2 +- lib/routes/medium/following.js | 2 +- lib/routes/medium/for-you.js | 2 +- lib/routes/medium/list.js | 2 +- lib/routes/medium/router.js | 2 +- lib/routes/medium/tag.js | 2 +- lib/routes/medsci/index.js | 2 +- lib/routes/medsci/router.js | 2 +- lib/routes/metacritic/index.js | 2 +- lib/routes/metacritic/release.js | 2 +- lib/routes/metacritic/router.js | 2 +- lib/routes/meteor/boards.js | 2 +- lib/routes/meteor/index.js | 2 +- lib/routes/meteor/router.js | 2 +- lib/routes/metmuseum/exhibitions.js | 2 +- lib/routes/metmuseum/router.js | 2 +- lib/routes/mihoyo/bbs/follow-list.js | 2 +- lib/routes/mihoyo/bbs/img-ranking.js | 2 +- lib/routes/mihoyo/bbs/official.js | 2 +- lib/routes/mihoyo/bbs/timeline.js | 2 +- lib/routes/mihoyo/bbs/user-post.js | 2 +- lib/routes/mihoyo/router.js | 2 +- lib/routes/mihoyo/sr/news.js | 2 +- lib/routes/mihoyo/ys/news.js | 2 +- lib/routes/mindmeister/example.js | 2 +- lib/routes/mindmeister/router.js | 2 +- lib/routes/minecraft/router.js | 2 +- lib/routes/minecraft/version.js | 2 +- lib/routes/mingpao/index.js | 2 +- lib/routes/mingpao/router.js | 2 +- lib/routes/mirror/index.js | 2 +- lib/routes/mirror/router.js | 2 +- lib/routes/missav/new.js | 2 +- lib/routes/missav/router.js | 2 +- lib/routes/misskey/featured-notes.js | 2 +- lib/routes/misskey/router.js | 2 +- lib/routes/mittrchina/index.js | 2 +- lib/routes/mittrchina/router.js | 2 +- lib/routes/mixcloud/index.js | 2 +- lib/routes/mixcloud/router.js | 2 +- lib/routes/modb/router.js | 2 +- lib/routes/modb/topic.js | 2 +- lib/routes/modelscope/community.js | 2 +- lib/routes/modelscope/datasets.js | 2 +- lib/routes/modelscope/models.js | 2 +- lib/routes/modelscope/router.js | 2 +- lib/routes/modelscope/studios.js | 2 +- lib/routes/modrinth/router.js | 2 +- lib/routes/mohw/clarification.js | 2 +- lib/routes/mohw/router.js | 2 +- lib/routes/mox/index.js | 2 +- lib/routes/mox/router.js | 2 +- lib/routes/mpaypass/main.js | 2 +- lib/routes/mpaypass/news.js | 2 +- lib/routes/mpaypass/router.js | 2 +- lib/routes/mrdx/daily.js | 2 +- lib/routes/mrdx/router.js | 2 +- lib/routes/mrm/index.js | 2 +- lib/routes/mrm/router.js | 2 +- lib/routes/mvm/index.js | 2 +- lib/routes/mvm/router.js | 2 +- lib/routes/mydrivers/cid.js | 2 +- lib/routes/mydrivers/index.js | 2 +- lib/routes/mydrivers/rank.js | 2 +- lib/routes/mydrivers/router.js | 2 +- lib/routes/myfigurecollection/activity.js | 2 +- lib/routes/myfigurecollection/index.js | 2 +- lib/routes/myfigurecollection/router.js | 2 +- lib/routes/mygopen/index.js | 2 +- lib/routes/mygopen/router.js | 2 +- lib/routes/mymusicsheet/router.js | 2 +- lib/routes/mymusicsheet/usersheets.js | 2 +- lib/routes/mysql/release.js | 2 +- lib/routes/mysql/router.js | 2 +- lib/routes/nasa/apod-cn.js | 2 +- lib/routes/nasa/apod-ncku.js | 2 +- lib/routes/nasa/apod.js | 2 +- lib/routes/nasa/router.js | 2 +- lib/routes/natgeo/dailyphoto.js | 2 +- lib/routes/natgeo/dailyselection.js | 2 +- lib/routes/natgeo/natgeo.js | 2 +- lib/routes/natgeo/router.js | 2 +- lib/routes/nationalgeographic/latest-stories.js | 2 +- lib/routes/nationalgeographic/router.js | 2 +- lib/routes/nature/cover.js | 2 +- lib/routes/nature/highlight.js | 2 +- lib/routes/nature/news-and-comment.js | 2 +- lib/routes/nature/news.js | 2 +- lib/routes/nature/research.js | 2 +- lib/routes/nature/router.js | 2 +- lib/routes/nature/siteindex.js | 2 +- lib/routes/nautil/router.js | 2 +- lib/routes/nautil/topics.js | 2 +- lib/routes/nbd/daily.js | 2 +- lib/routes/nbd/index.js | 2 +- lib/routes/nbd/router.js | 2 +- lib/routes/nber/index.js | 2 +- lib/routes/nber/router.js | 2 +- lib/routes/ncc-cma/cmdp.js | 2 +- lib/routes/ncc-cma/router.js | 2 +- lib/routes/ncepu/master/masterinfo.js | 2 +- lib/routes/ncepu/router.js | 2 +- lib/routes/ncu/jwc.js | 2 +- lib/routes/ncu/router.js | 2 +- lib/routes/ncwu/notice.js | 2 +- lib/routes/ncwu/router.js | 2 +- lib/routes/ndss-symposium/ndss.js | 2 +- lib/routes/ndss-symposium/router.js | 2 +- lib/routes/neatdownloadmanager/download.js | 2 +- lib/routes/neatdownloadmanager/router.js | 2 +- lib/routes/neea/index.js | 2 +- lib/routes/neea/jlpt.js | 2 +- lib/routes/neea/router.js | 2 +- lib/routes/nenu/router.js | 2 +- lib/routes/nenu/sohac.js | 2 +- lib/routes/nenu/yjsy.js | 2 +- lib/routes/netflav/index.js | 2 +- lib/routes/netflav/router.js | 2 +- lib/routes/neu/bmie.js | 2 +- lib/routes/neu/news.js | 2 +- lib/routes/neu/router.js | 2 +- lib/routes/newmuseum/exhibitions.js | 2 +- lib/routes/newmuseum/router.js | 2 +- lib/routes/newrank/douyin.js | 2 +- lib/routes/newrank/router.js | 2 +- lib/routes/newrank/wechat.js | 2 +- lib/routes/news/router.js | 2 +- lib/routes/news/xhsxw.js | 2 +- lib/routes/newsmarket/index.js | 2 +- lib/routes/newsmarket/router.js | 2 +- lib/routes/newzmz/index.js | 2 +- lib/routes/newzmz/router.js | 2 +- lib/routes/nextapple/realtime.js | 2 +- lib/routes/nextapple/router.js | 2 +- lib/routes/nga/forum.js | 2 +- lib/routes/nga/post.js | 2 +- lib/routes/nga/router.js | 2 +- lib/routes/ngocn2/index.js | 2 +- lib/routes/ngocn2/router.js | 2 +- lib/routes/nhentai/other.js | 2 +- lib/routes/nhentai/router.js | 2 +- lib/routes/nhentai/search.js | 2 +- lib/routes/nhk/news-web-easy.js | 2 +- lib/routes/nhk/news.js | 2 +- lib/routes/nhk/router.js | 2 +- lib/routes/niaogebiji/cat.js | 2 +- lib/routes/niaogebiji/index.js | 2 +- lib/routes/niaogebiji/router.js | 2 +- lib/routes/niaogebiji/today.js | 2 +- lib/routes/nifd/research.js | 2 +- lib/routes/nifd/router.js | 2 +- lib/routes/nikkei/asia/index.js | 2 +- lib/routes/nikkei/cn/index.js | 2 +- lib/routes/nikkei/index.js | 2 +- lib/routes/nikkei/news.js | 2 +- lib/routes/nikkei/router.js | 2 +- lib/routes/nintendo/direct.js | 2 +- lib/routes/nintendo/eshop-cn.js | 2 +- lib/routes/nintendo/eshop-hk.js | 2 +- lib/routes/nintendo/eshop-jp.js | 2 +- lib/routes/nintendo/eshop-us.js | 2 +- lib/routes/nintendo/news-china.js | 2 +- lib/routes/nintendo/news.js | 2 +- lib/routes/nintendo/router.js | 2 +- lib/routes/nintendo/system-update.js | 2 +- lib/routes/nippon/index.js | 2 +- lib/routes/nippon/router.js | 2 +- lib/routes/njglyy/router.js | 2 +- lib/routes/njglyy/ygbjypx.js | 2 +- lib/routes/njit/jwc.js | 2 +- lib/routes/njit/router.js | 2 +- lib/routes/njit/tzgg.js | 2 +- lib/routes/njnu/ceai/ceai.js | 2 +- lib/routes/njnu/jwc/jwc.js | 2 +- lib/routes/njnu/router.js | 2 +- lib/routes/nju/admission.js | 2 +- lib/routes/nju/dafls.js | 2 +- lib/routes/nju/exchangesys.js | 2 +- lib/routes/nju/gra.js | 2 +- lib/routes/nju/hosptial.js | 2 +- lib/routes/nju/hqjt.js | 2 +- lib/routes/nju/itsc.js | 2 +- lib/routes/nju/jjc.js | 2 +- lib/routes/nju/jw.js | 2 +- lib/routes/nju/rczp.js | 2 +- lib/routes/nju/router.js | 2 +- lib/routes/nju/scit.js | 2 +- lib/routes/nju/zbb.js | 2 +- lib/routes/nju/zcc.js | 2 +- lib/routes/njucm/grabs.js | 2 +- lib/routes/njucm/router.js | 2 +- lib/routes/njupt/jwc.js | 2 +- lib/routes/njupt/router.js | 2 +- lib/routes/njust/cwc.js | 2 +- lib/routes/njust/dgxg.js | 2 +- lib/routes/njust/eo.js | 2 +- lib/routes/njust/eoe.js | 2 +- lib/routes/njust/gs.js | 2 +- lib/routes/njust/jwc.js | 2 +- lib/routes/njust/router.js | 2 +- lib/routes/njxzc/home.js | 2 +- lib/routes/njxzc/lib.js | 2 +- lib/routes/njxzc/router.js | 2 +- lib/routes/nltimes/news.js | 2 +- lib/routes/nltimes/router.js | 2 +- lib/routes/nmtv/column.js | 2 +- lib/routes/nmtv/router.js | 2 +- lib/routes/nodejs/blog.js | 2 +- lib/routes/nodejs/router.js | 2 +- lib/routes/nogizaka46/blog.js | 2 +- lib/routes/nogizaka46/news.js | 2 +- lib/routes/nogizaka46/router.js | 2 +- lib/routes/notateslaapp/router.js | 2 +- lib/routes/notateslaapp/update.js | 2 +- lib/routes/notefolio/router.js | 2 +- lib/routes/notefolio/search.js | 2 +- lib/routes/notion/database.js | 2 +- lib/routes/notion/router.js | 2 +- lib/routes/now/news.js | 2 +- lib/routes/now/router.js | 2 +- lib/routes/nowcoder/discuss.js | 2 +- lib/routes/nowcoder/experience.js | 2 +- lib/routes/nowcoder/jobcenter.js | 2 +- lib/routes/nowcoder/recommend.js | 2 +- lib/routes/nowcoder/router.js | 2 +- lib/routes/nowcoder/schedule.js | 2 +- lib/routes/npm/package.js | 2 +- lib/routes/npm/router.js | 2 +- lib/routes/npr/full.js | 2 +- lib/routes/npr/router.js | 2 +- lib/routes/ntdtv/channel.js | 2 +- lib/routes/ntdtv/router.js | 2 +- lib/routes/nua/dc.js | 2 +- lib/routes/nua/gra.js | 2 +- lib/routes/nua/index.js | 2 +- lib/routes/nua/lib.js | 2 +- lib/routes/nua/router.js | 2 +- lib/routes/nua/sxw.js | 2 +- lib/routes/nuaa/college/cae.js | 2 +- lib/routes/nuaa/college/cs.js | 2 +- lib/routes/nuaa/jwc/jwc.js | 2 +- lib/routes/nuaa/router.js | 2 +- lib/routes/nuaa/yjsy/yjsy.js | 2 +- lib/routes/nuist/bulletin.js | 2 +- lib/routes/nuist/cas.js | 2 +- lib/routes/nuist/jwc.js | 2 +- lib/routes/nuist/library/lib.js | 2 +- lib/routes/nuist/router.js | 2 +- lib/routes/nuist/scs.js | 2 +- lib/routes/nuist/sese.js | 2 +- lib/routes/nuist/xgc.js | 2 +- lib/routes/nuist/yjs.js | 2 +- lib/routes/nwafu/all.js | 2 +- lib/routes/nwafu/router.js | 2 +- lib/routes/nyaa/main.js | 2 +- lib/routes/nyaa/router.js | 2 +- lib/routes/nytimes/book.js | 2 +- lib/routes/nytimes/daily-briefing-chinese.js | 2 +- lib/routes/nytimes/index.js | 2 +- lib/routes/nytimes/router.js | 2 +- lib/routes/oceanengine/arithmetic-index.js | 2 +- lib/routes/oceanengine/router.js | 2 +- lib/routes/odaily/activity.js | 2 +- lib/routes/odaily/newsflash.js | 2 +- lib/routes/odaily/post.js | 2 +- lib/routes/odaily/router.js | 2 +- lib/routes/odaily/search-news.js | 2 +- lib/routes/odaily/user.js | 2 +- lib/routes/oeeee/app/channel.js | 2 +- lib/routes/oeeee/app/reporter.js | 2 +- lib/routes/oeeee/router.js | 2 +- lib/routes/oeeee/web.js | 2 +- lib/routes/oilchem/index.js | 2 +- lib/routes/oilchem/router.js | 2 +- lib/routes/oncc/index.js | 2 +- lib/routes/oncc/money18.js | 2 +- lib/routes/oncc/router.js | 2 +- lib/routes/onehu/common.js | 2 +- lib/routes/onehu/router.js | 2 +- lib/routes/onet/news.js | 2 +- lib/routes/onet/router.js | 2 +- lib/routes/oo-software/changelog.js | 2 +- lib/routes/oo-software/router.js | 2 +- lib/routes/openai/blog.js | 2 +- lib/routes/openai/chatgpt.js | 2 +- lib/routes/openai/research.js | 2 +- lib/routes/openai/router.js | 2 +- lib/routes/openwrt/releases.js | 2 +- lib/routes/openwrt/router.js | 2 +- lib/routes/orcid/index.js | 2 +- lib/routes/orcid/router.js | 2 +- lib/routes/oreno3d/main.js | 2 +- lib/routes/oreno3d/router.js | 2 +- lib/routes/oschina/news.js | 2 +- lib/routes/oschina/router.js | 2 +- lib/routes/oschina/topic.js | 2 +- lib/routes/oschina/user.js | 2 +- lib/routes/oshwhub/explore.js | 2 +- lib/routes/oshwhub/router.js | 2 +- lib/routes/osu/beatmaps/packs.js | 2 +- lib/routes/osu/router.js | 2 +- lib/routes/otobanana/cast.js | 2 +- lib/routes/otobanana/livestream.js | 2 +- lib/routes/otobanana/router.js | 2 +- lib/routes/otobanana/timeline.js | 2 +- lib/routes/ouc/it-postgraduate.js | 2 +- lib/routes/ouc/it-tx.js | 2 +- lib/routes/ouc/it.js | 2 +- lib/routes/ouc/jwc.js | 2 +- lib/routes/ouc/jwgl.js | 2 +- lib/routes/ouc/router.js | 2 +- lib/routes/ouc/yjs.js | 2 +- lib/routes/oup/index.js | 2 +- lib/routes/oup/router.js | 2 +- lib/routes/outagereport/index.js | 2 +- lib/routes/outagereport/router.js | 2 +- lib/routes/panewslab/author.js | 2 +- lib/routes/panewslab/index.js | 2 +- lib/routes/panewslab/news.js | 2 +- lib/routes/panewslab/router.js | 2 +- lib/routes/panewslab/topic.js | 2 +- lib/routes/papers/index.js | 2 +- lib/routes/papers/router.js | 2 +- lib/routes/paradigm/router.js | 2 +- lib/routes/paradigm/writing.js | 2 +- lib/routes/parliament/router.js | 2 +- lib/routes/parliament/section77.js | 2 +- lib/routes/patagonia/new-arrivals.js | 2 +- lib/routes/patagonia/router.js | 2 +- lib/routes/paulgraham/article.js | 2 +- lib/routes/paulgraham/router.js | 2 +- lib/routes/penguin-random-house/articles.js | 2 +- lib/routes/penguin-random-house/router.js | 2 +- lib/routes/penguin-random-house/thereaddown.js | 2 +- lib/routes/people/index.js | 2 +- lib/routes/people/liuyan.js | 2 +- lib/routes/people/router.js | 2 +- lib/routes/people/xjpjh.js | 2 +- lib/routes/peopo/router.js | 2 +- lib/routes/peopo/topic.js | 2 +- lib/routes/phoronix/index.js | 2 +- lib/routes/phoronix/router.js | 2 +- lib/routes/pianyuan/app.js | 2 +- lib/routes/pianyuan/router.js | 2 +- lib/routes/pianyuan/search.js | 2 +- lib/routes/picnob/router.js | 2 +- lib/routes/picnob/user.js | 2 +- lib/routes/picuki/profile.js | 2 +- lib/routes/picuki/router.js | 2 +- lib/routes/pikabu/community.js | 2 +- lib/routes/pikabu/router.js | 2 +- lib/routes/pikabu/user.js | 2 +- lib/routes/pincong/hot.js | 2 +- lib/routes/pincong/index.js | 2 +- lib/routes/pincong/router.js | 2 +- lib/routes/pincong/topic.js | 2 +- lib/routes/pingwest/router.js | 2 +- lib/routes/pingwest/status.js | 2 +- lib/routes/pingwest/tag.js | 2 +- lib/routes/pingwest/user.js | 2 +- lib/routes/pixabay/router.js | 2 +- lib/routes/pixabay/search.js | 2 +- lib/routes/pixiv/bookmarks.js | 2 +- lib/routes/pixiv/illustfollow.js | 2 +- lib/routes/pixiv/novels.js | 2 +- lib/routes/pixiv/ranking.js | 2 +- lib/routes/pixiv/router.js | 2 +- lib/routes/pixiv/search.js | 2 +- lib/routes/pixiv/user.js | 2 +- lib/routes/piyao/jrpy.js | 2 +- lib/routes/piyao/router.js | 2 +- lib/routes/pkmer/recent.js | 2 +- lib/routes/pkmer/router.js | 2 +- lib/routes/pku/bbs/hot.js | 2 +- lib/routes/pku/cls/announcement.js | 2 +- lib/routes/pku/cls/lecture.js | 2 +- lib/routes/pku/eecs.js | 2 +- lib/routes/pku/hr.js | 2 +- lib/routes/pku/nsd.js | 2 +- lib/routes/pku/pkuyjs.js | 2 +- lib/routes/pku/rccp/mzyt.js | 2 +- lib/routes/pku/router.js | 2 +- lib/routes/pku/scc/recruit.js | 2 +- lib/routes/pku/ss/admission.js | 2 +- lib/routes/pku/ss/notice.js | 2 +- lib/routes/pku/ss/pg-admin.js | 2 +- lib/routes/playno1/av.js | 2 +- lib/routes/playno1/router.js | 2 +- lib/routes/playno1/st.js | 2 +- lib/routes/playpcesor/router.js | 2 +- lib/routes/playpcesor/rss.js | 2 +- lib/routes/plurk/anonymous.js | 2 +- lib/routes/plurk/hotlinks.js | 2 +- lib/routes/plurk/news.js | 2 +- lib/routes/plurk/router.js | 2 +- lib/routes/plurk/search.js | 2 +- lib/routes/plurk/top.js | 2 +- lib/routes/plurk/topic.js | 2 +- lib/routes/plurk/user.js | 2 +- lib/routes/pnas/index.js | 2 +- lib/routes/pnas/router.js | 2 +- lib/routes/pornhub/category-url.js | 2 +- lib/routes/pornhub/category.js | 2 +- lib/routes/pornhub/model.js | 2 +- lib/routes/pornhub/pornstar.js | 2 +- lib/routes/pornhub/router.js | 2 +- lib/routes/pornhub/search.js | 2 +- lib/routes/pornhub/users.js | 2 +- lib/routes/postman/release-notes.js | 2 +- lib/routes/postman/router.js | 2 +- lib/routes/priconne-redive/news.js | 2 +- lib/routes/priconne-redive/router.js | 2 +- lib/routes/producthunt/router.js | 2 +- lib/routes/producthunt/today.js | 2 +- lib/routes/ps/monthly-games.js | 2 +- lib/routes/ps/router.js | 2 +- lib/routes/ps/trophy.js | 2 +- lib/routes/pts/curations.js | 2 +- lib/routes/pts/index.js | 2 +- lib/routes/pts/live.js | 2 +- lib/routes/pts/projects.js | 2 +- lib/routes/pts/router.js | 2 +- lib/routes/pubmed/router.js | 2 +- lib/routes/pubmed/trending.js | 2 +- lib/routes/pumc/mdadmission.js | 2 +- lib/routes/pumc/router.js | 2 +- lib/routes/putty/changes.js | 2 +- lib/routes/putty/router.js | 2 +- lib/routes/pwc/router.js | 2 +- lib/routes/pwc/sustainability.js | 2 +- lib/routes/qbitai/category.js | 2 +- lib/routes/qbitai/router.js | 2 +- lib/routes/qbitai/tag.js | 2 +- lib/routes/qbittorrent/news.js | 2 +- lib/routes/qbittorrent/router.js | 2 +- lib/routes/qdu/houqin.js | 2 +- lib/routes/qdu/jwc.js | 2 +- lib/routes/qdu/router.js | 2 +- lib/routes/qianp/news.js | 2 +- lib/routes/qianp/router.js | 2 +- lib/routes/qianzhan/column.js | 2 +- lib/routes/qianzhan/rank.js | 2 +- lib/routes/qianzhan/router.js | 2 +- lib/routes/qidian/author.js | 2 +- lib/routes/qidian/chapter.js | 2 +- lib/routes/qidian/forum.js | 2 +- lib/routes/qidian/free-next.js | 2 +- lib/routes/qidian/free.js | 2 +- lib/routes/qidian/router.js | 2 +- lib/routes/qingting/channel.js | 2 +- lib/routes/qingting/podcast.js | 2 +- lib/routes/qingting/router.js | 2 +- lib/routes/qipamaijia/index.js | 2 +- lib/routes/qipamaijia/router.js | 2 +- lib/routes/qiyoujiage/price.js | 2 +- lib/routes/qiyoujiage/router.js | 2 +- lib/routes/qlu/notice.js | 2 +- lib/routes/qlu/router.js | 2 +- lib/routes/qm120/news.js | 2 +- lib/routes/qm120/router.js | 2 +- lib/routes/qoo-app/apps/card.js | 2 +- lib/routes/qoo-app/apps/comment.js | 2 +- lib/routes/qoo-app/apps/note.js | 2 +- lib/routes/qoo-app/apps/post.js | 2 +- lib/routes/qoo-app/news.js | 2 +- lib/routes/qoo-app/notes/note.js | 2 +- lib/routes/qoo-app/notes/topic.js | 2 +- lib/routes/qoo-app/notes/user.js | 2 +- lib/routes/qoo-app/router.js | 2 +- lib/routes/qoo-app/user/app-comment.js | 2 +- lib/routes/qq/ac/comic.js | 2 +- lib/routes/qq/ac/rank.js | 2 +- lib/routes/qq/fact/index.js | 2 +- lib/routes/qq/kg/reply.js | 2 +- lib/routes/qq/kg/user.js | 2 +- lib/routes/qq/router.js | 2 +- lib/routes/qq88/index.js | 2 +- lib/routes/qq88/router.js | 2 +- lib/routes/qqorw/index.js | 2 +- lib/routes/qqorw/router.js | 2 +- lib/routes/questmobile/report.js | 2 +- lib/routes/questmobile/router.js | 2 +- lib/routes/quicker/qa.js | 2 +- lib/routes/quicker/router.js | 2 +- lib/routes/quicker/share.js | 2 +- lib/routes/quicker/user.js | 2 +- lib/routes/quicker/versions.js | 2 +- lib/routes/qweather/3days.js | 2 +- lib/routes/qweather/now.js | 2 +- lib/routes/qweather/router.js | 2 +- lib/routes/radio-canada/latest.js | 2 +- lib/routes/radio-canada/router.js | 2 +- lib/routes/radio/album.js | 2 +- lib/routes/radio/index.js | 2 +- lib/routes/radio/router.js | 2 +- lib/routes/radio/zhibo.js | 2 +- lib/routes/rarehistoricalphotos/index.js | 2 +- lib/routes/rarehistoricalphotos/router.js | 2 +- lib/routes/rattibha/router.js | 2 +- lib/routes/rattibha/user.js | 2 +- lib/routes/rawkuma/manga.js | 2 +- lib/routes/rawkuma/router.js | 2 +- lib/routes/reactnewsletter/reactnewsletter.js | 2 +- lib/routes/reactnewsletter/router.js | 2 +- lib/routes/readhub/daily.js | 2 +- lib/routes/readhub/index.js | 2 +- lib/routes/readhub/router.js | 2 +- lib/routes/remnote/changelog.js | 2 +- lib/routes/remnote/router.js | 2 +- lib/routes/researchgate/publications.js | 2 +- lib/routes/researchgate/router.js | 2 +- lib/routes/reuters/common.js | 2 +- lib/routes/reuters/investigates.js | 2 +- lib/routes/reuters/router.js | 2 +- lib/routes/rfa/index.js | 2 +- lib/routes/rfa/router.js | 2 +- lib/routes/rfi/news.js | 2 +- lib/routes/rfi/router.js | 2 +- lib/routes/right/forum.js | 2 +- lib/routes/right/router.js | 2 +- lib/routes/rodong/news.js | 2 +- lib/routes/rodong/router.js | 2 +- lib/routes/routledge/book-series.js | 2 +- lib/routes/routledge/router.js | 2 +- lib/routes/rsc/journal.js | 2 +- lib/routes/rsc/router.js | 2 +- lib/routes/rsshub/media.js | 2 +- lib/routes/rsshub/router.js | 2 +- lib/routes/rsshub/routes.js | 2 +- lib/routes/rsshub/transform/html.js | 2 +- lib/routes/rsshub/transform/json.js | 2 +- lib/routes/rsshub/transform/sitemap.js | 2 +- lib/routes/ruancan/category.js | 2 +- lib/routes/ruancan/index.js | 2 +- lib/routes/ruancan/router.js | 2 +- lib/routes/ruancan/search.js | 2 +- lib/routes/ruancan/user.js | 2 +- lib/routes/ruc/hr.js | 2 +- lib/routes/ruc/router.js | 2 +- lib/routes/runtrail/posts.js | 2 +- lib/routes/runtrail/router.js | 2 +- lib/routes/rustcc/jobs.js | 2 +- lib/routes/rustcc/router.js | 2 +- lib/routes/sakurazaka46/blog.js | 2 +- lib/routes/sakurazaka46/news.js | 2 +- lib/routes/sakurazaka46/router.js | 2 +- lib/routes/samsung/research/blog.js | 2 +- lib/routes/samsung/router.js | 2 +- lib/routes/saraba1st/digest.js | 2 +- lib/routes/saraba1st/router.js | 2 +- lib/routes/saraba1st/thread.js | 2 +- lib/routes/sass/gs/index.js | 2 +- lib/routes/sass/router.js | 2 +- lib/routes/scau/router.js | 2 +- lib/routes/scau/yjs.js | 2 +- lib/routes/scau/yjsy.js | 2 +- lib/routes/science/blogs.js | 2 +- lib/routes/science/cover.js | 2 +- lib/routes/science/current.js | 2 +- lib/routes/science/early.js | 2 +- lib/routes/science/router.js | 2 +- lib/routes/sciencedirect/journal.js | 2 +- lib/routes/sciencedirect/router.js | 2 +- lib/routes/sciencenet/blog.js | 2 +- lib/routes/sciencenet/router.js | 2 +- lib/routes/sciencenet/user.js | 2 +- lib/routes/scmp/coronavirus.js | 2 +- lib/routes/scmp/index.js | 2 +- lib/routes/scmp/router.js | 2 +- lib/routes/scmp/topic.js | 2 +- lib/routes/scnu/cs/match.js | 2 +- lib/routes/scnu/jw.js | 2 +- lib/routes/scnu/library.js | 2 +- lib/routes/scnu/router.js | 2 +- lib/routes/scnu/ss.js | 2 +- lib/routes/scnu/yjs.js | 2 +- lib/routes/sctv/programme.js | 2 +- lib/routes/sctv/router.js | 2 +- lib/routes/scut/jwc/news.js | 2 +- lib/routes/scut/jwc/notice.js | 2 +- lib/routes/scut/jwc/school.js | 2 +- lib/routes/scut/router.js | 2 +- lib/routes/scut/scet/notice.js | 2 +- lib/routes/scut/seie/news-ccenter.js | 2 +- lib/routes/scut/smae/notice.js | 2 +- lib/routes/scut/yjs.js | 2 +- lib/routes/scvtc/router.js | 2 +- lib/routes/scvtc/xygg.js | 2 +- lib/routes/sdu/cmse.js | 2 +- lib/routes/sdu/cs.js | 2 +- lib/routes/sdu/epe.js | 2 +- lib/routes/sdu/mech.js | 2 +- lib/routes/sdu/router.js | 2 +- lib/routes/sdu/sc.js | 2 +- lib/routes/sdu/wh/jwc.js | 2 +- lib/routes/sdu/wh/news.js | 2 +- lib/routes/sdust/router.js | 2 +- lib/routes/sdust/yjsy/zhaosheng.js | 2 +- lib/routes/sdzk/index.js | 2 +- lib/routes/sdzk/router.js | 2 +- lib/routes/sec-in/index.js | 2 +- lib/routes/sec-in/router.js | 2 +- lib/routes/sec-wiki/router.js | 2 +- lib/routes/sec-wiki/weekly.js | 2 +- lib/routes/secrss/author.js | 2 +- lib/routes/secrss/category.js | 2 +- lib/routes/secrss/router.js | 2 +- lib/routes/seekingalpha/index.js | 2 +- lib/routes/seekingalpha/router.js | 2 +- lib/routes/segmentfault/blogs.js | 2 +- lib/routes/segmentfault/channel.js | 2 +- lib/routes/segmentfault/router.js | 2 +- lib/routes/segmentfault/user.js | 2 +- lib/routes/sehuatang/index.js | 2 +- lib/routes/sehuatang/router.js | 2 +- lib/routes/sehuatang/user.js | 2 +- lib/routes/sensortower/blog.js | 2 +- lib/routes/sensortower/router.js | 2 +- lib/routes/setn/index.js | 2 +- lib/routes/setn/router.js | 2 +- lib/routes/seu/cse/index.js | 2 +- lib/routes/seu/radio/academic.js | 2 +- lib/routes/seu/router.js | 2 +- lib/routes/seu/yjs.js | 2 +- lib/routes/seu/yzb/index.js | 2 +- lib/routes/sfacg/novel-chapter.js | 2 +- lib/routes/sfacg/router.js | 2 +- lib/routes/shcstheatre/programs.js | 2 +- lib/routes/shcstheatre/router.js | 2 +- lib/routes/shiep/index.js | 2 +- lib/routes/shiep/router.js | 2 +- lib/routes/shisu/news.js | 2 +- lib/routes/shisu/router.js | 2 +- lib/routes/shmeea/index.js | 2 +- lib/routes/shmeea/router.js | 2 +- lib/routes/shmeea/self-study.js | 2 +- lib/routes/shmtu/jwc.js | 2 +- lib/routes/shmtu/portal.js | 2 +- lib/routes/shmtu/router.js | 2 +- lib/routes/shmtu/www.js | 2 +- lib/routes/shoac/recent-show.js | 2 +- lib/routes/shoac/router.js | 2 +- lib/routes/shopback/router.js | 2 +- lib/routes/shopback/store.js | 2 +- lib/routes/shoppingdesign/posts.js | 2 +- lib/routes/shoppingdesign/router.js | 2 +- lib/routes/showstart/artist.js | 2 +- lib/routes/showstart/brand.js | 2 +- lib/routes/showstart/event.js | 2 +- lib/routes/showstart/router.js | 2 +- lib/routes/showstart/search.js | 2 +- lib/routes/shu/index.js | 2 +- lib/routes/shu/jwb.js | 2 +- lib/routes/shu/router.js | 2 +- lib/routes/shuiguopai/index.js | 2 +- lib/routes/shuiguopai/router.js | 2 +- lib/routes/sicau/dky.js | 2 +- lib/routes/sicau/router.js | 2 +- lib/routes/sicau/yan.js | 2 +- lib/routes/sicau/zsjy.js | 2 +- lib/routes/sigsac/ccs.js | 2 +- lib/routes/sigsac/router.js | 2 +- lib/routes/simpleinfo/index.js | 2 +- lib/routes/simpleinfo/router.js | 2 +- lib/routes/sina/chuangshiji.js | 2 +- lib/routes/sina/discovery.js | 2 +- lib/routes/sina/finance/china.js | 2 +- lib/routes/sina/finance/stock/usstock.js | 2 +- lib/routes/sina/rollnews.js | 2 +- lib/routes/sina/router.js | 2 +- lib/routes/sina/sports.js | 2 +- lib/routes/sinchew/index.js | 2 +- lib/routes/sinchew/router.js | 2 +- lib/routes/sis001/forum.js | 2 +- lib/routes/sis001/router.js | 2 +- lib/routes/sjtu/gs.js | 2 +- lib/routes/sjtu/jwc.js | 2 +- lib/routes/sjtu/router.js | 2 +- lib/routes/sjtu/tongqu/activity.js | 2 +- lib/routes/sjtu/yzb/zkxx.js | 2 +- lib/routes/skysports/news.js | 2 +- lib/routes/skysports/router.js | 2 +- lib/routes/slowmist/router.js | 2 +- lib/routes/slowmist/slowmist.js | 2 +- lib/routes/smashingmagazine/category.js | 2 +- lib/routes/smashingmagazine/router.js | 2 +- lib/routes/smzdm/article.js | 2 +- lib/routes/smzdm/baoliao.js | 2 +- lib/routes/smzdm/haowen-fenlei.js | 2 +- lib/routes/smzdm/haowen.js | 2 +- lib/routes/smzdm/keyword.js | 2 +- lib/routes/smzdm/ranking.js | 2 +- lib/routes/smzdm/router.js | 2 +- lib/routes/snowpeak/router.js | 2 +- lib/routes/snowpeak/us-new-arrivals.js | 2 +- lib/routes/sobooks/date.js | 2 +- lib/routes/sobooks/index.js | 2 +- lib/routes/sobooks/router.js | 2 +- lib/routes/sobooks/tag.js | 2 +- lib/routes/sogou/doodles.js | 2 +- lib/routes/sogou/router.js | 2 +- lib/routes/sogou/search.js | 2 +- lib/routes/sohu/mp.js | 2 +- lib/routes/sohu/router.js | 2 +- lib/routes/solidot/main.js | 2 +- lib/routes/solidot/router.js | 2 +- lib/routes/sony/downloads.js | 2 +- lib/routes/sony/router.js | 2 +- lib/routes/soundofhope/channel.js | 2 +- lib/routes/soundofhope/router.js | 2 +- lib/routes/sourceforge/index.js | 2 +- lib/routes/sourceforge/router.js | 2 +- lib/routes/southcn/nfapp/column.js | 2 +- lib/routes/southcn/nfapp/reporter.js | 2 +- lib/routes/southcn/router.js | 2 +- lib/routes/spotify/artist.js | 2 +- lib/routes/spotify/artists-top.js | 2 +- lib/routes/spotify/playlist.js | 2 +- lib/routes/spotify/router.js | 2 +- lib/routes/spotify/saved.js | 2 +- lib/routes/spotify/show.js | 2 +- lib/routes/spotify/tracks-top.js | 2 +- lib/routes/springer/journal.js | 2 +- lib/routes/springer/router.js | 2 +- lib/routes/sputniknews/index.js | 2 +- lib/routes/sputniknews/router.js | 2 +- lib/routes/sqmc/router.js | 2 +- lib/routes/sqmc/www.js | 2 +- lib/routes/sse/convert.js | 2 +- lib/routes/sse/disclosure.js | 2 +- lib/routes/sse/inquire.js | 2 +- lib/routes/sse/lawandrules.js | 2 +- lib/routes/sse/renewal.js | 2 +- lib/routes/sse/router.js | 2 +- lib/routes/ssm/news.js | 2 +- lib/routes/ssm/router.js | 2 +- lib/routes/sspai/activity.js | 2 +- lib/routes/sspai/author.js | 2 +- lib/routes/sspai/bookmarks.js | 2 +- lib/routes/sspai/column.js | 2 +- lib/routes/sspai/index.js | 2 +- lib/routes/sspai/matrix.js | 2 +- lib/routes/sspai/router.js | 2 +- lib/routes/sspai/series-update.js | 2 +- lib/routes/sspai/series.js | 2 +- lib/routes/sspai/shortcuts-gallery.js | 2 +- lib/routes/sspai/tag.js | 2 +- lib/routes/sspai/topic.js | 2 +- lib/routes/sspai/topics.js | 2 +- lib/routes/sspu/jwc.js | 2 +- lib/routes/sspu/pe.js | 2 +- lib/routes/sspu/router.js | 2 +- lib/routes/startuplatte/index.js | 2 +- lib/routes/startuplatte/router.js | 2 +- lib/routes/stbu/jsjxy.js | 2 +- lib/routes/stbu/router.js | 2 +- lib/routes/stbu/xyxw.js | 2 +- lib/routes/stcn/index.js | 2 +- lib/routes/stcn/router.js | 2 +- lib/routes/stdaily/digitalpaper.js | 2 +- lib/routes/stdaily/router.js | 2 +- lib/routes/stheadline/router.js | 2 +- lib/routes/stheadline/std/realtime.js | 2 +- lib/routes/stockedge/daily-news.js | 2 +- lib/routes/stockedge/router.js | 2 +- lib/routes/storm/index.js | 2 +- lib/routes/storm/router.js | 2 +- lib/routes/storyfm/episodes.js | 2 +- lib/routes/storyfm/index.js | 2 +- lib/routes/storyfm/router.js | 2 +- lib/routes/stratechery/index.js | 2 +- lib/routes/stratechery/router.js | 2 +- lib/routes/studygolang/go.js | 2 +- lib/routes/studygolang/jobs.js | 2 +- lib/routes/studygolang/router.js | 2 +- lib/routes/studygolang/weekly.js | 2 +- lib/routes/subhd/index.js | 2 +- lib/routes/subhd/router.js | 2 +- lib/routes/supchina/index.js | 2 +- lib/routes/supchina/podcasts.js | 2 +- lib/routes/supchina/router.js | 2 +- lib/routes/surfshark/blog.js | 2 +- lib/routes/surfshark/router.js | 2 +- lib/routes/sustech/bidding.js | 2 +- lib/routes/sustech/newshub-zh.js | 2 +- lib/routes/sustech/router.js | 2 +- lib/routes/sustech/yjs.js | 2 +- lib/routes/swissinfo/index.js | 2 +- lib/routes/swissinfo/router.js | 2 +- lib/routes/swjtu/jtys/yjs.js | 2 +- lib/routes/swjtu/jwc.js | 2 +- lib/routes/swjtu/jyzpxx.js | 2 +- lib/routes/swjtu/router.js | 2 +- lib/routes/swjtu/xg.js | 2 +- lib/routes/swpu/bgw.js | 2 +- lib/routes/swpu/cjxy.js | 2 +- lib/routes/swpu/dean.js | 2 +- lib/routes/swpu/dxy.js | 2 +- lib/routes/swpu/is.js | 2 +- lib/routes/swpu/router.js | 2 +- lib/routes/swpu/scs.js | 2 +- lib/routes/syosetu/chapter.js | 2 +- lib/routes/syosetu/router.js | 2 +- lib/routes/sysu/cse.js | 2 +- lib/routes/sysu/router.js | 2 +- lib/routes/sysu/ygafz.js | 2 +- lib/routes/szse/inquire.js | 2 +- lib/routes/szse/notice.js | 2 +- lib/routes/szse/projectdynamic.js | 2 +- lib/routes/szse/router.js | 2 +- lib/routes/szse/rule.js | 2 +- lib/routes/szu/router.js | 2 +- lib/routes/szu/yz/index.js | 2 +- lib/routes/tableau/router.js | 2 +- lib/routes/tableau/viz-of-the-day.js | 2 +- lib/routes/taiwannews/hot.js | 2 +- lib/routes/taiwannews/router.js | 2 +- lib/routes/tangshufang/index.js | 2 +- lib/routes/tangshufang/router.js | 2 +- lib/routes/taobao/router.js | 2 +- lib/routes/taobao/zhongchou.js | 2 +- lib/routes/taoguba/blog.js | 2 +- lib/routes/taoguba/index.js | 2 +- lib/routes/taoguba/router.js | 2 +- lib/routes/taptap/changelog.js | 2 +- lib/routes/taptap/review.js | 2 +- lib/routes/taptap/router.js | 2 +- lib/routes/taptap/topic.js | 2 +- lib/routes/tass/news.js | 2 +- lib/routes/tass/router.js | 2 +- lib/routes/techcrunch/news.js | 2 +- lib/routes/techcrunch/router.js | 2 +- lib/routes/techflowpost/express.js | 2 +- lib/routes/techflowpost/index.js | 2 +- lib/routes/techflowpost/router.js | 2 +- lib/routes/techpowerup/index.js | 2 +- lib/routes/techpowerup/review.js | 2 +- lib/routes/techpowerup/router.js | 2 +- lib/routes/telecompaper/news.js | 2 +- lib/routes/telecompaper/router.js | 2 +- lib/routes/telecompaper/search.js | 2 +- lib/routes/telegram/blog.js | 2 +- lib/routes/telegram/channel.js | 2 +- lib/routes/telegram/router.js | 2 +- lib/routes/telegram/stickerpack.js | 2 +- lib/routes/telegram/tglib/channel.js | 2 +- lib/routes/tencent/news/author.js | 2 +- lib/routes/tencent/news/coronavirus/data.js | 2 +- lib/routes/tencent/news/coronavirus/total.js | 2 +- lib/routes/tencent/pvp/newsindex.js | 2 +- lib/routes/tencent/qq/sdk/changelog.js | 2 +- lib/routes/tencent/router.js | 2 +- lib/routes/tesla/cx.js | 2 +- lib/routes/tesla/price/index.js | 2 +- lib/routes/tesla/router.js | 2 +- lib/routes/test/index.js | 2 +- lib/routes/test/router.js | 2 +- lib/routes/tfc-taiwan/index.js | 2 +- lib/routes/tfc-taiwan/router.js | 2 +- lib/routes/theatlantic/news.js | 2 +- lib/routes/theatlantic/router.js | 2 +- lib/routes/theblockbeats/index.js | 2 +- lib/routes/theblockbeats/router.js | 2 +- lib/routes/thecatcity/index.js | 2 +- lib/routes/thecatcity/router.js | 2 +- lib/routes/thecover/channel.js | 2 +- lib/routes/thecover/router.js | 2 +- lib/routes/thehindu/router.js | 2 +- lib/routes/thehindu/topic.js | 2 +- lib/routes/theinitium/full.js | 2 +- lib/routes/theinitium/router.js | 2 +- lib/routes/themoviedb/collection.js | 2 +- lib/routes/themoviedb/episodes.js | 2 +- lib/routes/themoviedb/router.js | 2 +- lib/routes/themoviedb/seasons.js | 2 +- lib/routes/themoviedb/sheet.js | 2 +- lib/routes/themoviedb/trending.js | 2 +- lib/routes/thenewslens/index.js | 2 +- lib/routes/thenewslens/router.js | 2 +- lib/routes/thepaper/839studio/category.js | 2 +- lib/routes/thepaper/839studio/studio.js | 2 +- lib/routes/thepaper/channel.js | 2 +- lib/routes/thepaper/factpaper.js | 2 +- lib/routes/thepaper/featured.js | 2 +- lib/routes/thepaper/list.js | 2 +- lib/routes/thepaper/router.js | 2 +- lib/routes/thepaper/sidebar.js | 2 +- lib/routes/theverge/index.js | 2 +- lib/routes/theverge/router.js | 2 +- lib/routes/thoughtco/index.js | 2 +- lib/routes/thoughtco/router.js | 2 +- lib/routes/threads/index.js | 2 +- lib/routes/threads/router.js | 2 +- lib/routes/thwiki/index.js | 2 +- lib/routes/thwiki/router.js | 2 +- lib/routes/tiktok/router.js | 2 +- lib/routes/tiktok/user.js | 2 +- lib/routes/timednews/news.js | 2 +- lib/routes/timednews/router.js | 2 +- lib/routes/tingshuitz/changsha.js | 2 +- lib/routes/tingshuitz/dalian.js | 2 +- lib/routes/tingshuitz/dongguan.js | 2 +- lib/routes/tingshuitz/guangzhou.js | 2 +- lib/routes/tingshuitz/hangzhou.js | 2 +- lib/routes/tingshuitz/nanjing.js | 2 +- lib/routes/tingshuitz/router.js | 2 +- lib/routes/tingshuitz/shenzhen.js | 2 +- lib/routes/tingshuitz/wuhan.js | 2 +- lib/routes/tingshuitz/xian.js | 2 +- lib/routes/tingshuitz/xiaoshan.js | 2 +- lib/routes/tingshuitz/yangjiang.js | 2 +- lib/routes/tingtingfm/program.js | 2 +- lib/routes/tingtingfm/router.js | 2 +- lib/routes/tisi/index.js | 2 +- lib/routes/tisi/router.js | 2 +- lib/routes/tju/cic/index.js | 2 +- lib/routes/tju/news/index.js | 2 +- lib/routes/tju/oaa/index.js | 2 +- lib/routes/tju/router.js | 2 +- lib/routes/tju/yzb/index.js | 2 +- lib/routes/tokeninsight/blog.js | 2 +- lib/routes/tokeninsight/bulletin.js | 2 +- lib/routes/tokeninsight/report.js | 2 +- lib/routes/tokeninsight/router.js | 2 +- lib/routes/tongji/bks.js | 2 +- lib/routes/tongji/router.js | 2 +- lib/routes/tongji/sse/notice.js | 2 +- lib/routes/tongji/yjs.js | 2 +- lib/routes/toodaylab/index.js | 2 +- lib/routes/toodaylab/router.js | 2 +- lib/routes/tophub/index.js | 2 +- lib/routes/tophub/list.js | 2 +- lib/routes/tophub/router.js | 2 +- lib/routes/topys/index.js | 2 +- lib/routes/topys/router.js | 2 +- lib/routes/tradingview/blog.js | 2 +- lib/routes/tradingview/desktop.js | 2 +- lib/routes/tradingview/pine.js | 2 +- lib/routes/tradingview/router.js | 2 +- lib/routes/transcriptforest/index.js | 2 +- lib/routes/transcriptforest/router.js | 2 +- lib/routes/trending/all-trending.js | 2 +- lib/routes/trending/router.js | 2 +- lib/routes/trendingpapers/papers.js | 2 +- lib/routes/trendingpapers/router.js | 2 +- lib/routes/tribalfootball/latest.js | 2 +- lib/routes/tribalfootball/router.js | 2 +- lib/routes/trow/portal.js | 2 +- lib/routes/trow/router.js | 2 +- lib/routes/tvb/news.js | 2 +- lib/routes/tvb/router.js | 2 +- lib/routes/tvtropes/featured.js | 2 +- lib/routes/tvtropes/router.js | 2 +- lib/routes/twitch/live.js | 2 +- lib/routes/twitch/router.js | 2 +- lib/routes/twitch/schedule.js | 2 +- lib/routes/twitch/video.js | 2 +- lib/routes/twitter/collection.js | 2 +- lib/routes/twitter/developer-api/search.js | 2 +- lib/routes/twitter/developer-api/user.js | 2 +- lib/routes/twitter/followings.js | 2 +- lib/routes/twitter/likes.js | 2 +- lib/routes/twitter/list.js | 2 +- lib/routes/twitter/router.js | 2 +- lib/routes/twitter/trends.js | 2 +- lib/routes/twitter/tweet.js | 2 +- lib/routes/twitter/web-api/media.js | 2 +- lib/routes/twitter/web-api/search.js | 2 +- lib/routes/twitter/web-api/tweet.js | 2 +- lib/routes/twitter/web-api/user.js | 2 +- lib/routes/twreporter/newest.js | 2 +- lib/routes/twreporter/router.js | 2 +- lib/routes/txrjy/fornumtopic.js | 2 +- lib/routes/txrjy/router.js | 2 +- lib/routes/tynu/router.js | 2 +- lib/routes/tynu/tynu.js | 2 +- lib/routes/typora/changelog-dev.js | 2 +- lib/routes/typora/changelog.js | 2 +- lib/routes/typora/router.js | 2 +- lib/routes/u3c3/index.js | 2 +- lib/routes/u3c3/router.js | 2 +- lib/routes/u9a9/index.js | 2 +- lib/routes/u9a9/router.js | 2 +- lib/routes/uber/blog.js | 2 +- lib/routes/uber/router.js | 2 +- lib/routes/ucas/ai.js | 2 +- lib/routes/ucas/index.js | 2 +- lib/routes/ucas/router.js | 2 +- lib/routes/uchicago/current.js | 2 +- lib/routes/uchicago/router.js | 2 +- lib/routes/udn/breaking-news.js | 2 +- lib/routes/udn/global/index.js | 2 +- lib/routes/udn/global/tag.js | 2 +- lib/routes/udn/router.js | 2 +- lib/routes/uestc/auto.js | 2 +- lib/routes/uestc/cqe.js | 2 +- lib/routes/uestc/gr.js | 2 +- lib/routes/uestc/jwc.js | 2 +- lib/routes/uestc/news.js | 2 +- lib/routes/uestc/router.js | 2 +- lib/routes/uestc/scse.js | 2 +- lib/routes/uestc/sice.js | 2 +- lib/routes/uestc/sise.js | 2 +- lib/routes/uibe/hr.js | 2 +- lib/routes/uibe/router.js | 2 +- lib/routes/ulapia/index.js | 2 +- lib/routes/ulapia/research.js | 2 +- lib/routes/ulapia/router.js | 2 +- lib/routes/uniqlo/new.js | 2 +- lib/routes/uniqlo/router.js | 2 +- lib/routes/unraid/community-apps.js | 2 +- lib/routes/unraid/router.js | 2 +- lib/routes/unusualwhales/news.js | 2 +- lib/routes/unusualwhales/router.js | 2 +- lib/routes/upc/jsj.js | 2 +- lib/routes/upc/main.js | 2 +- lib/routes/upc/router.js | 2 +- lib/routes/upc/yjs.js | 2 +- lib/routes/uptimerobot/router.js | 2 +- lib/routes/uptimerobot/rss.js | 2 +- lib/routes/uraaka-joshi/router.js | 2 +- lib/routes/uraaka-joshi/uraaka-joshi-user.js | 2 +- lib/routes/uraaka-joshi/uraaka-joshi.js | 2 +- lib/routes/urbandictionary/random.js | 2 +- lib/routes/urbandictionary/router.js | 2 +- lib/routes/usenix/router.js | 2 +- lib/routes/usenix/usenix.js | 2 +- lib/routes/usepanda/index.js | 2 +- lib/routes/usepanda/router.js | 2 +- lib/routes/ustb/router.js | 2 +- lib/routes/ustb/tj/news.js | 2 +- lib/routes/ustb/yjsy/news.js | 2 +- lib/routes/ustb/yzxc/tzgg.js | 2 +- lib/routes/ustc/eeis.js | 2 +- lib/routes/ustc/gs.js | 2 +- lib/routes/ustc/index.js | 2 +- lib/routes/ustc/job.js | 2 +- lib/routes/ustc/jwc.js | 2 +- lib/routes/ustc/router.js | 2 +- lib/routes/ustc/sist.js | 2 +- lib/routes/usts/jwch.js | 2 +- lib/routes/usts/router.js | 2 +- lib/routes/utgd/category.js | 2 +- lib/routes/utgd/router.js | 2 +- lib/routes/utgd/timeline.js | 2 +- lib/routes/utgd/topic.js | 2 +- lib/routes/uw/gix/news.js | 2 +- lib/routes/uw/router.js | 2 +- lib/routes/v1tx/index.js | 2 +- lib/routes/v1tx/router.js | 2 +- lib/routes/v2ex/post.js | 2 +- lib/routes/v2ex/router.js | 2 +- lib/routes/v2ex/tab.js | 2 +- lib/routes/v2ex/topics.js | 2 +- lib/routes/v2rayshare/index.js | 2 +- lib/routes/v2rayshare/router.js | 2 +- lib/routes/vcb-s/category.js | 2 +- lib/routes/vcb-s/index.js | 2 +- lib/routes/vcb-s/router.js | 2 +- lib/routes/verfghbw/press.js | 2 +- lib/routes/verfghbw/router.js | 2 +- lib/routes/vimeo/category.js | 2 +- lib/routes/vimeo/channel.js | 2 +- lib/routes/vimeo/router.js | 2 +- lib/routes/vimeo/usr-videos.js | 2 +- lib/routes/vocus/publication.js | 2 +- lib/routes/vocus/router.js | 2 +- lib/routes/vocus/user.js | 2 +- lib/routes/vom/featured.js | 2 +- lib/routes/vom/router.js | 2 +- lib/routes/wallhaven/index.js | 2 +- lib/routes/wallhaven/router.js | 2 +- lib/routes/wallpaperhub/index.js | 2 +- lib/routes/wallpaperhub/router.js | 2 +- lib/routes/wallstreetcn/hot.js | 2 +- lib/routes/wallstreetcn/live.js | 2 +- lib/routes/wallstreetcn/news.js | 2 +- lib/routes/wallstreetcn/router.js | 2 +- lib/routes/wanqu/news.js | 2 +- lib/routes/wanqu/router.js | 2 +- lib/routes/warthunder/news.js | 2 +- lib/routes/warthunder/router.js | 2 +- lib/routes/wdc/download.js | 2 +- lib/routes/wdc/router.js | 2 +- lib/routes/web3caff/index.js | 2 +- lib/routes/web3caff/router.js | 2 +- lib/routes/wechat/announce.js | 2 +- lib/routes/wechat/ce.js | 2 +- lib/routes/wechat/data258.js | 2 +- lib/routes/wechat/ershcimi.js | 2 +- lib/routes/wechat/feeddd.js | 2 +- lib/routes/wechat/feeds.js | 2 +- lib/routes/wechat/mp.js | 2 +- lib/routes/wechat/msgalbum.js | 2 +- lib/routes/wechat/router.js | 2 +- lib/routes/wechat/sogou.js | 2 +- lib/routes/wechat/tgchannel.js | 2 +- lib/routes/wechat/uread.js | 2 +- lib/routes/wechat/wechat2rss.js | 2 +- lib/routes/wechat/wxnmh.js | 2 +- lib/routes/weekendhk/posts.js | 2 +- lib/routes/weekendhk/router.js | 2 +- lib/routes/weibo/friends.js | 2 +- lib/routes/weibo/group.js | 2 +- lib/routes/weibo/keyword.js | 2 +- lib/routes/weibo/oasis/user.js | 2 +- lib/routes/weibo/router.js | 2 +- lib/routes/weibo/search/hot.js | 2 +- lib/routes/weibo/super-index.js | 2 +- lib/routes/weibo/timeline.js | 2 +- lib/routes/weibo/user.js | 2 +- lib/routes/wenku8/chapter.js | 2 +- lib/routes/wenku8/index.js | 2 +- lib/routes/wenku8/router.js | 2 +- lib/routes/wenku8/volume.js | 2 +- lib/routes/wfdf/news.js | 2 +- lib/routes/wfdf/router.js | 2 +- lib/routes/wfu/jwc.js | 2 +- lib/routes/wfu/news.js | 2 +- lib/routes/wfu/router.js | 2 +- lib/routes/whitehouse/briefing-room.js | 2 +- lib/routes/whitehouse/ostp.js | 2 +- lib/routes/whitehouse/router.js | 2 +- lib/routes/who/news-room.js | 2 +- lib/routes/who/news.js | 2 +- lib/routes/who/router.js | 2 +- lib/routes/who/speeches.js | 2 +- lib/routes/whu/cs.js | 2 +- lib/routes/whu/gs/index.js | 2 +- lib/routes/whu/hyxt.js | 2 +- lib/routes/whu/news.js | 2 +- lib/routes/whu/router.js | 2 +- lib/routes/wikinews/index.js | 2 +- lib/routes/wikinews/router.js | 2 +- lib/routes/winstall/router.js | 2 +- lib/routes/winstall/update.js | 2 +- lib/routes/wise/pair.js | 2 +- lib/routes/wise/router.js | 2 +- lib/routes/wizfile/index.js | 2 +- lib/routes/wizfile/router.js | 2 +- lib/routes/wmc-bj/publish.js | 2 +- lib/routes/wmc-bj/router.js | 2 +- lib/routes/wmpvp/index.js | 2 +- lib/routes/wmpvp/router.js | 2 +- lib/routes/wnacg/index.js | 2 +- lib/routes/wnacg/router.js | 2 +- lib/routes/worldjournal/index.js | 2 +- lib/routes/worldjournal/router.js | 2 +- lib/routes/woshipm/popular.js | 2 +- lib/routes/woshipm/router.js | 2 +- lib/routes/woshipm/user-article.js | 2 +- lib/routes/woshipm/wen.js | 2 +- lib/routes/wsj/news.js | 2 +- lib/routes/wsj/router.js | 2 +- lib/routes/wsyu/news.js | 2 +- lib/routes/wsyu/router.js | 2 +- lib/routes/wtu/index.js | 2 +- lib/routes/wtu/job.js | 2 +- lib/routes/wtu/router.js | 2 +- lib/routes/wyzxwk/article.js | 2 +- lib/routes/wyzxwk/router.js | 2 +- lib/routes/wzu/news.js | 2 +- lib/routes/wzu/router.js | 2 +- lib/routes/x-mol/news.js | 2 +- lib/routes/x-mol/paper.js | 2 +- lib/routes/x-mol/router.js | 2 +- lib/routes/x6d/index.js | 2 +- lib/routes/x6d/router.js | 2 +- lib/routes/xaufe/jiaowu.js | 2 +- lib/routes/xaufe/router.js | 2 +- lib/routes/xaut/index.js | 2 +- lib/routes/xaut/jwc.js | 2 +- lib/routes/xaut/router.js | 2 +- lib/routes/xaut/rsc.js | 2 +- lib/routes/xboxfan/news.js | 2 +- lib/routes/xboxfan/router.js | 2 +- lib/routes/xiaohongshu/board.js | 2 +- lib/routes/xiaohongshu/notes.js | 2 +- lib/routes/xiaohongshu/router.js | 2 +- lib/routes/xiaohongshu/user.js | 2 +- lib/routes/xiaomiyoupin/crowdfunding.js | 2 +- lib/routes/xiaomiyoupin/latest.js | 2 +- lib/routes/xiaomiyoupin/router.js | 2 +- lib/routes/xiaote/index.js | 2 +- lib/routes/xiaote/router.js | 2 +- lib/routes/xiaoyuzhou/pickup.js | 2 +- lib/routes/xiaoyuzhou/podcast.js | 2 +- lib/routes/xiaoyuzhou/router.js | 2 +- lib/routes/xiaozhuanlan/column.js | 2 +- lib/routes/xiaozhuanlan/router.js | 2 +- lib/routes/xidian/jwc.js | 2 +- lib/routes/xidian/router.js | 2 +- lib/routes/ximalaya/album.js | 2 +- lib/routes/ximalaya/router.js | 2 +- lib/routes/xinpianchang/index.js | 2 +- lib/routes/xinpianchang/rank.js | 2 +- lib/routes/xinpianchang/router.js | 2 +- lib/routes/xjtu/2yuan/news.js | 2 +- lib/routes/xjtu/dean.js | 2 +- lib/routes/xjtu/dyyy/index.js | 2 +- lib/routes/xjtu/ee.js | 2 +- lib/routes/xjtu/gs/tzgg.js | 2 +- lib/routes/xjtu/international.js | 2 +- lib/routes/xjtu/job.js | 2 +- lib/routes/xjtu/router.js | 2 +- lib/routes/xjtu/std.js | 2 +- lib/routes/xkb/index.js | 2 +- lib/routes/xkb/router.js | 2 +- lib/routes/xmanhua/index.js | 2 +- lib/routes/xmanhua/router.js | 2 +- lib/routes/xmnn/epaper.js | 2 +- lib/routes/xmnn/news.js | 2 +- lib/routes/xmnn/router.js | 2 +- lib/routes/xmut/jwc/bkjw.js | 2 +- lib/routes/xmut/jwc/yjs.js | 2 +- lib/routes/xmut/router.js | 2 +- lib/routes/xsijishe/forum.js | 2 +- lib/routes/xsijishe/rank.js | 2 +- lib/routes/xsijishe/router.js | 2 +- lib/routes/xueqiu/column.js | 2 +- lib/routes/xueqiu/favorite.js | 2 +- lib/routes/xueqiu/fund.js | 2 +- lib/routes/xueqiu/hots.js | 2 +- lib/routes/xueqiu/router.js | 2 +- lib/routes/xueqiu/snb.js | 2 +- lib/routes/xueqiu/stock-comments.js | 2 +- lib/routes/xueqiu/stock-info.js | 2 +- lib/routes/xueqiu/today.js | 2 +- lib/routes/xueqiu/user-stock.js | 2 +- lib/routes/xueqiu/user.js | 2 +- lib/routes/xunhupay/index.js | 2 +- lib/routes/xunhupay/router.js | 2 +- lib/routes/xys/new.js | 2 +- lib/routes/xys/router.js | 2 +- lib/routes/xyzrank/index.js | 2 +- lib/routes/xyzrank/router.js | 2 +- lib/routes/yahoo/news/tw/index.js | 2 +- lib/routes/yahoo/news/tw/provider-helper.js | 2 +- lib/routes/yahoo/news/tw/provider.js | 2 +- lib/routes/yahoo/news/us/index.js | 2 +- lib/routes/yahoo/router.js | 2 +- lib/routes/yangtzeu/dongke.js | 2 +- lib/routes/yangtzeu/router.js | 2 +- lib/routes/ycwb/index.js | 2 +- lib/routes/ycwb/router.js | 2 +- lib/routes/yicai/author.js | 2 +- lib/routes/yicai/brief.js | 2 +- lib/routes/yicai/dt.js | 2 +- lib/routes/yicai/feed.js | 2 +- lib/routes/yicai/headline.js | 2 +- lib/routes/yicai/latest.js | 2 +- lib/routes/yicai/news.js | 2 +- lib/routes/yicai/router.js | 2 +- lib/routes/yicai/video.js | 2 +- lib/routes/yicai/vip.js | 2 +- lib/routes/ymgal/article.js | 2 +- lib/routes/ymgal/game.js | 2 +- lib/routes/ymgal/router.js | 2 +- lib/routes/yoasobi-music/info.js | 2 +- lib/routes/yoasobi-music/live.js | 2 +- lib/routes/yoasobi-music/media.js | 2 +- lib/routes/yoasobi-music/router.js | 2 +- lib/routes/yomiuri/news.js | 2 +- lib/routes/yomiuri/router.js | 2 +- lib/routes/yomujp/level.js | 2 +- lib/routes/yomujp/router.js | 2 +- lib/routes/youku/channel.js | 2 +- lib/routes/youku/router.js | 2 +- lib/routes/youtube/channel.js | 2 +- lib/routes/youtube/charts.js | 2 +- lib/routes/youtube/community.js | 2 +- lib/routes/youtube/custom.js | 2 +- lib/routes/youtube/live.js | 2 +- lib/routes/youtube/playlist.js | 2 +- lib/routes/youtube/router.js | 2 +- lib/routes/youtube/subscriptions.js | 2 +- lib/routes/youtube/user.js | 2 +- lib/routes/youzhiyouxing/materials.js | 2 +- lib/routes/youzhiyouxing/router.js | 2 +- lib/routes/yuque/book.js | 2 +- lib/routes/yuque/router.js | 2 +- lib/routes/yxdown/news.js | 2 +- lib/routes/yxdown/recommend.js | 2 +- lib/routes/yxdown/router.js | 2 +- lib/routes/yxdzqb/index.js | 2 +- lib/routes/yxdzqb/router.js | 2 +- lib/routes/yxrb/home.js | 2 +- lib/routes/yxrb/router.js | 2 +- lib/routes/yyets/article.js | 2 +- lib/routes/yyets/router.js | 2 +- lib/routes/yyets/today.js | 2 +- lib/routes/yystv/category.js | 2 +- lib/routes/yystv/docs.js | 2 +- lib/routes/yystv/router.js | 2 +- lib/routes/zagg/new-arrivals.js | 2 +- lib/routes/zagg/router.js | 2 +- lib/routes/zaker/index.js | 2 +- lib/routes/zaker/router.js | 2 +- lib/routes/zaobao/index.js | 2 +- lib/routes/zaobao/interactive.js | 2 +- lib/routes/zaobao/realtime.js | 2 +- lib/routes/zaobao/router.js | 2 +- lib/routes/zaobao/znews.js | 2 +- lib/routes/zaozao/article.js | 2 +- lib/routes/zaozao/router.js | 2 +- lib/routes/zcmu/jwc/index.js | 2 +- lib/routes/zcmu/router.js | 2 +- lib/routes/zcmu/yxy/index.js | 2 +- lib/routes/zcool/discover.js | 2 +- lib/routes/zcool/router.js | 2 +- lib/routes/zcool/top.js | 2 +- lib/routes/zcool/user.js | 2 +- lib/routes/zhangyoubao/index.js | 2 +- lib/routes/zhangyoubao/router.js | 2 +- lib/routes/zhibo8/forum.js | 2 +- lib/routes/zhibo8/luxiang.js | 2 +- lib/routes/zhibo8/more.js | 2 +- lib/routes/zhibo8/post.js | 2 +- lib/routes/zhibo8/router.js | 2 +- lib/routes/zhihu/activities.js | 2 +- lib/routes/zhihu/answers.js | 2 +- lib/routes/zhihu/bookstore/newest.js | 2 +- lib/routes/zhihu/collection.js | 2 +- lib/routes/zhihu/daily-section.js | 2 +- lib/routes/zhihu/daily.js | 2 +- lib/routes/zhihu/hot.js | 2 +- lib/routes/zhihu/hotlist.js | 2 +- lib/routes/zhihu/pin/daily.js | 2 +- lib/routes/zhihu/pin/hotlist.js | 2 +- lib/routes/zhihu/pin/people.js | 2 +- lib/routes/zhihu/posts.js | 2 +- lib/routes/zhihu/question.js | 2 +- lib/routes/zhihu/router.js | 2 +- lib/routes/zhihu/timeline.js | 2 +- lib/routes/zhihu/topic.js | 2 +- lib/routes/zhihu/weekly.js | 2 +- lib/routes/zhihu/xhu/activities.js | 2 +- lib/routes/zhihu/xhu/answers.js | 2 +- lib/routes/zhihu/xhu/collection.js | 2 +- lib/routes/zhihu/xhu/posts.js | 2 +- lib/routes/zhihu/xhu/question.js | 2 +- lib/routes/zhihu/xhu/topic.js | 2 +- lib/routes/zhihu/xhu/zhuanlan.js | 2 +- lib/routes/zhihu/zhuanlan.js | 2 +- lib/routes/zhitongcaijing/index.js | 2 +- lib/routes/zhitongcaijing/router.js | 2 +- lib/routes/zhiy/letter.js | 2 +- lib/routes/zhiy/post.js | 2 +- lib/routes/zhiy/router.js | 2 +- lib/routes/zhubai/index.js | 2 +- lib/routes/zhubai/router.js | 2 +- lib/routes/zhubai/top20.js | 2 +- lib/routes/zimuxia/index.js | 2 +- lib/routes/zimuxia/portfolio.js | 2 +- lib/routes/zimuxia/router.js | 2 +- lib/routes/zjgtjy/index.js | 2 +- lib/routes/zjgtjy/router.js | 2 +- lib/routes/zjol/paper.js | 2 +- lib/routes/zjol/router.js | 2 +- lib/routes/zju/career/index.js | 2 +- lib/routes/zju/cst/custom.js | 2 +- lib/routes/zju/cst/index.js | 2 +- lib/routes/zju/grs/index.js | 2 +- lib/routes/zju/list.js | 2 +- lib/routes/zju/physics/index.js | 2 +- lib/routes/zju/router.js | 2 +- lib/routes/zjuvag/blog.js | 2 +- lib/routes/zjuvag/router.js | 2 +- lib/routes/zodgame/forum.js | 2 +- lib/routes/zodgame/router.js | 2 +- lib/routes/zotero/router.js | 2 +- lib/routes/zotero/versions.js | 2 +- lib/routes/zrblog/router.js | 2 +- lib/routes/zrblog/rss.js | 2 +- lib/routes/zuel/notice.js | 2 +- lib/routes/zuel/router.js | 2 +- lib/routes/zuvio/boards.js | 2 +- lib/routes/zuvio/router.js | 2 +- lib/routes/zuvio/student5.js | 2 +- lib/routes/zyshow/index.js | 2 +- lib/routes/zyshow/router.js | 2 +- lib/routes/zyw/hot.js | 2 +- lib/routes/zyw/router.js | 2 +- 3035 files changed, 3040 insertions(+), 3038 deletions(-) diff --git a/lib/routes.ts b/lib/routes.ts index 314ff617b9a5a8..64564096de6a32 100644 --- a/lib/routes.ts +++ b/lib/routes.ts @@ -20,7 +20,11 @@ const routes: Record void> = {}; for (const path in imports) { const name = path.split('/').find(Boolean); if (name) { - routes[name] = imports[path] as (root: Root) => void; + routes[name] = ( + imports[path] as { + default: (root: Root) => void; + } + ).default; } } @@ -31,7 +35,7 @@ export default function (app: Hono) { get: (routePath, filePath) => { const wrapedHandler: Handler = async (ctx, ...args) => { if (!ctx.get('data')) { - const handler = require(path.join(__dirname, 'routes', name, filePath)); + const { default: handler } = await import(path.join(__dirname, 'routes', name, filePath)); await handler(ctx, ...args); } }; diff --git a/lib/routes/0818tuan/index.js b/lib/routes/0818tuan/index.js index cf37b050fd67d3..9d130df1ec7153 100644 --- a/lib/routes/0818tuan/index.js +++ b/lib/routes/0818tuan/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://www.0818tuan.com'; const listId = ctx.req.param('listId') || '1'; const url = `${baseUrl}/list-${listId}-0.html`; diff --git a/lib/routes/0818tuan/router.js b/lib/routes/0818tuan/router.js index b95ff1686e639c..ed0e3c3945fd03 100644 --- a/lib/routes/0818tuan/router.js +++ b/lib/routes/0818tuan/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:listId?', './index'); }; diff --git a/lib/routes/12306/index.js b/lib/routes/12306/index.js index 1839e7de0437e0..f00ad49846b0f9 100644 --- a/lib/routes/12306/index.js +++ b/lib/routes/12306/index.js @@ -46,7 +46,7 @@ function getStationInfo(stationName) { }); } -module.exports = async (ctx) => { +export default async (ctx) => { const date = ctx.req.param('date'); const fromStationInfo = await getStationInfo(ctx.req.param('from')); const toStationInfo = await getStationInfo(ctx.req.param('to')); diff --git a/lib/routes/12306/router.js b/lib/routes/12306/router.js index 43b70ef7d71ef2..e986b4842ed20b 100644 --- a/lib/routes/12306/router.js +++ b/lib/routes/12306/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/:date/:from/:to/:type?', './index'); router.get('/zxdt/:id?', './zxdt'); }; diff --git a/lib/routes/12306/zxdt.js b/lib/routes/12306/zxdt.js index 45b3b913a1ca43..cf27ba013dfacf 100644 --- a/lib/routes/12306/zxdt.js +++ b/lib/routes/12306/zxdt.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const url = require('url'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') || -1; const link = id === -1 ? 'https://www.12306.cn/mormhweb/zxdt/index_zxdt.html' : `https://www.12306.cn/mormhweb/1/${id}/index_fl.html`; diff --git a/lib/routes/141jav/index.js b/lib/routes/141jav/index.js index 48f2527d6e9ff8..874c04fa6ac7d3 100644 --- a/lib/routes/141jav/index.js +++ b/lib/routes/141jav/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.141jav.com'; const currentUrl = `${rootUrl}${getSubPath(ctx)}`; diff --git a/lib/routes/141jav/router.js b/lib/routes/141jav/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/141jav/router.js +++ b/lib/routes/141jav/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/141ppv/index.js b/lib/routes/141ppv/index.js index 04f0b24012bfda..00292dfcf16f11 100644 --- a/lib/routes/141ppv/index.js +++ b/lib/routes/141ppv/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.141ppv.com'; const currentUrl = `${rootUrl}${getSubPath(ctx)}`; diff --git a/lib/routes/141ppv/router.js b/lib/routes/141ppv/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/141ppv/router.js +++ b/lib/routes/141ppv/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/163/ds.js b/lib/routes/163/ds.js index 4b358d8a52d1f4..36b80bafe3f635 100644 --- a/lib/routes/163/ds.js +++ b/lib/routes/163/ds.js @@ -5,7 +5,7 @@ import * as path from 'node:path'; const root_url = 'https://inf.ds.163.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const current_url = `${root_url}/v1/web/feed/basic/getSomeOneFeeds?feedTypes=1,2,3,4,6,7,10,11&someOneUid=${id}`; diff --git a/lib/routes/163/dy.js b/lib/routes/163/dy.js index c7bacc6a8bcc84..cef7251e5b6184 100644 --- a/lib/routes/163/dy.js +++ b/lib/routes/163/dy.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { parseDyArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got(`https://dy.163.com/v2/article/list.do?pageNo=1&wemediaId=${id}&size=10`); diff --git a/lib/routes/163/dy2.js b/lib/routes/163/dy2.js index 8580432b9d21f1..213e8c70e69834 100644 --- a/lib/routes/163/dy2.js +++ b/lib/routes/163/dy2.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { parseDyArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ?? 30; const url = `https://www.163.com/dy/media/${id}.html`; diff --git a/lib/routes/163/exclusive.js b/lib/routes/163/exclusive.js index 4ee406af75443f..ca0a8376863ef2 100644 --- a/lib/routes/163/exclusive.js +++ b/lib/routes/163/exclusive.js @@ -73,7 +73,7 @@ const ids = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const rootUrl = 'https://3g.163.com'; diff --git a/lib/routes/163/music/artist-songs.js b/lib/routes/163/music/artist-songs.js index 283fdd29d9c3ab..4198622529b480 100644 --- a/lib/routes/163/music/artist-songs.js +++ b/lib/routes/163/music/artist-songs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { data } = await got(`https://music.163.com/api/v1/artist/songs`, { diff --git a/lib/routes/163/music/artist.js b/lib/routes/163/music/artist.js index 8391d9a61d2715..4dee490d9d4e13 100644 --- a/lib/routes/163/music/artist.js +++ b/lib/routes/163/music/artist.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got(`https://music.163.com/api/artist/albums/${id}`, { diff --git a/lib/routes/163/music/djradio.js b/lib/routes/163/music/djradio.js index 49abeb9b6a17ae..1ccec04a895d7e 100644 --- a/lib/routes/163/music/djradio.js +++ b/lib/routes/163/music/djradio.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const ProcessFeed = (limit, offset) => diff --git a/lib/routes/163/music/playlist.js b/lib/routes/163/music/playlist.js index 7c89723f845c0b..6791738cbf9546 100644 --- a/lib/routes/163/music/playlist.js +++ b/lib/routes/163/music/playlist.js @@ -3,7 +3,7 @@ import { config } from '@/config'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.ncm || !config.ncm.cookies) { throw new Error('163 Music RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/163/music/userevents.js b/lib/routes/163/music/userevents.js index 54acfdc44d8ba0..58e9bc693b981a 100644 --- a/lib/routes/163/music/userevents.js +++ b/lib/routes/163/music/userevents.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; const renderDescription = (info) => art(path.join(__dirname, '../templates/music/userevents.art'), info); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got(`https://music.163.com/api/event/get/${id}`, { diff --git a/lib/routes/163/music/userplaylist.js b/lib/routes/163/music/userplaylist.js index 010ef8e6fcd117..3f5e3bcbb191ee 100644 --- a/lib/routes/163/music/userplaylist.js +++ b/lib/routes/163/music/userplaylist.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const response = await got.post('https://music.163.com/api/user/playlist', { diff --git a/lib/routes/163/music/userplayrecords.js b/lib/routes/163/music/userplayrecords.js index 00cad4e5e6d922..ab08bb3bd30729 100644 --- a/lib/routes/163/music/userplayrecords.js +++ b/lib/routes/163/music/userplayrecords.js @@ -37,7 +37,7 @@ function getItem(records) { }); } -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const type = Number.parseInt(ctx.req.param('type')) || 0; diff --git a/lib/routes/163/news/rank.js b/lib/routes/163/news/rank.js index b2d453e9751cb8..7db04339a54e66 100644 --- a/lib/routes/163/news/rank.js +++ b/lib/routes/163/news/rank.js @@ -76,7 +76,7 @@ const timeRange = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || 'whole'; const type = ctx.req.param('type') || 'click'; const time = ctx.req.param('time') || 'day'; diff --git a/lib/routes/163/news/special.js b/lib/routes/163/news/special.js index 44a5613d664673..fbc97c929e0812 100644 --- a/lib/routes/163/news/special.js +++ b/lib/routes/163/news/special.js @@ -19,7 +19,7 @@ const typeMap = { 14: '浪潮', 15: '沸点', }; -module.exports = async (ctx) => { +export default async (ctx) => { if (!ctx.req.param('type')) { throw new Error('Bad parameter. See https://docs.rsshub.app/routes/game#wang-yi-da-shen'); } diff --git a/lib/routes/163/open/vip.js b/lib/routes/163/open/vip.js index 6896d61f74e4a9..f39593f2922d83 100644 --- a/lib/routes/163/open/vip.js +++ b/lib/routes/163/open/vip.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://vip.open.163.com'; const list_response = await got(url); diff --git a/lib/routes/163/renjian.js b/lib/routes/163/renjian.js index 32d4caa8191927..f097f950addc8a 100644 --- a/lib/routes/163/renjian.js +++ b/lib/routes/163/renjian.js @@ -13,7 +13,7 @@ const titles = { kanke: '看客', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'texie'; const rootUrl = 'https://renjian.163.com'; diff --git a/lib/routes/163/router.js b/lib/routes/163/router.js index b5446fbe9cf22b..8a4372fa1f8943 100644 --- a/lib/routes/163/router.js +++ b/lib/routes/163/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/exclusive/:id?', './exclusive'); router.get('/ds/:id', './ds'); router.get('/dy/:id', './dy'); diff --git a/lib/routes/163/today.js b/lib/routes/163/today.js index b85570d2b57652..f70cfdf82f7317 100644 --- a/lib/routes/163/today.js +++ b/lib/routes/163/today.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const needContent = /t|y/i.test(ctx.req.param('need_content') ?? 'true'); const rootUrl = 'https://gw.m.163.com'; diff --git a/lib/routes/18comic/album.js b/lib/routes/18comic/album.js index 46c178bf9faa7d..2e092c349ccfd1 100644 --- a/lib/routes/18comic/album.js +++ b/lib/routes/18comic/album.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const { defaultDomain, getRootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { domain = defaultDomain } = ctx.req.query(); const rootUrl = getRootUrl(domain); diff --git a/lib/routes/18comic/blogs.js b/lib/routes/18comic/blogs.js index ef1485e4e6faf8..59b231c45f184d 100644 --- a/lib/routes/18comic/blogs.js +++ b/lib/routes/18comic/blogs.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const { defaultDomain, getRootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const { domain = defaultDomain } = ctx.req.query(); const rootUrl = getRootUrl(domain); diff --git a/lib/routes/18comic/index.js b/lib/routes/18comic/index.js index a05db6c5b4fb8f..003b55a49fb36f 100644 --- a/lib/routes/18comic/index.js +++ b/lib/routes/18comic/index.js @@ -1,6 +1,6 @@ const { defaultDomain, getRootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'all'; const keyword = ctx.req.param('keyword') ?? ''; const time = ctx.req.param('time') ?? 'a'; diff --git a/lib/routes/18comic/router.js b/lib/routes/18comic/router.js index 5e321d8fb99c11..7ca981aec10fd3 100644 --- a/lib/routes/18comic/router.js +++ b/lib/routes/18comic/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/album/:id', './album'); router.get('/blogs/:category?', './blogs'); router.get('/search/:option?/:category?/:keyword?/:time?/:order?', './search'); diff --git a/lib/routes/18comic/search.js b/lib/routes/18comic/search.js index 2c01ed9df2959d..c0d2ff02ffcbd8 100644 --- a/lib/routes/18comic/search.js +++ b/lib/routes/18comic/search.js @@ -1,6 +1,6 @@ const { defaultDomain, getRootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const option = ctx.req.param('option') ?? 'photos'; const category = ctx.req.param('category') ?? 'all'; const keyword = ctx.req.param('keyword') ?? ''; diff --git a/lib/routes/19lou/index.js b/lib/routes/19lou/index.js index 7220f4d95b6e41..530fe4c846de79 100644 --- a/lib/routes/19lou/index.js +++ b/lib/routes/19lou/index.js @@ -15,7 +15,7 @@ const setCookie = function (cookieName, cookieValue, seconds, path, domain, secu return [encodeURI(cookieName), '=', encodeURI(cookieValue), expires ? '; expires=' + expires.toGMTString() : '', path ? '; path=' + path : '/', domain ? '; domain=' + domain : '', secure ? '; secure' : ''].join(''); }; -module.exports = async (ctx) => { +export default async (ctx) => { const city = ctx.req.param('city') ?? 'www'; if (!isValidHost(city)) { throw new Error('Invalid city'); diff --git a/lib/routes/19lou/router.js b/lib/routes/19lou/router.js index 9f37497d597678..578ff1b74a4293 100644 --- a/lib/routes/19lou/router.js +++ b/lib/routes/19lou/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:city?', './index'); }; diff --git a/lib/routes/1lou/index.js b/lib/routes/1lou/index.js index 028c447088ea72..8cbf4389b7ec0a 100644 --- a/lib/routes/1lou/index.js +++ b/lib/routes/1lou/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = ctx.req.param('path') ?? ''; const rootUrl = `https://www.1lou.me`; const currentUrl = `${rootUrl}/${path}`; diff --git a/lib/routes/1lou/router.js b/lib/routes/1lou/router.js index 7715208401f076..9bc8c038a0d9a4 100644 --- a/lib/routes/1lou/router.js +++ b/lib/routes/1lou/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:path?', './index'); }; diff --git a/lib/routes/1point3acres/blog.js b/lib/routes/1point3acres/blog.js index be23573a812cea..a17d0675b64765 100644 --- a/lib/routes/1point3acres/blog.js +++ b/lib/routes/1point3acres/blog.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const categoryMap = { studyinusa: { title: '留学申请', diff --git a/lib/routes/1point3acres/category.js b/lib/routes/1point3acres/category.js index bda8e27b2ca93f..e8e581ad8a2838 100644 --- a/lib/routes/1point3acres/category.js +++ b/lib/routes/1point3acres/category.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, apiRootUrl, types, ProcessThreads } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const type = ctx.req.param('type') ?? 'hot'; const order = ctx.req.param('order') ?? ''; diff --git a/lib/routes/1point3acres/offer.js b/lib/routes/1point3acres/offer.js index c3257e4005462c..980db60d2533a2 100644 --- a/lib/routes/1point3acres/offer.js +++ b/lib/routes/1point3acres/offer.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { // year 2017-2022 // 2017:6 2018:11 2019:12 2020:13 2021:14 2022:15 // CS:1 MIS:2 diff --git a/lib/routes/1point3acres/router.js b/lib/routes/1point3acres/router.js index 074bd7d3a83cb6..e5f05a2244af9b 100644 --- a/lib/routes/1point3acres/router.js +++ b/lib/routes/1point3acres/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:category?', './blog'); router.get('/category/:id?/:type?/:order?', './category'); router.get('/offer/:year?/:major?/:school?', './offer'); diff --git a/lib/routes/1point3acres/section.js b/lib/routes/1point3acres/section.js index 7031faf80c3858..abe7deb0756e30 100644 --- a/lib/routes/1point3acres/section.js +++ b/lib/routes/1point3acres/section.js @@ -12,7 +12,7 @@ const sections = { 265: '签证移民', }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const type = ctx.req.param('type') ?? 'hot'; const order = ctx.req.param('order') ?? ''; diff --git a/lib/routes/1point3acres/thread.js b/lib/routes/1point3acres/thread.js index 57170666661901..75b01fba35bc2f 100644 --- a/lib/routes/1point3acres/thread.js +++ b/lib/routes/1point3acres/thread.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, apiRootUrl, types, ProcessThreads } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'hot'; const order = ctx.req.param('order') ?? ''; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10; diff --git a/lib/routes/1point3acres/user/post.js b/lib/routes/1point3acres/user/post.js index d981a68ea065cf..0dbd420b6cd6ab 100644 --- a/lib/routes/1point3acres/user/post.js +++ b/lib/routes/1point3acres/user/post.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { posts } = (await got.get(`https://instant.1point3acres.com/v2/api/user/post?pg=1&ps=10&user_id=${id}`)).data; diff --git a/lib/routes/1point3acres/user/thread.js b/lib/routes/1point3acres/user/thread.js index 586e3caca65d6a..e37d23a1113751 100644 --- a/lib/routes/1point3acres/user/thread.js +++ b/lib/routes/1point3acres/user/thread.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { threads } = (await got.get(`https://instant.1point3acres.com/v2/api/user/thread?pg=1&ps=10&user_id=${id}`)).data; diff --git a/lib/routes/2048/index.js b/lib/routes/2048/index.js index c8035aa4731795..f20fd4f1370969 100644 --- a/lib/routes/2048/index.js +++ b/lib/routes/2048/index.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '2'; const rootUrl = 'https://hjd2048.com'; diff --git a/lib/routes/2048/router.js b/lib/routes/2048/router.js index c34676efd9b9eb..28cef7111ec14a 100644 --- a/lib/routes/2048/router.js +++ b/lib/routes/2048/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id?', './index'); }; diff --git a/lib/routes/2cycd/index.js b/lib/routes/2cycd/index.js index 2a7e12b6fb197a..418ccc5d0bc0a3 100644 --- a/lib/routes/2cycd/index.js +++ b/lib/routes/2cycd/index.js @@ -7,7 +7,7 @@ const iconv = require('iconv-lite'); // http://www.2cycd.com/forum.php?mod=forumdisplay&fid=43&orderby=dateline -module.exports = async (ctx) => { +export default async (ctx) => { const fid = ctx.req.param('fid') ?? '43'; const sort = ctx.req.param('sort') ?? 'dateline'; diff --git a/lib/routes/2cycd/router.js b/lib/routes/2cycd/router.js index 5268389d3ed100..e6c7f983144112 100644 --- a/lib/routes/2cycd/router.js +++ b/lib/routes/2cycd/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:fid/:sort?', './index'); }; diff --git a/lib/routes/36kr/hot-list.js b/lib/routes/36kr/hot-list.js index 9b1881685ecccf..393196e14a1786 100644 --- a/lib/routes/36kr/hot-list.js +++ b/lib/routes/36kr/hot-list.js @@ -23,7 +23,7 @@ const categories = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '24'; const currentUrl = category === '24' ? rootUrl : `${rootUrl}/hot-list/catalog`; diff --git a/lib/routes/36kr/index.js b/lib/routes/36kr/index.js index 189ed3122be57f..ce240902991e81 100644 --- a/lib/routes/36kr/index.js +++ b/lib/routes/36kr/index.js @@ -15,7 +15,7 @@ const shortcuts = { '/information/workplace': '/information/web_zhichang', }; -module.exports = async (ctx) => { +export default async (ctx) => { const path = getSubPath(ctx) .replace(/^\/news(?!flashes)/, '/information') .replace(/\/search\/article/, '/search/articles'); diff --git a/lib/routes/36kr/router.js b/lib/routes/36kr/router.js index 4703c7240dcc9f..4ec00c4c2de69f 100644 --- a/lib/routes/36kr/router.js +++ b/lib/routes/36kr/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/hot-list/:category?', './hot-list'); router.get('*', './index'); }; diff --git a/lib/routes/3dmgame/game.js b/lib/routes/3dmgame/game.js index ae30b9d68a0830..b3f4b35f8f0ec1 100644 --- a/lib/routes/3dmgame/game.js +++ b/lib/routes/3dmgame/game.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { name, type = 'news' } = ctx.req.param(); const url = `https://www.3dmgame.com/games/${name}/${type}/`; diff --git a/lib/routes/3dmgame/news-center.js b/lib/routes/3dmgame/news-center.js index ff634bebd80dc3..44049e8e3eaafe 100644 --- a/lib/routes/3dmgame/news-center.js +++ b/lib/routes/3dmgame/news-center.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '' } = ctx.req.param(); const isArcPost = category && !isNaN(category); // https://www.3dmgame.com/news/\d+/ const url = `https://www.3dmgame.com/${category && category !== 'news_36_1' ? 'news/' : ''}${category ?? 'news'}/`; diff --git a/lib/routes/3dmgame/router.js b/lib/routes/3dmgame/router.js index 129d66851905a4..247a4d550593b9 100644 --- a/lib/routes/3dmgame/router.js +++ b/lib/routes/3dmgame/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:category?', './news-center'); router.get('/:name/:type?', './game'); }; diff --git a/lib/routes/423down/index.js b/lib/routes/423down/index.js index e80251b694bc93..4384c5f07184ab 100644 --- a/lib/routes/423down/index.js +++ b/lib/routes/423down/index.js @@ -65,7 +65,7 @@ const titleMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category, type } = ctx.req.param(); const url = `${rootUrl}/${categeoryMap[category][type]}`; diff --git a/lib/routes/423down/router.js b/lib/routes/423down/router.js index ce0df1288f62ed..4f00f6c8461236 100644 --- a/lib/routes/423down/router.js +++ b/lib/routes/423down/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category/:type?', './index'); }; diff --git a/lib/routes/4gamers/category.js b/lib/routes/4gamers/category.js index b11f4bbb23661c..b248d16bd5038c 100644 --- a/lib/routes/4gamers/category.js +++ b/lib/routes/4gamers/category.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { parseList, parseItem, getCategories } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25; const isLatest = !category; diff --git a/lib/routes/4gamers/router.js b/lib/routes/4gamers/router.js index 3dc7631a9c4652..85dc5c61ac2e6d 100644 --- a/lib/routes/4gamers/router.js +++ b/lib/routes/4gamers/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './category'); router.get('/category/:category', './category'); router.get('/tag/:tag', './tag'); diff --git a/lib/routes/4gamers/tag.js b/lib/routes/4gamers/tag.js index d61d3ebacba017..02eac48d3d1578 100644 --- a/lib/routes/4gamers/tag.js +++ b/lib/routes/4gamers/tag.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25; diff --git a/lib/routes/4gamers/topic.js b/lib/routes/4gamers/topic.js index dc4c8f5cf65921..f70cb954906d45 100644 --- a/lib/routes/4gamers/topic.js +++ b/lib/routes/4gamers/topic.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const topic = ctx.req.param('topic'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25; diff --git a/lib/routes/4ksj/forum.js b/lib/routes/4ksj/forum.js index 27c59d7896b21f..ef765954d29e57 100644 --- a/lib/routes/4ksj/forum.js +++ b/lib/routes/4ksj/forum.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const iconv = require('iconv-lite'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '2-1'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25; diff --git a/lib/routes/4ksj/router.js b/lib/routes/4ksj/router.js index 48862b0f0c5c59..fbe01a2d755e6c 100644 --- a/lib/routes/4ksj/router.js +++ b/lib/routes/4ksj/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/forum/:id?', './forum'); }; diff --git a/lib/routes/500px/router.js b/lib/routes/500px/router.js index 376ded9fe55964..915d40205e7f42 100644 --- a/lib/routes/500px/router.js +++ b/lib/routes/500px/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/tribe/set/:id', './tribe-set'); router.get('/user/works/:id', './user'); }; diff --git a/lib/routes/500px/tribe-set.js b/lib/routes/500px/tribe-set.js index 437defa7136df8..31c0a615a31995 100644 --- a/lib/routes/500px/tribe-set.js +++ b/lib/routes/500px/tribe-set.js @@ -5,7 +5,7 @@ import * as path from 'node:path'; const { baseUrl, getTribeDetail, getTribeSets } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = Number.parseInt(ctx.req.query('limit')) || 100; diff --git a/lib/routes/500px/user.js b/lib/routes/500px/user.js index 51e24862482786..5c7b83ecc98785 100644 --- a/lib/routes/500px/user.js +++ b/lib/routes/500px/user.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import * as path from 'node:path'; const { baseUrl, getUserInfoFromUsername, getUserInfoFromId, getUserWorks } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { let { id } = ctx.req.param(); const limit = Number.parseInt(ctx.req.query('limit')) || 100; diff --git a/lib/routes/50forum/router.js b/lib/routes/50forum/router.js index ac131412e45870..614635cd7374fa 100644 --- a/lib/routes/50forum/router.js +++ b/lib/routes/50forum/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './zhuanjia'); }; diff --git a/lib/routes/50forum/zhuanjia.js b/lib/routes/50forum/zhuanjia.js index f764412d80a43c..dc9be176aa1d47 100644 --- a/lib/routes/50forum/zhuanjia.js +++ b/lib/routes/50forum/zhuanjia.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://www.50forum.org.cn'; const response = await got({ method: 'get', diff --git a/lib/routes/52hrtt/index.js b/lib/routes/52hrtt/index.js index 14198223e34073..8e8df76fdf6e2e 100644 --- a/lib/routes/52hrtt/index.js +++ b/lib/routes/52hrtt/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const area = ctx.req.param('area') ?? 'global'; const type = ctx.req.param('type') ?? ''; diff --git a/lib/routes/52hrtt/router.js b/lib/routes/52hrtt/router.js index 1498ead3682699..423fec16f8a7f0 100644 --- a/lib/routes/52hrtt/router.js +++ b/lib/routes/52hrtt/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/symposium/:id?/:classId?', './symposium'); router.get('/:area?/:type?', './'); }; diff --git a/lib/routes/52hrtt/symposium.js b/lib/routes/52hrtt/symposium.js index 1f56d45001336f..81cdfe69170977 100644 --- a/lib/routes/52hrtt/symposium.js +++ b/lib/routes/52hrtt/symposium.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const classId = ctx.req.param('classId') ?? ''; diff --git a/lib/routes/56kog/class.js b/lib/routes/56kog/class.js index 3f016a0f1b85b2..8854834fab1908 100644 --- a/lib/routes/56kog/class.js +++ b/lib/routes/56kog/class.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, fetchItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '1_1' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/56kog/router.js b/lib/routes/56kog/router.js index cca8817bde5a60..bf2d5452e770c4 100644 --- a/lib/routes/56kog/router.js +++ b/lib/routes/56kog/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/class/:category?', './class'); router.get('/top/:category?', './top'); }; diff --git a/lib/routes/56kog/top.js b/lib/routes/56kog/top.js index 9492e563e39837..a201e3b7c6a3f8 100644 --- a/lib/routes/56kog/top.js +++ b/lib/routes/56kog/top.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, fetchItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'weekvisit' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/591/list.js b/lib/routes/591/list.js index 970248acf93f63..0da3a23591376d 100644 --- a/lib/routes/591/list.js +++ b/lib/routes/591/list.js @@ -103,7 +103,7 @@ async function getHouseList(houseListURL) { const renderHouse = (house) => art(path.join(__dirname, 'templates/house.art'), { house }); -module.exports = async (ctx) => { +export default async (ctx) => { const query = ctx.req.param('query') ?? ''; const country = ctx.req.param('country') ?? 'tw'; diff --git a/lib/routes/591/router.js b/lib/routes/591/router.js index 13bd5d41edda79..3f05855804448f 100644 --- a/lib/routes/591/router.js +++ b/lib/routes/591/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:country/rent/:query?', './list'); }; diff --git a/lib/routes/5eplay/index.js b/lib/routes/5eplay/index.js index 15755d354024b1..c83e9d545df421 100644 --- a/lib/routes/5eplay/index.js +++ b/lib/routes/5eplay/index.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; const { getAcwScV2ByArg1 } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://csgo.5eplay.com/'; const apiUrl = `${rootUrl}api/article?page=1&type_id=0&time=0&order_by=0`; const articleUrl = `${rootUrl}article`; diff --git a/lib/routes/5eplay/router.js b/lib/routes/5eplay/router.js index 7be2293b85be91..a45fe424924c98 100644 --- a/lib/routes/5eplay/router.js +++ b/lib/routes/5eplay/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/article', '.'); }; diff --git a/lib/routes/6park/index.js b/lib/routes/6park/index.js index b29db20a1a8baf..b48fc200eeed0d 100644 --- a/lib/routes/6park/index.js +++ b/lib/routes/6park/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'chan1'; const type = ctx.req.param('type') ?? ''; const keyword = ctx.req.param('keyword') ?? ''; diff --git a/lib/routes/6park/news.js b/lib/routes/6park/news.js index 932d151caba2c5..b10b8cba26d2c2 100644 --- a/lib/routes/6park/news.js +++ b/lib/routes/6park/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const site = ctx.req.param('site') ?? 'newspark'; const id = ctx.req.param('id') ?? ''; const keyword = ctx.req.param('keyword') ?? ''; diff --git a/lib/routes/6park/router.js b/lib/routes/6park/router.js index 4074d0543dffa4..ec1bfd6e40504e 100644 --- a/lib/routes/6park/router.js +++ b/lib/routes/6park/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:site?/:id?/:keyword?', './news'); router.get('/:id?/:type?/:keyword?', './'); }; diff --git a/lib/routes/6v123/latest-movies.js b/lib/routes/6v123/latest-movies.js index 644e5112f8ed05..2dfd9817a4a7c6 100644 --- a/lib/routes/6v123/latest-movies.js +++ b/lib/routes/6v123/latest-movies.js @@ -2,7 +2,7 @@ const { processItems } = require('./utils'); const baseURL = 'https://www.hao6v.cc/gvod/zx.html'; -module.exports = async (ctx) => { +export default async (ctx) => { const item = await processItems(ctx, baseURL); ctx.set('data', { diff --git a/lib/routes/6v123/latest-tvseries.js b/lib/routes/6v123/latest-tvseries.js index 151b5753fde2af..87181718e0aeb0 100644 --- a/lib/routes/6v123/latest-tvseries.js +++ b/lib/routes/6v123/latest-tvseries.js @@ -2,7 +2,7 @@ const { processItems } = require('./utils'); const baseURL = 'https://www.hao6v.tv/gvod/dsj.html'; -module.exports = async (ctx) => { +export default async (ctx) => { const item = await processItems(ctx, baseURL); ctx.set('data', { diff --git a/lib/routes/6v123/router.js b/lib/routes/6v123/router.js index ae25139e6c6778..14e612b98a9027 100644 --- a/lib/routes/6v123/router.js +++ b/lib/routes/6v123/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/latestMovies', './latest-movies'); router.get('/latestTVSeries', './latest-tvseries'); }; diff --git a/lib/routes/78dm/index.js b/lib/routes/78dm/index.js index 2e6259aa132cf5..68bddd49312cf4 100644 --- a/lib/routes/78dm/index.js +++ b/lib/routes/78dm/index.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.78dm.net'; const currentUrl = `${rootUrl}${getSubPath(ctx) === '/' ? '/news' : /\/\d+$/.test(getSubPath(ctx)) ? `${getSubPath(ctx)}.html` : getSubPath(ctx)}`; diff --git a/lib/routes/78dm/router.js b/lib/routes/78dm/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/78dm/router.js +++ b/lib/routes/78dm/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/7mmtv/index.js b/lib/routes/7mmtv/index.js index ffd6c2746293e9..cbea98d92db7db 100644 --- a/lib/routes/7mmtv/index.js +++ b/lib/routes/7mmtv/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? 'en'; const category = ctx.req.param('category') ?? 'censored_list'; const type = ctx.req.param('type') ?? 'all'; diff --git a/lib/routes/7mmtv/router.js b/lib/routes/7mmtv/router.js index 86a3bce3a94028..49e420246a6d06 100644 --- a/lib/routes/7mmtv/router.js +++ b/lib/routes/7mmtv/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:language?/:category?/:type?', './index'); }; diff --git a/lib/routes/81/81rc/index.js b/lib/routes/81/81rc/index.js index 14297e7df5f60d..1cd6375953e5b2 100644 --- a/lib/routes/81/81rc/index.js +++ b/lib/routes/81/81rc/index.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const thePath = getSubPath(ctx).replace(/^\/81rc/, ''); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/81/router.js b/lib/routes/81/router.js index 29085d755d00d2..2bb14d40debfa0 100644 --- a/lib/routes/81/router.js +++ b/lib/routes/81/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/81rc/*', './81rc'); }; diff --git a/lib/routes/8264/list.js b/lib/routes/8264/list.js index d2405b8f966e18..b4112480aab00f 100644 --- a/lib/routes/8264/list.js +++ b/lib/routes/8264/list.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = '751' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/8264/router.js b/lib/routes/8264/router.js index 0074d06ffd5ec2..aa6d88a43858e5 100644 --- a/lib/routes/8264/router.js +++ b/lib/routes/8264/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/list/:id?', './list'); }; diff --git a/lib/routes/8kcos/cat.js b/lib/routes/8kcos/cat.js index 70a5086ddc89af..029aef75eceb2e 100644 --- a/lib/routes/8kcos/cat.js +++ b/lib/routes/8kcos/cat.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { SUB_NAME_PREFIX, SUB_URL } = require('./const'); const loadArticle = require('./article'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = Number.parseInt(ctx.req.query('limit')); const { cat = '8kasianidol' } = ctx.req.param(); const url = `${SUB_URL}category/${cat}/`; diff --git a/lib/routes/8kcos/latest.js b/lib/routes/8kcos/latest.js index c61e8cacaaa05d..e0b1375ffefeb4 100644 --- a/lib/routes/8kcos/latest.js +++ b/lib/routes/8kcos/latest.js @@ -5,7 +5,7 @@ const { SUB_NAME_PREFIX, SUB_URL } = require('./const'); const loadArticle = require('./article'); const url = SUB_URL; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = Number.parseInt(ctx.req.query('limit')); const response = await got(url); const itemRaw = load(response.body)('ul.post-loop li.item').toArray(); diff --git a/lib/routes/8kcos/router.js b/lib/routes/8kcos/router.js index e6cd4f62544c99..abbe2965c96e56 100644 --- a/lib/routes/8kcos/router.js +++ b/lib/routes/8kcos/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './latest'); router.get('/cat/:cat*', './cat'); router.get('/tag/:tag', './tag'); diff --git a/lib/routes/8kcos/tag.js b/lib/routes/8kcos/tag.js index befdb07fc20e46..17260b3e35b246 100644 --- a/lib/routes/8kcos/tag.js +++ b/lib/routes/8kcos/tag.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { SUB_NAME_PREFIX, SUB_URL } = require('./const'); const loadArticle = require('./article'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = Number.parseInt(ctx.req.query('limit')); const tag = ctx.req.param('tag'); const url = `${SUB_URL}tag/${tag}/`; diff --git a/lib/routes/8world/index.js b/lib/routes/8world/index.js index 3e187442c3d5d1..69e5191b010de3 100644 --- a/lib/routes/8world/index.js +++ b/lib/routes/8world/index.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = getSubPath(ctx) === '/' ? '/realtime' : getSubPath(ctx); const rootUrl = 'https://www.8world.com'; diff --git a/lib/routes/8world/router.js b/lib/routes/8world/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/8world/router.js +++ b/lib/routes/8world/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/91porn/author.js b/lib/routes/91porn/author.js index 242946bbce3ce4..963ba845953df2 100644 --- a/lib/routes/91porn/author.js +++ b/lib/routes/91porn/author.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { domainValidation } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { domain = '91porn.com' } = ctx.req.query(); const { uid, lang = 'en_US' } = ctx.req.param(); const siteUrl = `https://${domain}/uvideos.php?UID=${uid}&type=public`; diff --git a/lib/routes/91porn/index.js b/lib/routes/91porn/index.js index 89acec5aa717bd..247ec290742923 100644 --- a/lib/routes/91porn/index.js +++ b/lib/routes/91porn/index.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { domainValidation } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { domain = '91porn.com' } = ctx.req.query(); const siteUrl = `https://${domain}/index.php`; const { lang = 'en_US' } = ctx.req.param(); diff --git a/lib/routes/91porn/router.js b/lib/routes/91porn/router.js index a51cf9dbc29363..e29f710fd81b2d 100644 --- a/lib/routes/91porn/router.js +++ b/lib/routes/91porn/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/author/:uid/:lang?', './author'); router.get('/:lang?', './index'); }; diff --git a/lib/routes/95mm/category.js b/lib/routes/95mm/category.js index ad402868e483a1..40a9ed2454e225 100644 --- a/lib/routes/95mm/category.js +++ b/lib/routes/95mm/category.js @@ -1,6 +1,6 @@ const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const categories = { 1: '清纯唯美', 2: '摄影私房', diff --git a/lib/routes/95mm/router.js b/lib/routes/95mm/router.js index 7055da0e17d2ef..3dac4a66718132 100644 --- a/lib/routes/95mm/router.js +++ b/lib/routes/95mm/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/tab/:tab?', './tab'); router.get('/tag/:tag', './tag'); router.get('/category/:category', './category'); diff --git a/lib/routes/95mm/tab.js b/lib/routes/95mm/tab.js index 1b3722011697d2..296af37deee7e0 100644 --- a/lib/routes/95mm/tab.js +++ b/lib/routes/95mm/tab.js @@ -1,6 +1,6 @@ const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const tab = ctx.req.param('tab') ?? '最新'; const currentUrl = `${rootUrl}/home-ajax/index.html?tabcid=${tab}&page=1`; diff --git a/lib/routes/95mm/tag.js b/lib/routes/95mm/tag.js index 50ef64c1471fcc..a674bc3b9ad139 100644 --- a/lib/routes/95mm/tag.js +++ b/lib/routes/95mm/tag.js @@ -1,6 +1,6 @@ const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const currentUrl = `${rootUrl}/tag-${tag}/page-1/index.html`; diff --git a/lib/routes/9to5/router.js b/lib/routes/9to5/router.js index 829101ec2e7617..6983d696d7a2cb 100644 --- a/lib/routes/9to5/router.js +++ b/lib/routes/9to5/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:subsite/:tag?', './subsite'); }; diff --git a/lib/routes/9to5/subsite.js b/lib/routes/9to5/subsite.js index 588fcad5be8cf8..11e6fe32597f29 100644 --- a/lib/routes/9to5/subsite.js +++ b/lib/routes/9to5/subsite.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import parser from '@/utils/rss-parser'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { let title = '9To5', link, description; diff --git a/lib/routes/aamacau/index.js b/lib/routes/aamacau/index.js index e18ab00e969227..805945303470c9 100644 --- a/lib/routes/aamacau/index.js +++ b/lib/routes/aamacau/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'topics'; const id = ctx.req.param('id') ?? ''; diff --git a/lib/routes/aamacau/router.js b/lib/routes/aamacau/router.js index 56b183011a03d5..053ae4cee08413 100644 --- a/lib/routes/aamacau/router.js +++ b/lib/routes/aamacau/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?/:id?', './index'); }; diff --git a/lib/routes/abc/index.js b/lib/routes/abc/index.js index 257cef01e415ed..6be4ec49c39e63 100644 --- a/lib/routes/abc/index.js +++ b/lib/routes/abc/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'news/justin' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/abc/router.js b/lib/routes/abc/router.js index 5c89b519009bee..cffd8f2def5c8c 100644 --- a/lib/routes/abc/router.js +++ b/lib/routes/abc/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category*', './'); }; diff --git a/lib/routes/abmedia/category.js b/lib/routes/abmedia/category.js index 55f43ed817f950..31623f5dd0b213 100644 --- a/lib/routes/abmedia/category.js +++ b/lib/routes/abmedia/category.js @@ -7,7 +7,7 @@ const postsAPIUrl = `${rootUrl}/wp-json/wp/v2/posts`; const getCategoryId = (category) => got.get(`${cateAPIUrl}?slug=${category}`).then((res) => res.data[0].id); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'technology-development'; const limit = ctx.req.param('limit') ?? 25; const categoryId = await getCategoryId(category); diff --git a/lib/routes/abmedia/index.js b/lib/routes/abmedia/index.js index 8baa7b7a6a34f6..1bb71e38e51aab 100644 --- a/lib/routes/abmedia/index.js +++ b/lib/routes/abmedia/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.abmedia.io'; const postsAPIUrl = `${rootUrl}/wp-json/wp/v2/posts`; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.param('limit') ?? 10; const url = `${postsAPIUrl}?per_page=${limit}`; diff --git a/lib/routes/abmedia/router.js b/lib/routes/abmedia/router.js index 9203a97a948447..5e4b7f6b5792fc 100644 --- a/lib/routes/abmedia/router.js +++ b/lib/routes/abmedia/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/index', './index'); router.get('/:category?', './category'); }; diff --git a/lib/routes/abskoop/index.js b/lib/routes/abskoop/index.js index 37566a5a498370..abc26382cfcc91 100644 --- a/lib/routes/abskoop/index.js +++ b/lib/routes/abskoop/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://www.ahhhhfs.com/wp-json/wp/v2/posts', diff --git a/lib/routes/abskoop/nsfw.js b/lib/routes/abskoop/nsfw.js index ff7be9a1eee3f5..cd31412a35f00b 100644 --- a/lib/routes/abskoop/nsfw.js +++ b/lib/routes/abskoop/nsfw.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://nsfw.abskoop.com/wp-json/wp/v2/posts', diff --git a/lib/routes/abskoop/router.js b/lib/routes/abskoop/router.js index 49100cf79c403c..8340f2e7272e64 100644 --- a/lib/routes/abskoop/router.js +++ b/lib/routes/abskoop/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); router.get('/nsfw', './nsfw'); }; diff --git a/lib/routes/acfun/article.js b/lib/routes/acfun/article.js index d781817318be4d..1d1c8d8b3f9256 100644 --- a/lib/routes/acfun/article.js +++ b/lib/routes/acfun/article.js @@ -33,7 +33,7 @@ const categoryMap = { const sortTypeEnum = new Set(['createTime', 'lastCommentTime', 'hotScore']); const timeRangeEnum = new Set(['all', 'oneDay', 'threeDay', 'oneWeek', 'oneMonth']); -module.exports = async (ctx) => { +export default async (ctx) => { const { categoryId, sortType = 'createTime', timeRange = 'all' } = ctx.req.param(); if (!categoryMap[categoryId]) { throw new Error(`Invalid category Id: ${categoryId}`); diff --git a/lib/routes/acfun/bangumi.js b/lib/routes/acfun/bangumi.js index af9231053b6a2e..cf0a9daaef517d 100644 --- a/lib/routes/acfun/bangumi.js +++ b/lib/routes/acfun/bangumi.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const url = `https://www.acfun.cn/bangumi/aa${id}`; diff --git a/lib/routes/acfun/router.js b/lib/routes/acfun/router.js index 02677367a9ec96..1ee007347c6167 100644 --- a/lib/routes/acfun/router.js +++ b/lib/routes/acfun/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/article/:categoryId/:sortType?/:timeRange?', './article'); router.get('/bangumi/:id', './bangumi'); router.get('/user/video/:uid', './video'); diff --git a/lib/routes/acfun/video.js b/lib/routes/acfun/video.js index 422838520b4278..f4b7cf4f5252e6 100644 --- a/lib/routes/acfun/video.js +++ b/lib/routes/acfun/video.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const url = `https://www.acfun.cn/u/${uid}`; const host = 'https://www.acfun.cn'; diff --git a/lib/routes/acg17/post.js b/lib/routes/acg17/post.js index d85ece4e7bf76f..8f54088daced81 100644 --- a/lib/routes/acg17/post.js +++ b/lib/routes/acg17/post.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'http://acg17.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(`${host}/wp-json/wp/v2/posts?per_page=30`); const list = response.data; ctx.set('data', { diff --git a/lib/routes/acg17/router.js b/lib/routes/acg17/router.js index 299d1d6b68e1e5..486f5842c9a268 100644 --- a/lib/routes/acg17/router.js +++ b/lib/routes/acg17/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/post/all', './post'); }; diff --git a/lib/routes/acpaa/index.js b/lib/routes/acpaa/index.js index fe7a6d9f1fb76c..eec9d8a66efc77 100644 --- a/lib/routes/acpaa/index.js +++ b/lib/routes/acpaa/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = '1', name = '重要通知' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/acpaa/router.js b/lib/routes/acpaa/router.js index 38ee120f45cc4a..736d8da35a4dd3 100644 --- a/lib/routes/acpaa/router.js +++ b/lib/routes/acpaa/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id?/:name?', './'); }; diff --git a/lib/routes/acs/journal.js b/lib/routes/acs/journal.js index f8ce37d6094f60..fb654040f90acd 100644 --- a/lib/routes/acs/journal.js +++ b/lib/routes/acs/journal.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const rootUrl = 'https://pubs.acs.org'; diff --git a/lib/routes/acs/router.js b/lib/routes/acs/router.js index 63454f2c6149db..7026d3b4da3538 100644 --- a/lib/routes/acs/router.js +++ b/lib/routes/acs/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/journal/:id', './journal'); }; diff --git a/lib/routes/aeaweb/index.js b/lib/routes/aeaweb/index.js index 12f566d0b111d7..44de818fb836e6 100644 --- a/lib/routes/aeaweb/index.js +++ b/lib/routes/aeaweb/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { let id = ctx.req.param('id'); const rootUrl = 'https://www.aeaweb.org'; diff --git a/lib/routes/aeaweb/router.js b/lib/routes/aeaweb/router.js index de87b52670c7db..c79f907ed7d0b5 100644 --- a/lib/routes/aeaweb/router.js +++ b/lib/routes/aeaweb/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id', './index'); }; diff --git a/lib/routes/aeon/category.js b/lib/routes/aeon/category.js index 800fcb458dc0b8..d262d4772e846e 100644 --- a/lib/routes/aeon/category.js +++ b/lib/routes/aeon/category.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; const { getData } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://aeon.co/${ctx.req.param('category')}`; const { data: response } = await got(url); const $ = load(response); diff --git a/lib/routes/aeon/router.js b/lib/routes/aeon/router.js index c8be8bd8690501..2f9b26e3f82061 100644 --- a/lib/routes/aeon/router.js +++ b/lib/routes/aeon/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/category/:category', './category'); router.get('/:type', './type'); }; diff --git a/lib/routes/aeon/type.js b/lib/routes/aeon/type.js index a9e2fe51eb6355..3709804fd6d38b 100644 --- a/lib/routes/aeon/type.js +++ b/lib/routes/aeon/type.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; const { getData } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const binaryType = type === 'videos' ? 'videos' : 'essays'; const capitalizedType = type.charAt(0).toUpperCase() + type.slice(1); diff --git a/lib/routes/agefans/detail.js b/lib/routes/agefans/detail.js index 8e79ab53a6283e..89d49382173190 100644 --- a/lib/routes/agefans/detail.js +++ b/lib/routes/agefans/detail.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { rootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(`${rootUrl}/detail/${ctx.req.param('id')}`); const $ = load(response.data); diff --git a/lib/routes/agefans/router.js b/lib/routes/agefans/router.js index e0154d0ee192a5..90dcb2b320440a 100644 --- a/lib/routes/agefans/router.js +++ b/lib/routes/agefans/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/detail/:id', './detail'); router.get('/update', './update'); }; diff --git a/lib/routes/agefans/update.js b/lib/routes/agefans/update.js index e8ac81cfb2f72f..378024d7a9ae82 100644 --- a/lib/routes/agefans/update.js +++ b/lib/routes/agefans/update.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { rootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/update`; const response = await got(currentUrl); diff --git a/lib/routes/agirls/index.js b/lib/routes/agirls/index.js index 73e5d1472c526c..cb7c17b0d8ddbf 100644 --- a/lib/routes/agirls/index.js +++ b/lib/routes/agirls/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl, parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '' } = ctx.req.param(); const link = `${baseUrl}/posts${category ? `/${category}` : ''}`; const response = await got(link); diff --git a/lib/routes/agirls/router.js b/lib/routes/agirls/router.js index 931d32e7f20543..672901d57ff180 100644 --- a/lib/routes/agirls/router.js +++ b/lib/routes/agirls/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/topic/:topic', './topic'); router.get('/topic_list', './topic-list'); router.get('/:category?', './index'); diff --git a/lib/routes/agirls/topic-list.js b/lib/routes/agirls/topic-list.js index 22262a6dc7deb3..9e325d1e014143 100644 --- a/lib/routes/agirls/topic-list.js +++ b/lib/routes/agirls/topic-list.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = 'topic'; const link = `${baseUrl}/${category}`; diff --git a/lib/routes/agirls/topic.js b/lib/routes/agirls/topic.js index 07e4745bcf3aaf..8b2b38cd80327b 100644 --- a/lib/routes/agirls/topic.js +++ b/lib/routes/agirls/topic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl, parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const topic = ctx.req.param('topic'); const link = `${baseUrl}/topic/${topic}`; const response = await got(link); diff --git a/lib/routes/agora0/index.js b/lib/routes/agora0/index.js index cf227695f205ce..5ca24ae562b06b 100644 --- a/lib/routes/agora0/index.js +++ b/lib/routes/agora0/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'initium'; const rootUrl = 'https://agora0.gitlab.io'; diff --git a/lib/routes/agora0/pen0.js b/lib/routes/agora0/pen0.js index 7d445cf4517624..3f0ce2e94d760e 100644 --- a/lib/routes/agora0/pen0.js +++ b/lib/routes/agora0/pen0.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://agorahub.github.io'; const response = await got(`${baseUrl}/pen0/`); const $ = load(response.data); diff --git a/lib/routes/agora0/router.js b/lib/routes/agora0/router.js index c800b6ea0e1dd3..1dbe8bd1b57e21 100644 --- a/lib/routes/agora0/router.js +++ b/lib/routes/agora0/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/pen0', './pen0'); router.get('/:category?', './index'); }; diff --git a/lib/routes/ahjzu/news.js b/lib/routes/ahjzu/news.js index c13ccb05644c52..f04646f89b9e36 100644 --- a/lib/routes/ahjzu/news.js +++ b/lib/routes/ahjzu/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.ahjzu.edu.cn'; const currentUrl = 'https://www.ahjzu.edu.cn/20/list.htm'; diff --git a/lib/routes/ahjzu/router.js b/lib/routes/ahjzu/router.js index bd25c22a2fd87b..3c9877e17cb637 100644 --- a/lib/routes/ahjzu/router.js +++ b/lib/routes/ahjzu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/aicaijing/index.js b/lib/routes/aicaijing/index.js index 1cf7cbc4083587..c7aaccbb127592 100644 --- a/lib/routes/aicaijing/index.js +++ b/lib/routes/aicaijing/index.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'latest'; const id = ctx.req.param('id') ?? 14; diff --git a/lib/routes/aicaijing/router.js b/lib/routes/aicaijing/router.js index 4296c8c197ef79..611f80b11b9081 100644 --- a/lib/routes/aicaijing/router.js +++ b/lib/routes/aicaijing/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?/:id?', './'); }; diff --git a/lib/routes/aiea/index.js b/lib/routes/aiea/index.js index 8024343baa3a71..3a2c157793c360 100644 --- a/lib/routes/aiea/index.js +++ b/lib/routes/aiea/index.js @@ -1,6 +1,6 @@ import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://www.aiea.org/0504'; const period = ctx.req.param('period') ?? ''; diff --git a/lib/routes/aiea/router.js b/lib/routes/aiea/router.js index 033bb5c47ce25c..56f7ab431f391b 100644 --- a/lib/routes/aiea/router.js +++ b/lib/routes/aiea/router.js @@ -1,3 +1 @@ -module.exports = function (router) { - return router.get('/seminars/:period', '.'); -}; +export default (router) => router.get('/seminars/:period', '.'); diff --git a/lib/routes/aijishu/index.js b/lib/routes/aijishu/index.js index aaadf47c83fa69..33b4a3af45f3c1 100644 --- a/lib/routes/aijishu/index.js +++ b/lib/routes/aijishu/index.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type, name = 'newest' } = ctx.req.param(); const u = name === 'newest' ? `https://aijishu.com/` : `https://aijishu.com/${type}/${name}`; const html = await got(u); diff --git a/lib/routes/aijishu/router.js b/lib/routes/aijishu/router.js index 0d08fa87ce6504..6fa12feeb1ff15 100644 --- a/lib/routes/aijishu/router.js +++ b/lib/routes/aijishu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type/:name?', '.'); }; diff --git a/lib/routes/ainvest/article.js b/lib/routes/ainvest/article.js index 3f6920c32e1218..2d7b0079a166dd 100644 --- a/lib/routes/ainvest/article.js +++ b/lib/routes/ainvest/article.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { getHeaders, randomString, encryptAES, decryptAES } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const key = randomString(16); const { data: response } = await got.post('https://api.ainvest.com/gw/socialcenter/v1/edu/article/listArticle', { diff --git a/lib/routes/ainvest/news.js b/lib/routes/ainvest/news.js index ae6fafdd6b3421..79a14f01d5e3fe 100644 --- a/lib/routes/ainvest/news.js +++ b/lib/routes/ainvest/news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { getHeaders, randomString, decryptAES } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const key = randomString(16); const { data: response } = await got('https://api.ainvest.com/gw/news_f10/v1/newsFlash/getNewsData', { diff --git a/lib/routes/ainvest/router.js b/lib/routes/ainvest/router.js index 3ad71f31794212..be8a3e99f707b7 100644 --- a/lib/routes/ainvest/router.js +++ b/lib/routes/ainvest/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/article', './article'); router.get('/news', './news'); }; diff --git a/lib/routes/aip/journal-pupp.js b/lib/routes/aip/journal-pupp.js index f130c6d398c451..2c2de0abb63175 100644 --- a/lib/routes/aip/journal-pupp.js +++ b/lib/routes/aip/journal-pupp.js @@ -5,7 +5,7 @@ import { config } from '@/config'; import { isValidHost } from '@/utils/valid-host'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const pub = ctx.req.param('pub'); const jrn = ctx.req.param('jrn'); const host = `https://pubs.aip.org`; diff --git a/lib/routes/aip/journal.js b/lib/routes/aip/journal.js index 73c23528e6f815..1a04fca20bce81 100644 --- a/lib/routes/aip/journal.js +++ b/lib/routes/aip/journal.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { renderDesc } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const pub = ctx.req.param('pub'); const jrn = ctx.req.param('jrn'); const host = `https://pubs.aip.org`; diff --git a/lib/routes/aip/router.js b/lib/routes/aip/router.js index a464993a1ddc9a..b3ad0e5bf7752d 100644 --- a/lib/routes/aip/router.js +++ b/lib/routes/aip/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/:pub/:jrn', './journal'); // router.get('/:pub/:jrn', './journal-pupp'); // Switch to this route if the official website blocks the "got" method. }; diff --git a/lib/routes/airchina/index.js b/lib/routes/airchina/index.js index 84a8b163bd42b3..a019b490ccf96d 100644 --- a/lib/routes/airchina/index.js +++ b/lib/routes/airchina/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import buildData from '@/utils/common-config'; const baseUrl = 'https://www.airchina.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `${baseUrl}/cn/info/new-service/service_announcement.shtml`; const data = await buildData({ link, diff --git a/lib/routes/airchina/router.js b/lib/routes/airchina/router.js index c3b6ffb51e6ca4..677dfd592f67c1 100644 --- a/lib/routes/airchina/router.js +++ b/lib/routes/airchina/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/announcement', './index'); }; diff --git a/lib/routes/aisixiang/column.js b/lib/routes/aisixiang/column.js index e5cdef3ba673e9..342e134b91e98c 100644 --- a/lib/routes/aisixiang/column.js +++ b/lib/routes/aisixiang/column.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const { rootUrl, ossUrl, ProcessFeed } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/aisixiang/router.js b/lib/routes/aisixiang/router.js index 8f86930db61fd0..868acffb2174b3 100644 --- a/lib/routes/aisixiang/router.js +++ b/lib/routes/aisixiang/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/column/:id', './column'); router.get('/ranking/:id?/:period?', './toplist'); router.get('/toplist/:id?/:period?', './toplist'); diff --git a/lib/routes/aisixiang/thinktank.js b/lib/routes/aisixiang/thinktank.js index 61745dbf675139..7f26e6419a7dfb 100644 --- a/lib/routes/aisixiang/thinktank.js +++ b/lib/routes/aisixiang/thinktank.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const { rootUrl, ossUrl, ProcessFeed } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, type = '' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/aisixiang/toplist.js b/lib/routes/aisixiang/toplist.js index 51a35c66125965..be9061249efc78 100644 --- a/lib/routes/aisixiang/toplist.js +++ b/lib/routes/aisixiang/toplist.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const { rootUrl, ossUrl, ProcessFeed } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id = '1', period = '1' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/aisixiang/zhuanti.js b/lib/routes/aisixiang/zhuanti.js index 774ddcd037926c..06b2206281e031 100644 --- a/lib/routes/aisixiang/zhuanti.js +++ b/lib/routes/aisixiang/zhuanti.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const { rootUrl, ossUrl, ProcessFeed } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/ajmide/index.js b/lib/routes/ajmide/index.js index a126f29432d31a..6ab15dd410ce42 100644 --- a/lib/routes/ajmide/index.js +++ b/lib/routes/ajmide/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.param('limit') ?? 25; const playListAPI = `https://a.ajmide.com/v3/getBrandContentList.php?brandId=${id}&c=${limit}&i=0`; diff --git a/lib/routes/ajmide/router.js b/lib/routes/ajmide/router.js index de87b52670c7db..c79f907ed7d0b5 100644 --- a/lib/routes/ajmide/router.js +++ b/lib/routes/ajmide/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id', './index'); }; diff --git a/lib/routes/aliresearch/information.js b/lib/routes/aliresearch/information.js index 6991430d0d9a8b..38670d543a22bf 100644 --- a/lib/routes/aliresearch/information.js +++ b/lib/routes/aliresearch/information.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? '新闻'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; diff --git a/lib/routes/aliresearch/router.js b/lib/routes/aliresearch/router.js index e8e17681b064ad..81356dd4273e8f 100644 --- a/lib/routes/aliresearch/router.js +++ b/lib/routes/aliresearch/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/information/:type?', './information'); }; diff --git a/lib/routes/alistapart/index.js b/lib/routes/alistapart/index.js index 7593674c334b33..77261f4e55d61c 100644 --- a/lib/routes/alistapart/index.js +++ b/lib/routes/alistapart/index.js @@ -1,6 +1,6 @@ const { getData, getList } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://alistapart.com'; const route = '/wp-json/wp/v2/article?_embed'; diff --git a/lib/routes/alistapart/router.js b/lib/routes/alistapart/router.js index 05683e203422eb..38d40b361348b0 100644 --- a/lib/routes/alistapart/router.js +++ b/lib/routes/alistapart/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/:topic', './topic'); }; diff --git a/lib/routes/alistapart/topic.js b/lib/routes/alistapart/topic.js index cea513802e6552..b5143104264dc1 100644 --- a/lib/routes/alistapart/topic.js +++ b/lib/routes/alistapart/topic.js @@ -1,6 +1,6 @@ const { getData, getList } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://alistapart.com'; const searchRoute = '/wp-json/wp/v2/categories?slug='; const articleRoute = '/wp-json/wp/v2/article?categories='; diff --git a/lib/routes/aliyun/database-month.js b/lib/routes/aliyun/database-month.js index 67a2331e65c9ae..bc407336ed216a 100644 --- a/lib/routes/aliyun/database-month.js +++ b/lib/routes/aliyun/database-month.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'http://mysql.taobao.org/monthly/'; const response = await got({ method: 'get', url }); const $ = load(response.data); diff --git a/lib/routes/aliyun/developer/group.js b/lib/routes/aliyun/developer/group.js index 465f86cdb2d0ae..74cb5a1500f726 100644 --- a/lib/routes/aliyun/developer/group.js +++ b/lib/routes/aliyun/developer/group.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const link = `https://developer.aliyun.com/group/${type}`; diff --git a/lib/routes/aliyun/notice.js b/lib/routes/aliyun/notice.js index 314a8eb61e2a89..73a8fdaa6e3dfb 100644 --- a/lib/routes/aliyun/notice.js +++ b/lib/routes/aliyun/notice.js @@ -16,7 +16,7 @@ const typeMap = { * * @param ctx {import('koa').Context} */ -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const url = `https://help.aliyun.com/noticelist/${typeMap[type] || typeMap[0]}.html`; const response = await got({ method: 'get', url }); diff --git a/lib/routes/aliyun/router.js b/lib/routes/aliyun/router.js index 251cbe74c33f12..a2a79c9106aa3d 100644 --- a/lib/routes/aliyun/router.js +++ b/lib/routes/aliyun/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/database_month', './database-month'); router.get('/developer/group/:type', './developer/group'); router.get('/notice/:type?', './notice'); diff --git a/lib/routes/aljazeera/index.js b/lib/routes/aljazeera/index.js index a38cdf89792fd3..965342859255dc 100644 --- a/lib/routes/aljazeera/index.js +++ b/lib/routes/aljazeera/index.js @@ -21,7 +21,7 @@ const languages = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const params = getSubPath(ctx) === '/' ? ['arabic'] : getSubPath(ctx).replace(/^\//, '').split('/'); if (!Object.hasOwn(languages, params[0])) { diff --git a/lib/routes/aljazeera/router.js b/lib/routes/aljazeera/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/aljazeera/router.js +++ b/lib/routes/aljazeera/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/ally/rail.js b/lib/routes/ally/rail.js index 518decb4d7c7d0..d1328889de6376 100644 --- a/lib/routes/ally/rail.js +++ b/lib/routes/ally/rail.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { // http://rail.ally.net.cn/sitemap.html const { category, topic } = ctx.req.param(); const rootUrl = 'http://rail.ally.net.cn'; diff --git a/lib/routes/ally/router.js b/lib/routes/ally/router.js index bb0fcab41592bc..f4ce96520ddfd2 100644 --- a/lib/routes/ally/router.js +++ b/lib/routes/ally/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/rail/:category?/:topic?', './rail'); }; diff --git a/lib/routes/alternativeto/platform.js b/lib/routes/alternativeto/platform.js index c0a6f4e42a03be..5e2de9230d83e0 100644 --- a/lib/routes/alternativeto/platform.js +++ b/lib/routes/alternativeto/platform.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; const { baseURL, puppeteerGet } = require('./utils'); import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const query = new URLSearchParams(ctx.req.param('routeParams')); const link = `https://alternativeto.net/platform/${name}/?${query.toString()}`; diff --git a/lib/routes/alternativeto/router.js b/lib/routes/alternativeto/router.js index 3a099e6f9cb35a..c834c976e3d0aa 100644 --- a/lib/routes/alternativeto/router.js +++ b/lib/routes/alternativeto/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/software/:name/:routeParams?', './software'); router.get('/platform/:name/:routeParams?', './platform'); }; diff --git a/lib/routes/alternativeto/software.js b/lib/routes/alternativeto/software.js index ff93df804e2cd0..454ddb5114ec61 100644 --- a/lib/routes/alternativeto/software.js +++ b/lib/routes/alternativeto/software.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; const { baseURL, puppeteerGet } = require('./utils'); import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const query = new URLSearchParams(ctx.req.param('routeParams')); const link = `https://alternativeto.net/software/${name}/?${query.toString()}`; diff --git a/lib/routes/amazon/awsblogs.js b/lib/routes/amazon/awsblogs.js index ea3e78a3f8aaef..6e95d15a0c62f1 100644 --- a/lib/routes/amazon/awsblogs.js +++ b/lib/routes/amazon/awsblogs.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const locale = ctx.req.param('locale') ?? 'zh_CN'; const response = await got({ diff --git a/lib/routes/amazon/kindle-software-updates.js b/lib/routes/amazon/kindle-software-updates.js index c8aab7f6920158..3daacc74c7175a 100644 --- a/lib/routes/amazon/kindle-software-updates.js +++ b/lib/routes/amazon/kindle-software-updates.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.amazon.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = host + '/gp/help/customer/display.html'; const nodeIdValue = 'GKMQC26VQQMM8XSW'; const response = await got({ diff --git a/lib/routes/amazon/router.js b/lib/routes/amazon/router.js index 8dc914a1c91977..9a3c86b5ea3c81 100644 --- a/lib/routes/amazon/router.js +++ b/lib/routes/amazon/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/awsblogs/:locale?', './awsblogs'); router.get('/kindle/software-updates', './kindle-software-updates'); }; diff --git a/lib/routes/android/platform-tools-releases.js b/lib/routes/android/platform-tools-releases.js index 806e83ca669821..1eaf72d1041e45 100644 --- a/lib/routes/android/platform-tools-releases.js +++ b/lib/routes/android/platform-tools-releases.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://developer.android.com'; const currentUrl = `${rootUrl}/studio/releases/platform-tools`; diff --git a/lib/routes/android/router.js b/lib/routes/android/router.js index 148cedc79aecbf..e732b467e51e9b 100644 --- a/lib/routes/android/router.js +++ b/lib/routes/android/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/platform-tools-releases', './platform-tools-releases'); }; diff --git a/lib/routes/annualreviews/index.js b/lib/routes/annualreviews/index.js index 3de8ec86b585c2..5a078baddae9b4 100644 --- a/lib/routes/annualreviews/index.js +++ b/lib/routes/annualreviews/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://www.annualreviews.org'; diff --git a/lib/routes/annualreviews/router.js b/lib/routes/annualreviews/router.js index de87b52670c7db..c79f907ed7d0b5 100644 --- a/lib/routes/annualreviews/router.js +++ b/lib/routes/annualreviews/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id', './index'); }; diff --git a/lib/routes/anquanke/category.js b/lib/routes/anquanke/category.js index a38fc81213e5c9..73bf773993ad2d 100644 --- a/lib/routes/anquanke/category.js +++ b/lib/routes/anquanke/category.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const api = 'https://api.anquanke.com/data/v1/posts?size=10&page=1&category='; const type = ctx.req.param('category'); const fulltext = ctx.req.param('fulltext'); diff --git a/lib/routes/anquanke/router.js b/lib/routes/anquanke/router.js index 914f67bd935485..9e83217f8c8e82 100644 --- a/lib/routes/anquanke/router.js +++ b/lib/routes/anquanke/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { // router.get('/vul', './vul'); // 404 router.get('/:category/:fulltext?', './category'); }; diff --git a/lib/routes/anquanke/vul.js b/lib/routes/anquanke/vul.js index 0f50a7a20a73a9..e77742cd5197dd 100644 --- a/lib/routes/anquanke/vul.js +++ b/lib/routes/anquanke/vul.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.anquanke.com'; const response = await got(`${url}/vul`); diff --git a/lib/routes/apache/apisix/blog.js b/lib/routes/apache/apisix/blog.js index 226be9f86588cc..6cf820db5f4007 100644 --- a/lib/routes/apache/apisix/blog.js +++ b/lib/routes/apache/apisix/blog.js @@ -22,7 +22,7 @@ async function getArticles() { }); } -module.exports = async (ctx) => { +export default async (ctx) => { const articles = await getArticles(); ctx.set('data', { title: 'Blog | Apache APISIX', diff --git a/lib/routes/apache/router.js b/lib/routes/apache/router.js index 110a1eca4d2b1d..c65672310165c4 100644 --- a/lib/routes/apache/router.js +++ b/lib/routes/apache/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/apisix/blog', './apisix/blog'); }; diff --git a/lib/routes/apiseven/blog.js b/lib/routes/apiseven/blog.js index 64c14b63313a41..503b943cce3c75 100644 --- a/lib/routes/apiseven/blog.js +++ b/lib/routes/apiseven/blog.js @@ -20,7 +20,7 @@ async function getArticles() { })); } -module.exports = async (ctx) => { +export default async (ctx) => { const articles = await getArticles(); const items = await Promise.all( articles.map((item) => diff --git a/lib/routes/apiseven/router.js b/lib/routes/apiseven/router.js index e08aa776942a77..da5910733e49ed 100644 --- a/lib/routes/apiseven/router.js +++ b/lib/routes/apiseven/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog', './blog'); }; diff --git a/lib/routes/apkpure/router.js b/lib/routes/apkpure/router.js index 8848bc2ddd890c..65271e3ce1f31c 100644 --- a/lib/routes/apkpure/router.js +++ b/lib/routes/apkpure/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/versions/:pkg/:region?', './versions'); }; diff --git a/lib/routes/apkpure/versions.js b/lib/routes/apkpure/versions.js index f9c4043c3eacc4..f1b40401b0c8a5 100644 --- a/lib/routes/apkpure/versions.js +++ b/lib/routes/apkpure/versions.js @@ -3,7 +3,7 @@ import logger from '@/utils/logger'; import { parseDate } from '@/utils/parse-date'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const { pkg, region = 'en' } = ctx.req.param(); const baseUrl = 'https://apkpure.com'; const link = `${baseUrl}/${region}/${pkg}/versions`; diff --git a/lib/routes/apnews/router.js b/lib/routes/apnews/router.js index 9659062a03cb98..5fe41a17254508 100644 --- a/lib/routes/apnews/router.js +++ b/lib/routes/apnews/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/topics/:topic?', './topics'); }; diff --git a/lib/routes/apnews/topics.js b/lib/routes/apnews/topics.js index fab93da48c89cd..81e70060774e97 100644 --- a/lib/routes/apnews/topics.js +++ b/lib/routes/apnews/topics.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; const HOME_PAGE = 'https://apnews.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { topic = 'trending-news' } = ctx.req.param(); const url = `${HOME_PAGE}/hub/${topic}`; const response = await got(url); diff --git a/lib/routes/app-center/release.js b/lib/routes/app-center/release.js index bbddfd84217494..e86ac0c41e3158 100644 --- a/lib/routes/app-center/release.js +++ b/lib/routes/app-center/release.js @@ -5,7 +5,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const MarkdownIt = require('markdown-it'); -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const app = ctx.req.param('app'); const distribution_group = ctx.req.param('distribution_group'); diff --git a/lib/routes/app-center/router.js b/lib/routes/app-center/router.js index a4f6f3eb86713f..d8dd2a29f99b32 100644 --- a/lib/routes/app-center/router.js +++ b/lib/routes/app-center/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/release/:user/:app/:distribution_group', './release'); }; diff --git a/lib/routes/apple/apps.js b/lib/routes/apple/apps.js index 73c6cb46991ae1..21587c34684872 100644 --- a/lib/routes/apple/apps.js +++ b/lib/routes/apple/apps.js @@ -14,7 +14,7 @@ const platforms = { tvos: 'appletvos', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { country, id } = ctx.req.param(); let { platform } = ctx.req.param(); diff --git a/lib/routes/apple/exchange-repair.js b/lib/routes/apple/exchange-repair.js index 331ca0c58108f6..9a3852ddcd8402 100644 --- a/lib/routes/apple/exchange-repair.js +++ b/lib/routes/apple/exchange-repair.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const host = 'https://support.apple.com/'; -module.exports = async (ctx) => { +export default async (ctx) => { const country = ctx.req.param('country') ?? ''; const link = new URL(`${country}/service-programs`, host).href; diff --git a/lib/routes/apple/router.js b/lib/routes/apple/router.js index 1005ce7d1db878..e7b5f1bd5b2db3 100644 --- a/lib/routes/apple/router.js +++ b/lib/routes/apple/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/apps/update/:country/:id/:platform?', './apps'); router.get('/exchange_repair/:country?', './exchange-repair'); }; diff --git a/lib/routes/appleinsider/index.js b/lib/routes/appleinsider/index.js index 32f0a41e0ae285..394d840011a16d 100644 --- a/lib/routes/appleinsider/index.js +++ b/lib/routes/appleinsider/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://appleinsider.com'; diff --git a/lib/routes/appleinsider/router.js b/lib/routes/appleinsider/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/appleinsider/router.js +++ b/lib/routes/appleinsider/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/appstore/in-app-purchase.js b/lib/routes/appstore/in-app-purchase.js index a74a9d218ecf67..411147141368d7 100644 --- a/lib/routes/appstore/in-app-purchase.js +++ b/lib/routes/appstore/in-app-purchase.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const url = require('url'); import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const country = ctx.req.param('country'); const id = ctx.req.param('id'); const link = `https://apps.apple.com/${country}/app/${id}`; diff --git a/lib/routes/appstore/price.js b/lib/routes/appstore/price.js index ec490cc373e6d7..518f9c4f4eeb40 100644 --- a/lib/routes/appstore/price.js +++ b/lib/routes/appstore/price.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; const currency = require('currency-symbol-map'); -module.exports = async (ctx) => { +export default async (ctx) => { const country = ctx.req.param('country'); const type = ctx.req.param('type').toLowerCase() === 'mac' ? 'macapps' : 'apps'; const id = ctx.req.param('id').replace('id', ''); diff --git a/lib/routes/appstore/router.js b/lib/routes/appstore/router.js index 37e11a1d23a074..064fca7f3ffa15 100644 --- a/lib/routes/appstore/router.js +++ b/lib/routes/appstore/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/xianmian', './xianmian'); router.get('/iap/:country/:id', './in-app-purchase'); router.get('/price/:country/:type/:id', './price'); diff --git a/lib/routes/appstore/xianmian.js b/lib/routes/appstore/xianmian.js index daa5683a261b7e..a95cfca21e0d93 100644 --- a/lib/routes/appstore/xianmian.js +++ b/lib/routes/appstore/xianmian.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: { objects: data }, } = await got.get('https://app.so/api/v5/appso/discount/?platform=web&limit=10'); diff --git a/lib/routes/aqara/community.js b/lib/routes/aqara/community.js index 79bc3ddce6e392..6a235812ef4a1f 100644 --- a/lib/routes/aqara/community.js +++ b/lib/routes/aqara/community.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const keyword = ctx.req.param('keyword') ?? ''; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 100; diff --git a/lib/routes/aqara/news.js b/lib/routes/aqara/news.js index 82591cc74bd40b..fab74cfdba5d45 100644 --- a/lib/routes/aqara/news.js +++ b/lib/routes/aqara/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 35; const rootUrl = 'https://www.aqara.cn'; diff --git a/lib/routes/aqara/post.js b/lib/routes/aqara/post.js index c1754a9d5d83a7..61efd4ce7bd694 100644 --- a/lib/routes/aqara/post.js +++ b/lib/routes/aqara/post.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; const rootUrl = 'https://aqara.com'; diff --git a/lib/routes/aqara/region.js b/lib/routes/aqara/region.js index 8fdd6be4ddde4b..5ba4f259f3e38f 100644 --- a/lib/routes/aqara/region.js +++ b/lib/routes/aqara/region.js @@ -1,4 +1,4 @@ -module.exports = (ctx) => { +export default (ctx) => { const types = { news: 'press-release', blog: 'article', diff --git a/lib/routes/aqara/router.js b/lib/routes/aqara/router.js index 57005a13e8a6ea..937bf79aed98b2 100644 --- a/lib/routes/aqara/router.js +++ b/lib/routes/aqara/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/cn/news', './news'); router.get('/community/:id?/:keyword?', './community'); router.get('/:region/:type?', './region'); diff --git a/lib/routes/arcteryx/new-arrivals.js b/lib/routes/arcteryx/new-arrivals.js index 6ab63a8cf4ea1f..172a8983ce1d9d 100644 --- a/lib/routes/arcteryx/new-arrivals.js +++ b/lib/routes/arcteryx/new-arrivals.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { generateRssData } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { country, gender } = ctx.req.param(); const host = `https://arcteryx.com/${country}/en/`; const url = `${host}api/fredhopper/query`; diff --git a/lib/routes/arcteryx/outlet.js b/lib/routes/arcteryx/outlet.js index 4c61c7c887cfa9..0ed9a4099362d5 100644 --- a/lib/routes/arcteryx/outlet.js +++ b/lib/routes/arcteryx/outlet.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { generateRssData } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { country, gender } = ctx.req.param(); const host = `https://outlet.arcteryx.com/${country}/en/`; const url = `${host}api/fredhopper/query`; diff --git a/lib/routes/arcteryx/regear-new-arrivals.js b/lib/routes/arcteryx/regear-new-arrivals.js index 27ce92539192df..bc16285988ca62 100644 --- a/lib/routes/arcteryx/regear-new-arrivals.js +++ b/lib/routes/arcteryx/regear-new-arrivals.js @@ -7,7 +7,7 @@ const host = 'https://www.regear.arcteryx.com'; function getUSDPrice(number) { return (number / 100).toLocaleString('en-US', { style: 'currency', currency: 'USD' }); } -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${host}/shop/new-arrivals`; const response = await got({ method: 'get', diff --git a/lib/routes/arcteryx/router.js b/lib/routes/arcteryx/router.js index 1dc702b63dbf5e..1fa99517d31e5a 100644 --- a/lib/routes/arcteryx/router.js +++ b/lib/routes/arcteryx/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/new-arrivals/:country/:gender', './new-arrivals'); router.get('/outlet/:country/:gender', './outlet'); router.get('/regear/new-arrivals', './regear-new-arrivals'); diff --git a/lib/routes/arknights/announce.js b/lib/routes/arknights/announce.js index 4556db14747083..286675c2b07868 100644 --- a/lib/routes/arknights/announce.js +++ b/lib/routes/arknights/announce.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { platform = 'Android', group = 'ALL' } = ctx.req.param(); let { diff --git a/lib/routes/arknights/japan.js b/lib/routes/arknights/japan.js index 3adf9a8a7e22c2..967807b85f5f6a 100644 --- a/lib/routes/arknights/japan.js +++ b/lib/routes/arknights/japan.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://www.arknights.jp:10014/news?lang=ja&limit=9&page=1', diff --git a/lib/routes/arknights/news.js b/lib/routes/arknights/news.js index 5a29dfceedbd5c..598a58cf86ff03 100644 --- a/lib/routes/arknights/news.js +++ b/lib/routes/arknights/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://ak.hypergryph.com/news.html', diff --git a/lib/routes/arknights/router.js b/lib/routes/arknights/router.js index c6175f5f118b32..cc9a72280c6a70 100644 --- a/lib/routes/arknights/router.js +++ b/lib/routes/arknights/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { // 《明日方舟》游戏内公告 router.get('/announce/:platform?/:group?', './announce'); // アークナイツ(明日方舟日服) diff --git a/lib/routes/artstation/router.js b/lib/routes/artstation/router.js index 8f8b44dc804a65..e5ba33ae4db7cf 100644 --- a/lib/routes/artstation/router.js +++ b/lib/routes/artstation/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:handle', './user'); }; diff --git a/lib/routes/artstation/user.js b/lib/routes/artstation/user.js index 3f98fd793a9b9c..7ce33495ff3cc4 100644 --- a/lib/routes/artstation/user.js +++ b/lib/routes/artstation/user.js @@ -5,7 +5,7 @@ import * as path from 'node:path'; import { art } from '@/utils/render'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const handle = ctx.req.param('handle'); const headers = { diff --git a/lib/routes/asiantolick/index.js b/lib/routes/asiantolick/index.js index 7d71f0176defef..d34e36e21c2940 100644 --- a/lib/routes/asiantolick/index.js +++ b/lib/routes/asiantolick/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 24; diff --git a/lib/routes/asiantolick/router.js b/lib/routes/asiantolick/router.js index 5c89b519009bee..cffd8f2def5c8c 100644 --- a/lib/routes/asiantolick/router.js +++ b/lib/routes/asiantolick/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category*', './'); }; diff --git a/lib/routes/asus/bios.js b/lib/routes/asus/bios.js index 50ffdfa21a55a0..bcbc1d3e4ff72a 100644 --- a/lib/routes/asus/bios.js +++ b/lib/routes/asus/bios.js @@ -13,7 +13,7 @@ const getProductID = async (model) => { }; }; -module.exports = async (ctx) => { +export default async (ctx) => { const model = ctx.req.param('model'); const { productID, url } = await getProductID(model); const biosAPI = `https://www.asus.com.cn/support/api/product.asmx/GetPDBIOS?website=cn&model=${model}&pdid=${productID}&sitelang=cn`; diff --git a/lib/routes/asus/gpu-tweak.js b/lib/routes/asus/gpu-tweak.js index a2568f8c7f937a..cb3d3d2617cfff 100644 --- a/lib/routes/asus/gpu-tweak.js +++ b/lib/routes/asus/gpu-tweak.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const pageUrl = 'https://www.asus.com/campaign/GPU-Tweak-III/tw/index.php'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(pageUrl); const $ = load(response.data); diff --git a/lib/routes/asus/router.js b/lib/routes/asus/router.js index 1de580e27f7407..d809f736208b2a 100644 --- a/lib/routes/asus/router.js +++ b/lib/routes/asus/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/bios/:model', './bios'); router.get('/gpu-tweak', './gpu-tweak'); }; diff --git a/lib/routes/atcoder/contest.js b/lib/routes/atcoder/contest.js index b5787856fc4177..03247a4c94f182 100644 --- a/lib/routes/atcoder/contest.js +++ b/lib/routes/atcoder/contest.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const status = ['action', 'upcoming', 'recent']; const language = ctx.req.param('language') ?? 'en'; diff --git a/lib/routes/atcoder/post.js b/lib/routes/atcoder/post.js index 615046bbe8a5ea..c735a53ff4a736 100644 --- a/lib/routes/atcoder/post.js +++ b/lib/routes/atcoder/post.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? 'en'; const keyword = ctx.req.param('keyword') ?? ''; diff --git a/lib/routes/atcoder/router.js b/lib/routes/atcoder/router.js index e0743132156482..69bede3cdc17d9 100644 --- a/lib/routes/atcoder/router.js +++ b/lib/routes/atcoder/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/post/:language?/:keyword?', './post'); router.get('/contest/:language?/:rated?/:category?/:keyword?', './contest'); }; diff --git a/lib/routes/auto-stats/index.js b/lib/routes/auto-stats/index.js index 8460fefce23786..edd7e1d8ce08f9 100644 --- a/lib/routes/auto-stats/index.js +++ b/lib/routes/auto-stats/index.js @@ -5,7 +5,7 @@ const iconv = require('iconv-lite'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'xxkd' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/auto-stats/router.js b/lib/routes/auto-stats/router.js index b610024188e52a..74ed533fca356e 100644 --- a/lib/routes/auto-stats/router.js +++ b/lib/routes/auto-stats/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './'); }; diff --git a/lib/routes/baai/comments.js b/lib/routes/baai/comments.js index 5fb17c70c688cf..2f3385d8bfc893 100644 --- a/lib/routes/baai/comments.js +++ b/lib/routes/baai/comments.js @@ -4,7 +4,7 @@ import timezone from '@/utils/timezone'; const { baseUrl, apiHost } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const responses = await got.all( Array.from( { diff --git a/lib/routes/baai/events.js b/lib/routes/baai/events.js index 9be0c05f65b7d9..46ea4ecbd090e9 100644 --- a/lib/routes/baai/events.js +++ b/lib/routes/baai/events.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { baseUrl, apiHost, parseEventDetail, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const responses = await got.all( Array.from( { diff --git a/lib/routes/baai/hub.js b/lib/routes/baai/hub.js index ccaa078f35c541..b62d2c745868b7 100644 --- a/lib/routes/baai/hub.js +++ b/lib/routes/baai/hub.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const { baseUrl, apiHost, parseEventDetail, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { tagId, sort = 'new', range } = ctx.req.param(); let title, description, brief, iconUrl; diff --git a/lib/routes/baai/router.js b/lib/routes/baai/router.js index 0a5c4a54822254..e8565078a1f2aa 100644 --- a/lib/routes/baai/router.js +++ b/lib/routes/baai/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/hub/comments', './comments'); router.get('/hub/events', './events'); router.get('/hub/:tagId/:sort?/:range?', './hub'); diff --git a/lib/routes/backlinko/blog.js b/lib/routes/backlinko/blog.js index 2b72efcb27e831..ef5edfbde0ce65 100644 --- a/lib/routes/backlinko/blog.js +++ b/lib/routes/backlinko/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://backlinko.com'; const { data: response, url: link } = await got(`${baseUrl}/blog`); diff --git a/lib/routes/backlinko/router.js b/lib/routes/backlinko/router.js index e08aa776942a77..da5910733e49ed 100644 --- a/lib/routes/backlinko/router.js +++ b/lib/routes/backlinko/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog', './blog'); }; diff --git a/lib/routes/bad/index.js b/lib/routes/bad/index.js index 1fa1adef8cb5a7..9455156ceb5890 100644 --- a/lib/routes/bad/index.js +++ b/lib/routes/bad/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://bad.news'; const currentUrl = `${rootUrl}${getSubPath(ctx) === '/' ? '' : getSubPath(ctx)}`; diff --git a/lib/routes/bad/router.js b/lib/routes/bad/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/bad/router.js +++ b/lib/routes/bad/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/baidu/gushitong/index.js b/lib/routes/baidu/gushitong/index.js index aceb3acec632c4..ee43f352f83911 100644 --- a/lib/routes/baidu/gushitong/index.js +++ b/lib/routes/baidu/gushitong/index.js @@ -7,7 +7,7 @@ const STATUS_MAP = { down: '下跌', }; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://finance.pae.baidu.com/api/indexbanner?market=ab&finClientType=pc'); const item = response.data.Result.map((e) => ({ title: e.name, diff --git a/lib/routes/baidu/router.js b/lib/routes/baidu/router.js index fa990c286d7760..32a2038816d4e4 100644 --- a/lib/routes/baidu/router.js +++ b/lib/routes/baidu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/gushitong/index', './gushitong'); router.get('/search/:keyword', './search'); router.get('/tieba/forum/good/:kw/:cid?/:sortBy?', './tieba/forum'); diff --git a/lib/routes/baidu/search.js b/lib/routes/baidu/search.js index 6ae5b41901ca35..247f6b2f3512f4 100644 --- a/lib/routes/baidu/search.js +++ b/lib/routes/baidu/search.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; const renderDescription = (description, images) => art(path.join(__dirname, './templates/description.art'), { description, images }); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const url = `https://www.baidu.com/s?wd=${encodeURIComponent(keyword)}`; const key = `baidu-search:${url}`; diff --git a/lib/routes/baidu/tieba/forum.js b/lib/routes/baidu/tieba/forum.js index c254fc310c6178..a41c9d35c65fc7 100644 --- a/lib/routes/baidu/tieba/forum.js +++ b/lib/routes/baidu/tieba/forum.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { // sortBy: created, replied const { kw, cid = '0', sortBy = 'created' } = ctx.req.param(); diff --git a/lib/routes/baidu/tieba/post.js b/lib/routes/baidu/tieba/post.js index 94409d83fe1683..de3af370b61e13 100644 --- a/lib/routes/baidu/tieba/post.js +++ b/lib/routes/baidu/tieba/post.js @@ -28,7 +28,7 @@ async function getPost(id, lz = 0, pn = 7e6) { return data; } -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const lz = ctx._matchedRoute.includes('lz') ? 1 : 0; const html = await getPost(id, lz); diff --git a/lib/routes/baidu/tieba/search.js b/lib/routes/baidu/tieba/search.js index 0dc037fa704b17..a85005362d4aba 100644 --- a/lib/routes/baidu/tieba/search.js +++ b/lib/routes/baidu/tieba/search.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const qw = ctx.req.param('qw'); const query = new URLSearchParams(ctx.req.param('routeParams')); query.set('ie', 'utf-8'); diff --git a/lib/routes/baidu/tieba/user.js b/lib/routes/baidu/tieba/user.js index 484f01c0660523..3df50f2561a708 100644 --- a/lib/routes/baidu/tieba/user.js +++ b/lib/routes/baidu/tieba/user.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const response = await got(`https://tieba.baidu.com/home/main?un=${uid}`); diff --git a/lib/routes/baidu/top.js b/lib/routes/baidu/top.js index 3398e32355e47e..3cf2461d751100 100644 --- a/lib/routes/baidu/top.js +++ b/lib/routes/baidu/top.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { board = 'realtime' } = ctx.req.param(); const link = `https://top.baidu.com/board?tab=${board}`; const { data: response } = await got(link); diff --git a/lib/routes/bandcamp/live.js b/lib/routes/bandcamp/live.js index 039df6b9e300cf..1179f9e602143d 100644 --- a/lib/routes/bandcamp/live.js +++ b/lib/routes/bandcamp/live.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://bandcamp.com'; const currentUrl = `${rootUrl}/live_schedule`; const response = await got({ diff --git a/lib/routes/bandcamp/router.js b/lib/routes/bandcamp/router.js index efe29739d3a065..129888253bb714 100644 --- a/lib/routes/bandcamp/router.js +++ b/lib/routes/bandcamp/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/tag/:tag?', './tag'); router.get('/live', './live'); router.get('/weekly', './weekly'); diff --git a/lib/routes/bandcamp/tag.js b/lib/routes/bandcamp/tag.js index 6d001c8f1140da..efbd73d361aacb 100644 --- a/lib/routes/bandcamp/tag.js +++ b/lib/routes/bandcamp/tag.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const rootUrl = 'https://bandcamp.com'; diff --git a/lib/routes/bandcamp/weekly.js b/lib/routes/bandcamp/weekly.js index 17f620077599e5..18023044a11598 100644 --- a/lib/routes/bandcamp/weekly.js +++ b/lib/routes/bandcamp/weekly.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://bandcamp.com'; const apiUrl = `${rootUrl}/api/bcweekly/3/list`; const response = await got({ diff --git a/lib/routes/bangumi/moe/index.js b/lib/routes/bangumi/moe/index.js index 9de661b18ff7ea..33b5e931de0cb0 100644 --- a/lib/routes/bangumi/moe/index.js +++ b/lib/routes/bangumi/moe/index.js @@ -3,7 +3,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const isLatest = getSubPath(ctx) === '/moe'; const rootUrl = 'https://bangumi.moe'; diff --git a/lib/routes/bangumi/online/online.js b/lib/routes/bangumi/online/online.js index c5db847a9c5fd1..6c8929ce8e3fbc 100644 --- a/lib/routes/bangumi/online/online.js +++ b/lib/routes/bangumi/online/online.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://api.bangumi.online/serve/home'; const response = await got.post(url); diff --git a/lib/routes/bangumi/router.js b/lib/routes/bangumi/router.js index d82f111268cba9..52a0b8a5cd08f7 100644 --- a/lib/routes/bangumi/router.js +++ b/lib/routes/bangumi/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { // bangumi.moe router.get('/moe/*', './moe/index'); // bangumi.online diff --git a/lib/routes/bangumi/tv/calendar/today.js b/lib/routes/bangumi/tv/calendar/today.js index 733c1313afcfea..fb92b7a2ebd375 100644 --- a/lib/routes/bangumi/tv/calendar/today.js +++ b/lib/routes/bangumi/tv/calendar/today.js @@ -3,7 +3,7 @@ const getData = require('./_base'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const [list, data] = await getData(cache.tryGet); const siteMeta = data.siteMeta; diff --git a/lib/routes/bangumi/tv/group/reply.js b/lib/routes/bangumi/tv/group/reply.js index 956a6468ed6d92..bf1d8a41aa33de 100644 --- a/lib/routes/bangumi/tv/group/reply.js +++ b/lib/routes/bangumi/tv/group/reply.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { // bangumi.tv未提供获取小组话题的API,因此仍需要通过抓取网页来获取 const topicID = ctx.req.param('id'); const link = `https://bgm.tv/group/topic/${topicID}`; diff --git a/lib/routes/bangumi/tv/group/topic.js b/lib/routes/bangumi/tv/group/topic.js index 2174a80e9e94d7..65ff3981771b0b 100644 --- a/lib/routes/bangumi/tv/group/topic.js +++ b/lib/routes/bangumi/tv/group/topic.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const base_url = 'https://bgm.tv'; -module.exports = async (ctx) => { +export default async (ctx) => { const groupID = ctx.req.param('id'); const link = `${base_url}/group/${groupID}/forum`; const { data: html } = await got(link); diff --git a/lib/routes/bangumi/tv/other/followrank.js b/lib/routes/bangumi/tv/other/followrank.js index b8440f91bec06c..a7268fca0da29d 100644 --- a/lib/routes/bangumi/tv/other/followrank.js +++ b/lib/routes/bangumi/tv/other/followrank.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://bgm.tv/anime'; const response = await got({ url, diff --git a/lib/routes/bangumi/tv/person/index.js b/lib/routes/bangumi/tv/person/index.js index 9c918fce991780..b81da07d65c957 100644 --- a/lib/routes/bangumi/tv/person/index.js +++ b/lib/routes/bangumi/tv/person/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { // bangumi.tv未提供获取“人物信息”的API,因此仍需要通过抓取网页来获取 const personID = ctx.req.param('id'); const link = `https://bgm.tv/person/${personID}/works?sort=date`; diff --git a/lib/routes/bangumi/tv/subject/index.js b/lib/routes/bangumi/tv/subject/index.js index 906bf1ffb77dfc..7289a292b2bffa 100644 --- a/lib/routes/bangumi/tv/subject/index.js +++ b/lib/routes/bangumi/tv/subject/index.js @@ -3,7 +3,7 @@ const getFromAPI = require('./offcial-subject-api.js'); const getEps = require('./ep.js'); import { queryToBoolean } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const type = ctx.req.param('type') || 'ep'; const showOriginalName = queryToBoolean(ctx.req.param('showOriginalName')); diff --git a/lib/routes/bangumi/tv/user/blog.js b/lib/routes/bangumi/tv/user/blog.js index ae29d29a2c9718..412ad9e8eb539e 100644 --- a/lib/routes/bangumi/tv/user/blog.js +++ b/lib/routes/bangumi/tv/user/blog.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `https://bgm.tv/user/${ctx.req.param('id')}/blog`; const response = await got({ method: 'get', diff --git a/lib/routes/bangumi/tv/user/wish.js b/lib/routes/bangumi/tv/user/wish.js index 573f84aced5faa..06aaaa45a11b44 100644 --- a/lib/routes/bangumi/tv/user/wish.js +++ b/lib/routes/bangumi/tv/user/wish.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const userid = ctx.req.param('id'); const url = `https://bgm.tv/anime/list/${userid}/wish`; const response = await got({ diff --git a/lib/routes/baozimh/index.js b/lib/routes/baozimh/index.js index ab3025d9208515..ac92dc0a5d430b 100644 --- a/lib/routes/baozimh/index.js +++ b/lib/routes/baozimh/index.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; const rootUrl = 'https://www.baozimh.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const url = `${rootUrl}/comic/${name}`; diff --git a/lib/routes/baozimh/router.js b/lib/routes/baozimh/router.js index 91d024751b5ff2..805c4ae71d8099 100644 --- a/lib/routes/baozimh/router.js +++ b/lib/routes/baozimh/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/comic/:name', './index'); }; diff --git a/lib/routes/barronschina/index.js b/lib/routes/barronschina/index.js index 49374ae089c5f3..81a6f908c8bca7 100644 --- a/lib/routes/barronschina/index.js +++ b/lib/routes/barronschina/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const rootUrl = 'http://www.barronschina.com.cn'; diff --git a/lib/routes/barronschina/router.js b/lib/routes/barronschina/router.js index c34676efd9b9eb..28cef7111ec14a 100644 --- a/lib/routes/barronschina/router.js +++ b/lib/routes/barronschina/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id?', './index'); }; diff --git a/lib/routes/bast/index.js b/lib/routes/bast/index.js index 93b2e3e2bc80e7..4645460cd11423 100644 --- a/lib/routes/bast/index.js +++ b/lib/routes/bast/index.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const colPath = getSubPath(ctx).replace(/^\//, '') || '32942'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; diff --git a/lib/routes/bast/router.js b/lib/routes/bast/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/bast/router.js +++ b/lib/routes/bast/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/bbc/index.js b/lib/routes/bbc/index.js index a7d48a52b4855f..cb71539b4e7efd 100644 --- a/lib/routes/bbc/index.js +++ b/lib/routes/bbc/index.js @@ -4,7 +4,7 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { let feed, title, link; // 为了向下兼容,这里 site 对应的是中文网文档中的 lang,英文网文档中的 channel diff --git a/lib/routes/bbc/router.js b/lib/routes/bbc/router.js index 2b4adfb5d12d6d..8f6a333a5eea59 100644 --- a/lib/routes/bbc/router.js +++ b/lib/routes/bbc/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:site?/:channel?', './index'); }; diff --git a/lib/routes/bbcnewslabs/news.js b/lib/routes/bbcnewslabs/news.js index ecef0ffbf35211..9eda004602bb46 100644 --- a/lib/routes/bbcnewslabs/news.js +++ b/lib/routes/bbcnewslabs/news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://bbcnewslabs.co.uk'; const response = await got({ method: 'get', diff --git a/lib/routes/bbcnewslabs/router.js b/lib/routes/bbcnewslabs/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/bbcnewslabs/router.js +++ b/lib/routes/bbcnewslabs/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/bdys/index.js b/lib/routes/bdys/index.js index 8c4df68fbda586..44279692118fef 100644 --- a/lib/routes/bdys/index.js +++ b/lib/routes/bdys/index.js @@ -11,7 +11,7 @@ import { config } from '@/config'; // Visit https://www.bdys.me for the list of domains const allowDomains = new Set(['52bdys.com', 'bde4.icu', 'bdys01.com']); -module.exports = async (ctx) => { +export default async (ctx) => { const caty = ctx.req.param('caty') || 'all'; const type = ctx.req.param('type') || 'all'; const area = ctx.req.param('area') || 'all'; diff --git a/lib/routes/bdys/router.js b/lib/routes/bdys/router.js index af8cb3304b2d29..320452cf000473 100644 --- a/lib/routes/bdys/router.js +++ b/lib/routes/bdys/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:caty?/:type?/:area?/:year?/:order?', './index'); }; diff --git a/lib/routes/behance/router.js b/lib/routes/behance/router.js index 8234f3a361b448..831b60dc3c6e4d 100644 --- a/lib/routes/behance/router.js +++ b/lib/routes/behance/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:user/:type?', './user'); }; diff --git a/lib/routes/behance/user.js b/lib/routes/behance/user.js index e22abbf5c87b3a..2e367b46ca3aac 100644 --- a/lib/routes/behance/user.js +++ b/lib/routes/behance/user.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user') ?? ''; const type = ctx.req.param('type') ?? 'projects'; diff --git a/lib/routes/bellroy/new-releases.js b/lib/routes/bellroy/new-releases.js index 3ec8d9076721c3..3b8e372aeb5a14 100644 --- a/lib/routes/bellroy/new-releases.js +++ b/lib/routes/bellroy/new-releases.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://bellroy.com'; const url = 'https://production.products.boobook-services.com/products'; const response = await got({ diff --git a/lib/routes/bellroy/router.js b/lib/routes/bellroy/router.js index b2ce5631af293e..bff3ebf2917537 100644 --- a/lib/routes/bellroy/router.js +++ b/lib/routes/bellroy/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/new-releases', './new-releases'); }; diff --git a/lib/routes/bendibao/news.js b/lib/routes/bendibao/news.js index 99fe5f817509b6..11608fd668ced4 100644 --- a/lib/routes/bendibao/news.js +++ b/lib/routes/bendibao/news.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const city = ctx.req.param('city'); if (!isValidHost(city)) { throw new Error('Invalid city'); diff --git a/lib/routes/bendibao/router.js b/lib/routes/bendibao/router.js index 6ec2c5ed9b929c..b9fc4def173b66 100644 --- a/lib/routes/bendibao/router.js +++ b/lib/routes/bendibao/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:city', './news'); }; diff --git a/lib/routes/bgmlist/onair.js b/lib/routes/bgmlist/onair.js index 28d786c13d6406..4bfe406d361962 100644 --- a/lib/routes/bgmlist/onair.js +++ b/lib/routes/bgmlist/onair.js @@ -3,7 +3,7 @@ import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -module.exports = async (ctx) => { +export default async (ctx) => { const lang = ctx.req.param('lang'); const { data: sites } = await got('https://bgmlist.com/api/v1/bangumi/site'); const { data } = await got('https://bgmlist.com/api/v1/bangumi/onair'); diff --git a/lib/routes/bgmlist/router.js b/lib/routes/bgmlist/router.js index f710875706a872..f6ac19a0d306d6 100644 --- a/lib/routes/bgmlist/router.js +++ b/lib/routes/bgmlist/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/onair/:lang?', './onair'); }; diff --git a/lib/routes/bigquant/collections.js b/lib/routes/bigquant/collections.js index c6677074e48d2f..e8f740afd8e3f3 100644 --- a/lib/routes/bigquant/collections.js +++ b/lib/routes/bigquant/collections.js @@ -4,7 +4,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://bigquant.com'; const currentUrl = `${rootUrl}/wiki/api/documents.list`; diff --git a/lib/routes/bigquant/router.js b/lib/routes/bigquant/router.js index 9256677c5b9cce..80d64c6b3ce794 100644 --- a/lib/routes/bigquant/router.js +++ b/lib/routes/bigquant/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/collections', './collections'); }; diff --git a/lib/routes/bilibili/app.js b/lib/routes/bilibili/app.js index 34335379b2b5fb..35b388dddbc0a3 100644 --- a/lib/routes/bilibili/app.js +++ b/lib/routes/bilibili/app.js @@ -8,7 +8,7 @@ const config = { android_tv_yst: 'TV 版', }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') || 'android'; const rootUrl = 'https://app.bilibili.com'; diff --git a/lib/routes/bilibili/article.js b/lib/routes/bilibili/article.js index 372f6c4acf9868..4725be4648a9ee 100644 --- a/lib/routes/bilibili/article.js +++ b/lib/routes/bilibili/article.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const cache = require('./cache'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const name = await cache.getUsernameFromUID(ctx, uid); const response = await got({ diff --git a/lib/routes/bilibili/audio.js b/lib/routes/bilibili/audio.js index f46d5dd9d0ce05..62b67c2d666dd4 100644 --- a/lib/routes/bilibili/audio.js +++ b/lib/routes/bilibili/audio.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const audio = 'https://www.bilibili.com/audio/au'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = Number.parseInt(ctx.req.param('id')); const link = `https://www.bilibili.com/audio/am${id}`; diff --git a/lib/routes/bilibili/bangumi.js b/lib/routes/bilibili/bangumi.js index 49af37fc5645e9..deabec6a12a318 100644 --- a/lib/routes/bilibili/bangumi.js +++ b/lib/routes/bilibili/bangumi.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { let seasonid = ctx.req.param('seasonid'); const mediaid = ctx.req.param('mediaid'); diff --git a/lib/routes/bilibili/coin.js b/lib/routes/bilibili/coin.js index 454419ca03db24..9656326023b861 100644 --- a/lib/routes/bilibili/coin.js +++ b/lib/routes/bilibili/coin.js @@ -3,7 +3,7 @@ const cache = require('./cache'); const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const disableEmbed = ctx.req.param('disableEmbed'); diff --git a/lib/routes/bilibili/danmaku.js b/lib/routes/bilibili/danmaku.js index 2f7223b4f32570..b782b028cc2c13 100644 --- a/lib/routes/bilibili/danmaku.js +++ b/lib/routes/bilibili/danmaku.js @@ -11,7 +11,7 @@ const processFloatTime = (time) => { return `${hours}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`; }; -module.exports = async (ctx) => { +export default async (ctx) => { let bvid = ctx.req.param('bvid'); let aid; if (!bvid.startsWith('BV')) { diff --git a/lib/routes/bilibili/dynamic.js b/lib/routes/bilibili/dynamic.js index 60963e0e35449f..6802f15ac82b3a 100644 --- a/lib/routes/bilibili/dynamic.js +++ b/lib/routes/bilibili/dynamic.js @@ -67,7 +67,7 @@ const cacheIn = require('./cache'); - cover 直播间封面 */ -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const routeParams = Object.fromEntries(new URLSearchParams(ctx.req.param('routeParams'))); const showEmoji = fallback(undefined, queryToBoolean(routeParams.showEmoji), false); diff --git a/lib/routes/bilibili/fav.js b/lib/routes/bilibili/fav.js index dbdcc51268a4c7..32b6f523be4cc0 100644 --- a/lib/routes/bilibili/fav.js +++ b/lib/routes/bilibili/fav.js @@ -3,7 +3,7 @@ const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const fid = ctx.req.param('fid'); const uid = ctx.req.param('uid'); const disableEmbed = ctx.req.param('disableEmbed'); diff --git a/lib/routes/bilibili/followers.js b/lib/routes/bilibili/followers.js index 7b84873c69f26c..698c8e8597dbcb 100644 --- a/lib/routes/bilibili/followers.js +++ b/lib/routes/bilibili/followers.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const cache = require('./cache'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const loginUid = ctx.req.param('loginUid'); diff --git a/lib/routes/bilibili/followings-article.js b/lib/routes/bilibili/followings-article.js index 142a5bdfeb6b9f..b34b59cf96d0c5 100644 --- a/lib/routes/bilibili/followings-article.js +++ b/lib/routes/bilibili/followings-article.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const cache = require('./cache'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = String(ctx.req.param('uid')); const name = await cache.getUsernameFromUID(ctx, uid); diff --git a/lib/routes/bilibili/followings-dynamic.js b/lib/routes/bilibili/followings-dynamic.js index 2dfa7cd48603a9..cc115c3dbc0b38 100644 --- a/lib/routes/bilibili/followings-dynamic.js +++ b/lib/routes/bilibili/followings-dynamic.js @@ -6,7 +6,7 @@ const JSONbig = require('json-bigint'); import { fallback, queryToBoolean } from '@/utils/readable-social'; const querystring = require('querystring'); -module.exports = async (ctx) => { +export default async (ctx) => { const uid = String(ctx.req.param('uid')); const routeParams = querystring.parse(ctx.req.param('routeParams')); diff --git a/lib/routes/bilibili/followings-video.js b/lib/routes/bilibili/followings-video.js index 57c6357b79ffc9..99051037c204dd 100644 --- a/lib/routes/bilibili/followings-video.js +++ b/lib/routes/bilibili/followings-video.js @@ -3,7 +3,7 @@ const cache = require('./cache'); import { config } from '@/config'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const uid = String(ctx.req.param('uid')); const disableEmbed = ctx.req.param('disableEmbed'); const name = await cache.getUsernameFromUID(ctx, uid); diff --git a/lib/routes/bilibili/followings.js b/lib/routes/bilibili/followings.js index d93291113dfb81..89bd6c4d118baf 100644 --- a/lib/routes/bilibili/followings.js +++ b/lib/routes/bilibili/followings.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const cache = require('./cache'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const loginUid = ctx.req.param('loginUid'); const cookie = config.bilibili.cookies[loginUid]; if (cookie === undefined) { diff --git a/lib/routes/bilibili/hot-search.js b/lib/routes/bilibili/hot-search.js index 640bd3594c057a..5818f4028b1b76 100644 --- a/lib/routes/bilibili/hot-search.js +++ b/lib/routes/bilibili/hot-search.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const cache = require('./cache'); const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const wbiVerifyString = await cache.getWbiVerifyString(ctx); const params = utils.addWbiVerifyInfo('limit=10&platform=web', wbiVerifyString); const url = `https://api.bilibili.com/x/web-interface/wbi/search/square?${params}`; diff --git a/lib/routes/bilibili/link-news.js b/lib/routes/bilibili/link-news.js index 7e95fbb58a46cc..1d02e87f6e9f54 100644 --- a/lib/routes/bilibili/link-news.js +++ b/lib/routes/bilibili/link-news.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const product = ctx.req.param('product'); let productTitle = ''; diff --git a/lib/routes/bilibili/live-area.js b/lib/routes/bilibili/live-area.js index ac68314bed7c49..0a3311ffd66337 100644 --- a/lib/routes/bilibili/live-area.js +++ b/lib/routes/bilibili/live-area.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const areaID = ctx.req.param('areaID'); const order = ctx.req.param('order'); diff --git a/lib/routes/bilibili/live-room.js b/lib/routes/bilibili/live-room.js index 915c8d99964dc6..40337aacdee393 100644 --- a/lib/routes/bilibili/live-room.js +++ b/lib/routes/bilibili/live-room.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const cache = require('./cache'); -module.exports = async (ctx) => { +export default async (ctx) => { let roomID = ctx.req.param('roomID'); // 短号查询长号 diff --git a/lib/routes/bilibili/live-search.js b/lib/routes/bilibili/live-search.js index 6321f652384339..cd9b223b201bbb 100644 --- a/lib/routes/bilibili/live-search.js +++ b/lib/routes/bilibili/live-search.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const utils = require('./utils'); const cache = require('./cache'); -module.exports = async (ctx) => { +export default async (ctx) => { const key = ctx.req.param('key'); const order = ctx.req.param('order'); diff --git a/lib/routes/bilibili/mall-ip.js b/lib/routes/bilibili/mall-ip.js index 45b1e984ae7f25..60bf7f11755372 100644 --- a/lib/routes/bilibili/mall-ip.js +++ b/lib/routes/bilibili/mall-ip.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const detail = await got({ diff --git a/lib/routes/bilibili/mall-new.js b/lib/routes/bilibili/mall-new.js index 230ed09e8679ba..80b1abac61f469 100644 --- a/lib/routes/bilibili/mall-new.js +++ b/lib/routes/bilibili/mall-new.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || 0; const response = await got({ diff --git a/lib/routes/bilibili/manga-followings.js b/lib/routes/bilibili/manga-followings.js index a01cf9134132dc..06c415d001e94a 100644 --- a/lib/routes/bilibili/manga-followings.js +++ b/lib/routes/bilibili/manga-followings.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const cache = require('./cache'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = String(ctx.req.param('uid')); const name = await cache.getUsernameFromUID(ctx, uid); diff --git a/lib/routes/bilibili/manga-update.js b/lib/routes/bilibili/manga-update.js index c4941bd052f5dc..155ce7373e5270 100644 --- a/lib/routes/bilibili/manga-update.js +++ b/lib/routes/bilibili/manga-update.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const comic_id = ctx.req.param('comicid').startsWith('mc') ? ctx.req.param('comicid').replace('mc', '') : ctx.req.param('comicid'); const link = `https://manga.bilibili.com/detail/mc${comic_id}`; diff --git a/lib/routes/bilibili/page.js b/lib/routes/bilibili/page.js index 3fc1ba889c3f5f..125a73556f92c5 100644 --- a/lib/routes/bilibili/page.js +++ b/lib/routes/bilibili/page.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { let bvid = ctx.req.param('bvid'); let aid; if (!bvid.startsWith('BV')) { diff --git a/lib/routes/bilibili/partion-ranking.js b/lib/routes/bilibili/partion-ranking.js index 8b6f22086042ce..0b3aaac351f083 100644 --- a/lib/routes/bilibili/partion-ranking.js +++ b/lib/routes/bilibili/partion-ranking.js @@ -14,7 +14,7 @@ function formatDate(now) { return dateTime; } -module.exports = async (ctx) => { +export default async (ctx) => { const tid = ctx.req.param('tid'); const days = ctx.req.param('days') ?? 7; const disableEmbed = ctx.req.param('disableEmbed'); diff --git a/lib/routes/bilibili/partion.js b/lib/routes/bilibili/partion.js index 540902a76c9c55..29fccf31497aca 100644 --- a/lib/routes/bilibili/partion.js +++ b/lib/routes/bilibili/partion.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const tid = ctx.req.param('tid'); const disableEmbed = ctx.req.param('disableEmbed'); diff --git a/lib/routes/bilibili/platform.js b/lib/routes/bilibili/platform.js index 537a858d72db45..12148bb018a68d 100644 --- a/lib/routes/bilibili/platform.js +++ b/lib/routes/bilibili/platform.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const { area = -1, type = '全部类型', uid } = ctx.req.param(); const cookie = config.bilibili.cookies[uid]; const link = 'https://show.bilibili.com/api/ticket/project/listV2'; diff --git a/lib/routes/bilibili/popular.js b/lib/routes/bilibili/popular.js index 67f66c48d27bcc..726c31b6ffd073 100644 --- a/lib/routes/bilibili/popular.js +++ b/lib/routes/bilibili/popular.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const disableEmbed = ctx.req.param('disableEmbed'); const response = await got({ method: 'get', diff --git a/lib/routes/bilibili/ranking.js b/lib/routes/bilibili/ranking.js index 4c4bc259a60fb7..e5c23e7980a237 100644 --- a/lib/routes/bilibili/ranking.js +++ b/lib/routes/bilibili/ranking.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const rid = ctx.req.param('rid') || '0'; const day = ctx.req.param('day') || '3'; const arc_type = ctx.req.param('arc_type') || '1'; diff --git a/lib/routes/bilibili/readlist.js b/lib/routes/bilibili/readlist.js index d1daf11e8d817d..bab0a5bad35f22 100644 --- a/lib/routes/bilibili/readlist.js +++ b/lib/routes/bilibili/readlist.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const listid = ctx.req.param('listid'); const listurl = `https://www.bilibili.com/read/readlist/rl${listid}`; diff --git a/lib/routes/bilibili/reply.js b/lib/routes/bilibili/reply.js index 67412cf41a80bb..5574d0da6f99d3 100644 --- a/lib/routes/bilibili/reply.js +++ b/lib/routes/bilibili/reply.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const cache = require('./cache'); -module.exports = async (ctx) => { +export default async (ctx) => { let bvid = ctx.req.param('bvid'); let aid; if (!bvid.startsWith('BV')) { diff --git a/lib/routes/bilibili/router.js b/lib/routes/bilibili/router.js index 343f664a183527..739d7fa2ea2217 100644 --- a/lib/routes/bilibili/router.js +++ b/lib/routes/bilibili/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/app/:id?', './app'); router.get('/audio/:id', './audio'); router.get('/bangumi/:seasonid', './bangumi'); // 弃用 diff --git a/lib/routes/bilibili/user-bangumi.js b/lib/routes/bilibili/user-bangumi.js index c4eca69bc83d09..168e4ab5d51429 100644 --- a/lib/routes/bilibili/user-bangumi.js +++ b/lib/routes/bilibili/user-bangumi.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const cache = require('./cache'); -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const type = Number(ctx.req.param('type') || 1); const type_name = ((t) => ['', 'bangumi', 'cinema'][t])(type); diff --git a/lib/routes/bilibili/user-channel.js b/lib/routes/bilibili/user-channel.js index 67350a60b37365..eb240417ce026f 100644 --- a/lib/routes/bilibili/user-channel.js +++ b/lib/routes/bilibili/user-channel.js @@ -8,7 +8,7 @@ const notFoundData = { title: '此 bilibili 频道不存在', }; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = Number.parseInt(ctx.req.param('uid')); const sid = Number.parseInt(ctx.req.param('sid')); const disableEmbed = ctx.req.param('disableEmbed'); diff --git a/lib/routes/bilibili/user-collection.js b/lib/routes/bilibili/user-collection.js index f004d0b43cd70b..3c307bcf815e20 100644 --- a/lib/routes/bilibili/user-collection.js +++ b/lib/routes/bilibili/user-collection.js @@ -7,7 +7,7 @@ const notFoundData = { title: '此 bilibili 频道不存在', }; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = Number.parseInt(ctx.req.param('uid')); const sid = Number.parseInt(ctx.req.param('sid')); const disableEmbed = ctx.req.param('disableEmbed'); diff --git a/lib/routes/bilibili/user-fav.js b/lib/routes/bilibili/user-fav.js index de2ecfc11db28d..4a03702173768c 100644 --- a/lib/routes/bilibili/user-fav.js +++ b/lib/routes/bilibili/user-fav.js @@ -3,7 +3,7 @@ const cache = require('./cache'); const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const disableEmbed = ctx.req.param('disableEmbed'); const name = await cache.getUsernameFromUID(ctx, uid); diff --git a/lib/routes/bilibili/video-all.js b/lib/routes/bilibili/video-all.js index 54d120956f561a..cd4e028f573a2f 100644 --- a/lib/routes/bilibili/video-all.js +++ b/lib/routes/bilibili/video-all.js @@ -3,7 +3,7 @@ const cache = require('./cache'); const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const disableEmbed = ctx.req.param('disableEmbed'); const cookie = await cache.getCookie(ctx); diff --git a/lib/routes/bilibili/video.js b/lib/routes/bilibili/video.js index b061f0a4ae4096..0d93f9d7bee411 100644 --- a/lib/routes/bilibili/video.js +++ b/lib/routes/bilibili/video.js @@ -3,7 +3,7 @@ const cache = require('./cache'); const utils = require('./utils'); import logger from '@/utils/logger'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const disableEmbed = ctx.req.param('disableEmbed'); const cookie = await cache.getCookie(ctx); diff --git a/lib/routes/bilibili/vsearch.js b/lib/routes/bilibili/vsearch.js index 47901f3ed3163d..673f8e4cb993b9 100644 --- a/lib/routes/bilibili/vsearch.js +++ b/lib/routes/bilibili/vsearch.js @@ -7,7 +7,7 @@ const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); import { queryToBoolean } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { const kw = ctx.req.param('kw'); const order = ctx.req.param('order') || 'pubdate'; const disableEmbed = queryToBoolean(ctx.req.param('disableEmbed')); diff --git a/lib/routes/bilibili/watchlater.js b/lib/routes/bilibili/watchlater.js index 30c2a30c0a05cc..d0ec308558bb10 100644 --- a/lib/routes/bilibili/watchlater.js +++ b/lib/routes/bilibili/watchlater.js @@ -4,7 +4,7 @@ import { config } from '@/config'; const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const disableEmbed = ctx.req.param('disableEmbed'); const name = await cache.getUsernameFromUID(ctx, uid); diff --git a/lib/routes/bilibili/weekly-recommend.js b/lib/routes/bilibili/weekly-recommend.js index 2e1a12d92fc9d3..09957ba2c4b528 100644 --- a/lib/routes/bilibili/weekly-recommend.js +++ b/lib/routes/bilibili/weekly-recommend.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const disableEmbed = ctx.req.param('disableEmbed'); const status_response = await got({ diff --git a/lib/routes/bing/daily-wallpaper.js b/lib/routes/bing/daily-wallpaper.js index ccee8f790b3c47..00127ec9f4a3b6 100644 --- a/lib/routes/bing/daily-wallpaper.js +++ b/lib/routes/bing/daily-wallpaper.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', prefixUrl: 'https://cn.bing.com', diff --git a/lib/routes/bing/router.js b/lib/routes/bing/router.js index 0fb3de86b51280..5d964cfa8c9c63 100644 --- a/lib/routes/bing/router.js +++ b/lib/routes/bing/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './daily-wallpaper'); router.get('/search/:keyword', './search'); }; diff --git a/lib/routes/bing/search.js b/lib/routes/bing/search.js index cbe8e4b9f9cbcd..f3971bbca998dc 100644 --- a/lib/routes/bing/search.js +++ b/lib/routes/bing/search.js @@ -5,7 +5,7 @@ const localizedFormat = require('dayjs/plugin/localizedFormat'); require('dayjs/locale/zh-cn'); dayjs.extend(localizedFormat); -module.exports = async (ctx) => { +export default async (ctx) => { const q = ctx.req.param('keyword'); const searchParams = new URLSearchParams({ format: 'rss', diff --git a/lib/routes/biodiscover/index.js b/lib/routes/biodiscover/index.js index 53fd0d5c7af3d4..66311561140b7e 100644 --- a/lib/routes/biodiscover/index.js +++ b/lib/routes/biodiscover/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const listUrl = 'http://www.biodiscover.com/' + channel; const response = await got({ url: listUrl }); diff --git a/lib/routes/biodiscover/router.js b/lib/routes/biodiscover/router.js index 15393da3d60d00..0b562c0f7741c0 100644 --- a/lib/routes/biodiscover/router.js +++ b/lib/routes/biodiscover/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:channel?', './index'); }; diff --git a/lib/routes/bioone/featured.js b/lib/routes/bioone/featured.js index b76c09255d8585..6ab3757347012f 100644 --- a/lib/routes/bioone/featured.js +++ b/lib/routes/bioone/featured.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://bioone.org'; const response = await got(rootUrl, { https: { diff --git a/lib/routes/bioone/journal.js b/lib/routes/bioone/journal.js index bbe809bb1588d6..c50dd54b753ee2 100644 --- a/lib/routes/bioone/journal.js +++ b/lib/routes/bioone/journal.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const journal = ctx.req.param('journal') ?? 'acta-chiropterologica'; const rootUrl = 'https://bioone.org'; diff --git a/lib/routes/bioone/router.js b/lib/routes/bioone/router.js index 6766c5903ba911..acb3bc1b05a11f 100644 --- a/lib/routes/bioone/router.js +++ b/lib/routes/bioone/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/featured', './featured'); router.get('/journals/:journal?', './journal'); }; diff --git a/lib/routes/biquge/index.js b/lib/routes/biquge/index.js index 96aba37e963e0f..3a58e71c407664 100644 --- a/lib/routes/biquge/index.js +++ b/lib/routes/biquge/index.js @@ -24,7 +24,7 @@ const allowHost = new Set([ 'www.mayiwxw.com', ]); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = getSubPath(ctx).split('/').slice(1, 4).join('/'); const currentUrl = getSubPath(ctx).slice(1); if (!config.feature.allow_user_supply_unsafe_domain && !allowHost.has(new URL(rootUrl).hostname)) { diff --git a/lib/routes/biquge/router.js b/lib/routes/biquge/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/biquge/router.js +++ b/lib/routes/biquge/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/bit/cs/cs.js b/lib/routes/bit/cs/cs.js index d10de38d0beef7..5474cf928e37e3 100644 --- a/lib/routes/bit/cs/cs.js +++ b/lib/routes/bit/cs/cs.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://cs.bit.edu.cn/tzgg/'; const response = await got({ method: 'get', diff --git a/lib/routes/bit/jwc/jwc.js b/lib/routes/bit/jwc/jwc.js index 7eeec9028c81bb..e123520f296310 100644 --- a/lib/routes/bit/jwc/jwc.js +++ b/lib/routes/bit/jwc/jwc.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://jwc.bit.edu.cn/tzgg/'; const response = await got({ method: 'get', diff --git a/lib/routes/bit/router.js b/lib/routes/bit/router.js index 1e3d23a2cd73ed..9519830f56957e 100644 --- a/lib/routes/bit/router.js +++ b/lib/routes/bit/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/cs', './cs/cs'); router.get('/jwc', './jwc/jwc'); router.get('/rszhaopin', './rszhaopin'); diff --git a/lib/routes/bit/rszhaopin.js b/lib/routes/bit/rszhaopin.js index c2164bcac07142..1cd05f910960c3 100644 --- a/lib/routes/bit/rszhaopin.js +++ b/lib/routes/bit/rszhaopin.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://rszhaopin.bit.edu.cn'; const apiUrl = `${rootUrl}/ajax/ajaxService`; const currentUrl = `${rootUrl}/zp.html#/notices/0`; diff --git a/lib/routes/bit/yjs.js b/lib/routes/bit/yjs.js index 42809615129c97..705fd438c8e663 100644 --- a/lib/routes/bit/yjs.js +++ b/lib/routes/bit/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://grd.bit.edu.cn/zsgz/zsxx/index.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/bitbucket/commits.js b/lib/routes/bitbucket/commits.js index 8ea1fbe636cb81..c9e8953733f4ff 100644 --- a/lib/routes/bitbucket/commits.js +++ b/lib/routes/bitbucket/commits.js @@ -3,7 +3,7 @@ import { config } from '@/config'; import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const workspace = ctx.req.param('workspace'); const repo_slug = ctx.req.param('repo_slug'); diff --git a/lib/routes/bitbucket/router.js b/lib/routes/bitbucket/router.js index f6725d6260b69a..14b196951b199e 100644 --- a/lib/routes/bitbucket/router.js +++ b/lib/routes/bitbucket/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/commits/:workspace/:repo_slug', './commits'); router.get('/tags/:workspace/:repo_slug', './tags'); }; diff --git a/lib/routes/bitbucket/tags.js b/lib/routes/bitbucket/tags.js index 52d02438b36028..cddcd86010127d 100644 --- a/lib/routes/bitbucket/tags.js +++ b/lib/routes/bitbucket/tags.js @@ -3,7 +3,7 @@ import { config } from '@/config'; import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const workspace = ctx.req.param('workspace'); const repo_slug = ctx.req.param('repo_slug'); diff --git a/lib/routes/bitmovin/blog.js b/lib/routes/bitmovin/blog.js index cea9b41c25d951..763b74e597786c 100644 --- a/lib/routes/bitmovin/blog.js +++ b/lib/routes/bitmovin/blog.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://bitmovin.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const apiUrl = `${baseUrl}/wp-json/wp/v2`; const { data } = await got(`${apiUrl}/posts`, { searchParams: { diff --git a/lib/routes/bitmovin/router.js b/lib/routes/bitmovin/router.js index e08aa776942a77..da5910733e49ed 100644 --- a/lib/routes/bitmovin/router.js +++ b/lib/routes/bitmovin/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog', './blog'); }; diff --git a/lib/routes/bjfu/grs.js b/lib/routes/bjfu/grs.js index 7c0e687fcb96a4..3f83ddac7c0e66 100644 --- a/lib/routes/bjfu/grs.js +++ b/lib/routes/bjfu/grs.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'http://graduate.bjfu.edu.cn/pygl/pydt/index.html'; const response = await got.get(url); const data = response.data; diff --git a/lib/routes/bjfu/it/index.js b/lib/routes/bjfu/it/index.js index 924cdbe8c910ad..51ba73124d3d48 100644 --- a/lib/routes/bjfu/it/index.js +++ b/lib/routes/bjfu/it/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const util = require('./utils'); const iconv = require('iconv-lite'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let title, path; switch (type) { diff --git a/lib/routes/bjfu/jwc/index.js b/lib/routes/bjfu/jwc/index.js index 278fed8bc89d60..830bdd1d284868 100644 --- a/lib/routes/bjfu/jwc/index.js +++ b/lib/routes/bjfu/jwc/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let title, path; switch (type) { diff --git a/lib/routes/bjfu/kjc.js b/lib/routes/bjfu/kjc.js index 70c0daf3afd1a1..d103fe7ca7157b 100644 --- a/lib/routes/bjfu/kjc.js +++ b/lib/routes/bjfu/kjc.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'http://kyc.bjfu.edu.cn/tztg/index.html'; const response = await got.get(url); const data = response.data; diff --git a/lib/routes/bjfu/news/index.js b/lib/routes/bjfu/news/index.js index 97f1cce8205269..c865d7bfe7a2d6 100644 --- a/lib/routes/bjfu/news/index.js +++ b/lib/routes/bjfu/news/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const util = require('./utils'); const iconv = require('iconv-lite'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let title, path; switch (type) { diff --git a/lib/routes/bjfu/router.js b/lib/routes/bjfu/router.js index aedd1dd40a4644..672ff1f3e37f93 100644 --- a/lib/routes/bjfu/router.js +++ b/lib/routes/bjfu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/grs', './grs'); router.get('/it/:type', './it/index'); router.get('/jwc/:type', './jwc/index'); diff --git a/lib/routes/bjp/apod.js b/lib/routes/bjp/apod.js index 1fe5601b827c44..b880c4ccf45dae 100644 --- a/lib/routes/bjp/apod.js +++ b/lib/routes/bjp/apod.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.bjp.org.cn'; const listUrl = `${baseUrl}/APOD/list.shtml`; diff --git a/lib/routes/bjp/router.js b/lib/routes/bjp/router.js index 6b4fb49a47f40c..412c32ba308c55 100644 --- a/lib/routes/bjp/router.js +++ b/lib/routes/bjp/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/apod', './apod'); }; diff --git a/lib/routes/bjsk/index.js b/lib/routes/bjsk/index.js index a4cb0b838b6948..11738bd34834a3 100644 --- a/lib/routes/bjsk/index.js +++ b/lib/routes/bjsk/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.bjsk.org.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { path = 'newslist-1486-0-0' } = ctx.req.param(); const link = `${baseUrl}/${path}.html`; const { data: response } = await got(link, { diff --git a/lib/routes/bjsk/keti.js b/lib/routes/bjsk/keti.js index 3147c21e20616b..a16a6a864613eb 100644 --- a/lib/routes/bjsk/keti.js +++ b/lib/routes/bjsk/keti.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '402881027cbb8c6f017cbb8e17710002'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 100; diff --git a/lib/routes/bjsk/router.js b/lib/routes/bjsk/router.js index 2b97bb94939a89..f93111e209c078 100644 --- a/lib/routes/bjsk/router.js +++ b/lib/routes/bjsk/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/keti/:id?', './keti'); router.get('/:path?', './index'); }; diff --git a/lib/routes/bjwxdxh/index.js b/lib/routes/bjwxdxh/index.js index 5d7dc35d6efbe7..c7b6ee3d6af5c7 100644 --- a/lib/routes/bjwxdxh/index.js +++ b/lib/routes/bjwxdxh/index.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://www.bjwxdxh.org.cn'; const type = ctx.req.param('type'); const link = type ? `${baseUrl}/news/class/?${type}.html` : `${baseUrl}/news/class/`; diff --git a/lib/routes/bjwxdxh/router.js b/lib/routes/bjwxdxh/router.js index 47ce2498dc8532..6fd05f06e15564 100644 --- a/lib/routes/bjwxdxh/router.js +++ b/lib/routes/bjwxdxh/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?', './index'); }; diff --git a/lib/routes/bjx/huanbao.js b/lib/routes/bjx/huanbao.js index 68c83c6659c9f7..aebcfae20c5e47 100644 --- a/lib/routes/bjx/huanbao.js +++ b/lib/routes/bjx/huanbao.js @@ -13,7 +13,7 @@ const asyncPoolAll = async (...args) => { return results; }; -module.exports = async (ctx) => { +export default async (ctx) => { const listURL = 'https://huanbao.bjx.com.cn/yw/'; const response = await got(listURL); diff --git a/lib/routes/bjx/router.js b/lib/routes/bjx/router.js index 62eaffde748669..95d2ece934ed4c 100644 --- a/lib/routes/bjx/router.js +++ b/lib/routes/bjx/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/gf/:type', './types'); router.get('/huanbao', './huanbao'); }; diff --git a/lib/routes/bjx/types.js b/lib/routes/bjx/types.js index 943c3af93626b1..09a9e4904f07a5 100644 --- a/lib/routes/bjx/types.js +++ b/lib/routes/bjx/types.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const response = await got({ method: 'get', diff --git a/lib/routes/blizzard/news.js b/lib/routes/blizzard/news.js index 02b19006ea4d69..144683a6b91c94 100644 --- a/lib/routes/blizzard/news.js +++ b/lib/routes/blizzard/news.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || ''; const language = ctx.req.param('language') || 'en-us'; diff --git a/lib/routes/blizzard/router.js b/lib/routes/blizzard/router.js index 680974dc73a104..49a7c04ba37cda 100644 --- a/lib/routes/blizzard/router.js +++ b/lib/routes/blizzard/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:language?/:category?', './news'); }; diff --git a/lib/routes/bloomberg/authors.js b/lib/routes/bloomberg/authors.js index 10be26eeac966a..8e69a74d2869ee 100644 --- a/lib/routes/bloomberg/authors.js +++ b/lib/routes/bloomberg/authors.js @@ -27,7 +27,7 @@ const parseAuthorNewsList = async (slug) => { .get(); }; -module.exports = async (ctx) => { +export default async (ctx) => { const { id, slug, source } = ctx.req.param(); const link = `https://www.bloomberg.com/authors/${id}/${slug}`; diff --git a/lib/routes/bloomberg/index.js b/lib/routes/bloomberg/index.js index 57012e2a7705f6..86530130605801 100644 --- a/lib/routes/bloomberg/index.js +++ b/lib/routes/bloomberg/index.js @@ -14,7 +14,7 @@ const site_title_mapping = { citylab: 'CityLab', }; -module.exports = async (ctx) => { +export default async (ctx) => { const site = ctx.req.param('site'); const currentUrl = site ? `${rootUrl}/${site}/sitemap_news.xml` : `${rootUrl}/sitemap_news.xml`; diff --git a/lib/routes/bloomberg/router.js b/lib/routes/bloomberg/router.js index b009a2e8039511..dcbae601d00e08 100644 --- a/lib/routes/bloomberg/router.js +++ b/lib/routes/bloomberg/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/authors/:id/:slug/:source?', './authors'); router.get('/:site', './index'); router.get('/', './index'); diff --git a/lib/routes/bluestacks/release.js b/lib/routes/bluestacks/release.js index c04e485341552d..5c0002974a545d 100644 --- a/lib/routes/bluestacks/release.js +++ b/lib/routes/bluestacks/release.js @@ -5,7 +5,7 @@ import puppeteer from '@/utils/puppeteer'; const pageUrl = 'https://support.bluestacks.com/hc/en-us/articles/360056960211-Release-Notes-BlueStacks-5'; -module.exports = async (ctx) => { +export default async (ctx) => { const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); diff --git a/lib/routes/bluestacks/router.js b/lib/routes/bluestacks/router.js index 4bd14cd6508ad7..6386f8d3f37697 100644 --- a/lib/routes/bluestacks/router.js +++ b/lib/routes/bluestacks/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/release/5', './release'); }; diff --git a/lib/routes/bmkg/earthquake.js b/lib/routes/bmkg/earthquake.js index 6d63ebe10d4a13..19d6801d060a65 100644 --- a/lib/routes/bmkg/earthquake.js +++ b/lib/routes/bmkg/earthquake.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.bmkg.go.id/gempabumi-terkini.html'; const response = await got(url); const $ = load(response.data); diff --git a/lib/routes/bmkg/news.js b/lib/routes/bmkg/news.js index b43b54d783c7b8..f3e717ba88daae 100644 --- a/lib/routes/bmkg/news.js +++ b/lib/routes/bmkg/news.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.bmkg.go.id'; const response = await got(url); const $ = load(response.data); diff --git a/lib/routes/bmkg/router.js b/lib/routes/bmkg/router.js index 30c419ee45e0d1..8f54ae123241ee 100644 --- a/lib/routes/bmkg/router.js +++ b/lib/routes/bmkg/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/earthquake', './earthquake'); router.get('/news', './news'); }; diff --git a/lib/routes/bnu/bs.js b/lib/routes/bnu/bs.js index c50ebe38ce9020..5e23aec8e9f682 100644 --- a/lib/routes/bnu/bs.js +++ b/lib/routes/bnu/bs.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'xw'; const rootUrl = 'http://bs.bnu.edu.cn'; diff --git a/lib/routes/bnu/dwxgb.js b/lib/routes/bnu/dwxgb.js index 780e7f2c3bfa00..78a5f410ef69f0 100644 --- a/lib/routes/bnu/dwxgb.js +++ b/lib/routes/bnu/dwxgb.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category, type } = ctx.req.param(); const rootUrl = 'https://dwxgb.bnu.edu.cn'; diff --git a/lib/routes/bnu/fdy.js b/lib/routes/bnu/fdy.js index bb9844a2ce6e99..58fe3a6d41ff3e 100644 --- a/lib/routes/bnu/fdy.js +++ b/lib/routes/bnu/fdy.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://fdy.bnu.edu.cn'; const { path = 'tzgg' } = ctx.req.param(); const link = `${baseUrl}/${path}/index.htm`; diff --git a/lib/routes/bnu/lib.js b/lib/routes/bnu/lib.js index 3b47dfa4b6a4ab..56ac52358fb303 100644 --- a/lib/routes/bnu/lib.js +++ b/lib/routes/bnu/lib.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://www.lib.bnu.edu.cn'; const { category = 'zydt' } = ctx.req.param(); const link = `${baseUrl}/${category}/index.htm`; diff --git a/lib/routes/bnu/router.js b/lib/routes/bnu/router.js index 706ed26f89def0..5cc4e62f047a42 100644 --- a/lib/routes/bnu/router.js +++ b/lib/routes/bnu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/bs/:category?', './bs'); router.get('/dwxgb/:category/:type', './dwxgb'); router.get('/fdy/:path*', './fdy'); diff --git a/lib/routes/boc/router.js b/lib/routes/boc/router.js index de958e2e6cb021..11abba62a3f623 100644 --- a/lib/routes/boc/router.js +++ b/lib/routes/boc/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/whpj/:format?', './whpj'); }; diff --git a/lib/routes/boc/whpj.js b/lib/routes/boc/whpj.js index abcbee61b79673..308dc2f1d1f279 100644 --- a/lib/routes/boc/whpj.js +++ b/lib/routes/boc/whpj.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.boc.cn/sourcedb/whpj/'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/bookfere/category.js b/lib/routes/bookfere/category.js index cc1ab22c445b12..5a9ec53335a92e 100644 --- a/lib/routes/bookfere/category.js +++ b/lib/routes/bookfere/category.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://bookfere.com/category/' + ctx.req.param('category'); const response = await got({ method: 'get', diff --git a/lib/routes/bookfere/router.js b/lib/routes/bookfere/router.js index 91758d38a2efef..cc70151e46efa7 100644 --- a/lib/routes/bookfere/router.js +++ b/lib/routes/bookfere/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category', './category'); }; diff --git a/lib/routes/booru/mmda.js b/lib/routes/booru/mmda.js index 68c9d00dc62b80..1997c6f5e8e0f4 100644 --- a/lib/routes/booru/mmda.js +++ b/lib/routes/booru/mmda.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import queryString from 'query-string'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://mmda.booru.org'; const tags = ctx.req.param('tags'); diff --git a/lib/routes/booru/router.js b/lib/routes/booru/router.js index 9371f3176e15ae..3e817bd67f3d91 100644 --- a/lib/routes/booru/router.js +++ b/lib/routes/booru/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/mmda/tags/:tags?', './mmda'); }; diff --git a/lib/routes/bossdesign/index.js b/lib/routes/bossdesign/index.js index 16bb1314bc4b31..3e2577f35d4d7c 100644 --- a/lib/routes/bossdesign/index.js +++ b/lib/routes/bossdesign/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const limit = Number.parseInt(ctx.req.query('limit'), 10) || undefined; const baseUrl = 'https://www.bossdesign.cn'; diff --git a/lib/routes/bossdesign/router.js b/lib/routes/bossdesign/router.js index 5db50869af4b34..0bcd82a5c2aa19 100644 --- a/lib/routes/bossdesign/router.js +++ b/lib/routes/bossdesign/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/brave/latest.js b/lib/routes/brave/latest.js index 5e11421763a391..be94b9f5f9864b 100644 --- a/lib/routes/brave/latest.js +++ b/lib/routes/brave/latest.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://brave.com'; const currentUrl = `${rootUrl}/latest`; diff --git a/lib/routes/brave/router.js b/lib/routes/brave/router.js index 625259564fa6fb..cd57ba05cfc495 100644 --- a/lib/routes/brave/router.js +++ b/lib/routes/brave/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/latest', './latest'); }; diff --git a/lib/routes/brooklynmuseum/exhibitions.js b/lib/routes/brooklynmuseum/exhibitions.js index a74dc25b2028a1..3b6bc3215f0862 100644 --- a/lib/routes/brooklynmuseum/exhibitions.js +++ b/lib/routes/brooklynmuseum/exhibitions.js @@ -1,6 +1,6 @@ import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { let link; const state = ctx.req.param('state'); diff --git a/lib/routes/brooklynmuseum/router.js b/lib/routes/brooklynmuseum/router.js index ca342afb7ca8dd..80cefced5df934 100644 --- a/lib/routes/brooklynmuseum/router.js +++ b/lib/routes/brooklynmuseum/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/exhibitions/:state?', './exhibitions'); }; diff --git a/lib/routes/bse/index.js b/lib/routes/bse/index.js index 9ea4bb936eb522..6b79c0997390f6 100644 --- a/lib/routes/bse/index.js +++ b/lib/routes/bse/index.js @@ -119,7 +119,7 @@ const nodes = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'important_news'; const keyword = ctx.req.param('keyword') ?? ''; diff --git a/lib/routes/bse/router.js b/lib/routes/bse/router.js index 4f214af449f5da..116808371d602c 100644 --- a/lib/routes/bse/router.js +++ b/lib/routes/bse/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?/:keyword?', './index'); }; diff --git a/lib/routes/bsky/keyword.js b/lib/routes/bsky/keyword.js index 4eee56c442d9b3..2fc29d2a1b8c72 100644 --- a/lib/routes/bsky/keyword.js +++ b/lib/routes/bsky/keyword.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const apiLink = `https://search.bsky.social/search/posts?q=${encodeURIComponent(keyword)}`; diff --git a/lib/routes/bsky/posts.js b/lib/routes/bsky/posts.js index ccee9994b248e6..b0b261f4ecd8c3 100644 --- a/lib/routes/bsky/posts.js +++ b/lib/routes/bsky/posts.js @@ -4,7 +4,7 @@ const { resolveHandle, getProfile, getAuthorFeed } = require('./utils'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const handle = ctx.req.param('handle'); const DID = await resolveHandle(handle, cache.tryGet); const profile = await getProfile(DID, cache.tryGet); diff --git a/lib/routes/bsky/router.js b/lib/routes/bsky/router.js index 2ebca4c265ed8a..0f98787ca6920c 100644 --- a/lib/routes/bsky/router.js +++ b/lib/routes/bsky/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/keyword/:keyword', './keyword'); router.get('/profile/:handle', './posts'); }; diff --git a/lib/routes/btzj/index.js b/lib/routes/btzj/index.js index 881c2da55c9f69..c027e63d509b16 100644 --- a/lib/routes/btzj/index.js +++ b/lib/routes/btzj/index.js @@ -8,7 +8,7 @@ import * as path from 'node:path'; import { config } from '@/config'; const allowDomain = new Set(['2btjia.com', '88btbtt.com', 'btbtt15.com', 'btbtt20.com']); -module.exports = async (ctx) => { +export default async (ctx) => { let category = ctx.req.param('category') ?? ''; let domain = ctx.req.query('domain') ?? 'btbtt15.com'; if (!config.feature.allow_user_supply_unsafe_domain && !allowDomain.has(new URL(`http://${domain}/`).hostname)) { diff --git a/lib/routes/btzj/router.js b/lib/routes/btzj/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/btzj/router.js +++ b/lib/routes/btzj/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/buaa/news/index.js b/lib/routes/buaa/news/index.js index d7f7ddb7a15a09..33d976d917cd70 100644 --- a/lib/routes/buaa/news/index.js +++ b/lib/routes/buaa/news/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://news.buaa.edu.cn'; const type = ctx.req.param('type'); diff --git a/lib/routes/buaa/router.js b/lib/routes/buaa/router.js index a8388f1d74e3cd..572c3dae8a0e84 100755 --- a/lib/routes/buaa/router.js +++ b/lib/routes/buaa/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:type', './news/index'); router.get('/sme/:path*', './sme'); }; diff --git a/lib/routes/buaa/sme.js b/lib/routes/buaa/sme.js index 04b1889032a6b0..9f7be9e8572618 100755 --- a/lib/routes/buaa/sme.js +++ b/lib/routes/buaa/sme.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const BASE_URL = 'http://www.sme.buaa.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { path = 'tzgg' } = ctx.req.param(); const url = `${BASE_URL}/${path}.htm`; const { title, list } = await getList(url); diff --git a/lib/routes/bulianglin/bulianglin.js b/lib/routes/bulianglin/bulianglin.js index 66a8994ff32653..05a5904a1ec726 100644 --- a/lib/routes/bulianglin/bulianglin.js +++ b/lib/routes/bulianglin/bulianglin.js @@ -2,7 +2,7 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://bulianglin.com/'; const response = await got({ method: 'get', url }); const $ = load(response.data); diff --git a/lib/routes/bulianglin/router.js b/lib/routes/bulianglin/router.js index c7b7500ef69a37..16346ab70a6bdf 100644 --- a/lib/routes/bulianglin/router.js +++ b/lib/routes/bulianglin/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './bulianglin'); }; diff --git a/lib/routes/bupt/rczp.js b/lib/routes/bupt/rczp.js index fb63984e680e67..80f48cb71107b2 100644 --- a/lib/routes/bupt/rczp.js +++ b/lib/routes/bupt/rczp.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.bupt.edu.cn'; const currentUrl = `${rootUrl}/rczp.htm`; diff --git a/lib/routes/bupt/router.js b/lib/routes/bupt/router.js index 47029fafb684fc..023a5755a20847 100644 --- a/lib/routes/bupt/router.js +++ b/lib/routes/bupt/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/rczp', './rczp'); }; diff --git a/lib/routes/byteclicks/index.js b/lib/routes/byteclicks/index.js index 6f9b795152192f..7ff565c6b11f65 100644 --- a/lib/routes/byteclicks/index.js +++ b/lib/routes/byteclicks/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const { parseItem } = require('./utils'); const baseUrl = 'https://byteclicks.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got(`${baseUrl}/wp-json/wp/v2/posts`, { searchParams: { per_page: ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 100, diff --git a/lib/routes/byteclicks/router.js b/lib/routes/byteclicks/router.js index c3df8d061832f0..9cd07e1c414547 100644 --- a/lib/routes/byteclicks/router.js +++ b/lib/routes/byteclicks/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/tag/:tag', './tag'); }; diff --git a/lib/routes/byteclicks/tag.js b/lib/routes/byteclicks/tag.js index 3a9d9369203901..5edb67a2c645fd 100644 --- a/lib/routes/byteclicks/tag.js +++ b/lib/routes/byteclicks/tag.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const { parseItem } = require('./utils'); const baseUrl = 'https://byteclicks.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const { data: search } = await got(`${baseUrl}/wp-json/wp/v2/tags`, { searchParams: { diff --git a/lib/routes/bytes/bytes.js b/lib/routes/bytes/bytes.js index 4e016214a5b138..739a5c31172f17 100644 --- a/lib/routes/bytes/bytes.js +++ b/lib/routes/bytes/bytes.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const currentURL = 'https://bytes.dev/archives'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const resp = await got(currentURL); const $ = load(resp.data); const text = $('script#__NEXT_DATA__').text(); diff --git a/lib/routes/bytes/router.js b/lib/routes/bytes/router.js index 09d5232b74eb92..ced2307f8ccad5 100644 --- a/lib/routes/bytes/router.js +++ b/lib/routes/bytes/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './bytes'); }; diff --git a/lib/routes/c114/roll.js b/lib/routes/c114/roll.js index c5064c5f3951d9..4ea8ec25e9bc60 100644 --- a/lib/routes/c114/roll.js +++ b/lib/routes/c114/roll.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; const iconv = require('iconv-lite'); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.c114.com.cn'; const currentUrl = `${rootUrl}/news/roll.asp`; diff --git a/lib/routes/c114/router.js b/lib/routes/c114/router.js index 202640a4df3189..6536d5745b6692 100644 --- a/lib/routes/c114/router.js +++ b/lib/routes/c114/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/roll', './roll'); }; diff --git a/lib/routes/caai/index.js b/lib/routes/caai/index.js index e832ed962bde89..95d32c15197a72 100644 --- a/lib/routes/caai/index.js +++ b/lib/routes/caai/index.js @@ -3,7 +3,7 @@ const utils = require('./utils'); import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const base = utils.urlBase(ctx.req.param('caty')); const res = await got(base); const info = utils.fetchAllArticles(res.data); diff --git a/lib/routes/caai/router.js b/lib/routes/caai/router.js index e9a5b6af2904fc..f4101100e944e8 100644 --- a/lib/routes/caai/router.js +++ b/lib/routes/caai/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:caty', './index'); }; diff --git a/lib/routes/caam/index.js b/lib/routes/caam/index.js index 0e1bdc5ccda238..1c91640fc7ddba 100644 --- a/lib/routes/caam/index.js +++ b/lib/routes/caam/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '1' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/caam/router.js b/lib/routes/caam/router.js index b610024188e52a..74ed533fca356e 100644 --- a/lib/routes/caam/router.js +++ b/lib/routes/caam/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './'); }; diff --git a/lib/routes/caareviews/book.js b/lib/routes/caareviews/book.js index 34e6b711d5fc5b..a6c3c5064eef86 100644 --- a/lib/routes/caareviews/book.js +++ b/lib/routes/caareviews/book.js @@ -1,6 +1,6 @@ const { rootUrl, getList, getItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${rootUrl}/reviews/book`; const list = await getList(url); diff --git a/lib/routes/caareviews/essay.js b/lib/routes/caareviews/essay.js index 2960bc23ffa7fc..e7f4e94e0ac6f6 100644 --- a/lib/routes/caareviews/essay.js +++ b/lib/routes/caareviews/essay.js @@ -1,6 +1,6 @@ const { rootUrl, getList, getItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${rootUrl}/reviews/essay`; const list = await getList(url); diff --git a/lib/routes/caareviews/exhibition.js b/lib/routes/caareviews/exhibition.js index bbceaf2c8ae5bf..450972101646ad 100644 --- a/lib/routes/caareviews/exhibition.js +++ b/lib/routes/caareviews/exhibition.js @@ -1,6 +1,6 @@ const { rootUrl, getList, getItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${rootUrl}/reviews/exhibition`; const list = await getList(url); diff --git a/lib/routes/caareviews/router.js b/lib/routes/caareviews/router.js index 8ca3a5cf9570e2..4ae374a9758b90 100644 --- a/lib/routes/caareviews/router.js +++ b/lib/routes/caareviews/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/book', './book'); router.get('/essay', './essay'); router.get('/exhibition', './exhibition'); diff --git a/lib/routes/cahkms/index.js b/lib/routes/cahkms/index.js index 47c05bb279ef3d..fe527ba17d452d 100644 --- a/lib/routes/cahkms/index.js +++ b/lib/routes/cahkms/index.js @@ -19,7 +19,7 @@ const titles = { 11: '研究资讯', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '03'; const rootUrl = 'http://www.cahkms.org'; diff --git a/lib/routes/cahkms/router.js b/lib/routes/cahkms/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/cahkms/router.js +++ b/lib/routes/cahkms/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/caijing/roll.js b/lib/routes/caijing/roll.js index 41c73119123fef..a23b0f79ad0903 100644 --- a/lib/routes/caijing/roll.js +++ b/lib/routes/caijing/roll.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://roll.caijing.com.cn'; const response = await got(`${baseUrl}/ajax_lists.php`, { searchParams: { diff --git a/lib/routes/caijing/router.js b/lib/routes/caijing/router.js index 385bd1e6e6ff31..6536d5745b6692 100644 --- a/lib/routes/caijing/router.js +++ b/lib/routes/caijing/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/roll', './roll'); }; diff --git a/lib/routes/caixin/article.js b/lib/routes/caixin/article.js index 2b195e17691984..3963632c134f2b 100644 --- a/lib/routes/caixin/article.js +++ b/lib/routes/caixin/article.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got('https://mapiv5.caixin.com/m/api/getWapIndexListByPage'); const list = response.data.list.map((item) => ({ diff --git a/lib/routes/caixin/blog.js b/lib/routes/caixin/blog.js index 55b34fb8246393..a748cfb4be7748 100644 --- a/lib/routes/caixin/blog.js +++ b/lib/routes/caixin/blog.js @@ -5,7 +5,7 @@ import { isValidHost } from '@/utils/valid-host'; import { parseDate } from '@/utils/parse-date'; const { parseBlogArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const column = ctx.req.param('column'); const { limit = 20 } = ctx.req.query(); if (column) { diff --git a/lib/routes/caixin/category.js b/lib/routes/caixin/category.js index 6336bf4a1357de..c4923bcc7c0364 100644 --- a/lib/routes/caixin/category.js +++ b/lib/routes/caixin/category.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const column = ctx.req.param('column'); const url = `https://${column}.caixin.com/${category}`; diff --git a/lib/routes/caixin/database.js b/lib/routes/caixin/database.js index 3d96e03539be29..dc9d1ddaa830d2 100644 --- a/lib/routes/caixin/database.js +++ b/lib/routes/caixin/database.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://database.caixin.com'; const currentUrl = `${rootUrl}/news/`; const response = await got(currentUrl); diff --git a/lib/routes/caixin/k.js b/lib/routes/caixin/k.js index 5bc3a6ba52ec8d..1b096eff978982 100644 --- a/lib/routes/caixin/k.js +++ b/lib/routes/caixin/k.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://k.caixin.com/app/v1/list', { searchParams: { productIdList: '8,28', diff --git a/lib/routes/caixin/latest.js b/lib/routes/caixin/latest.js index e86078db27456a..f2e6ad78ec0bdf 100644 --- a/lib/routes/caixin/latest.js +++ b/lib/routes/caixin/latest.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got('https://gateway.caixin.com/api/dataplatform/scroll/index').json(); const list = data.articleList diff --git a/lib/routes/caixin/router.js b/lib/routes/caixin/router.js index 6fcedfd7015159..bf6ac915e7db7a 100644 --- a/lib/routes/caixin/router.js +++ b/lib/routes/caixin/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/article', './article'); router.get('/blog/:column?', './blog'); router.get('/database', './database'); diff --git a/lib/routes/caixin/weekly.js b/lib/routes/caixin/weekly.js index 82182fc0f56763..aac758fcad880d 100644 --- a/lib/routes/caixin/weekly.js +++ b/lib/routes/caixin/weekly.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://weekly.caixin.com'; const { data: response } = await got(link); diff --git a/lib/routes/caixinglobal/latest.js b/lib/routes/caixinglobal/latest.js index c596a72f7218da..3cf97dd4adecda 100644 --- a/lib/routes/caixinglobal/latest.js +++ b/lib/routes/caixinglobal/latest.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got('https://gateway.caixin.com/api/extapi/homeInterface.jsp', { searchParams: { subject: '100990318;100990314;100990311', diff --git a/lib/routes/caixinglobal/router.js b/lib/routes/caixinglobal/router.js index d9d312e16f77d1..cd57ba05cfc495 100644 --- a/lib/routes/caixinglobal/router.js +++ b/lib/routes/caixinglobal/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/latest', './latest'); }; diff --git a/lib/routes/camchina/index.js b/lib/routes/camchina/index.js index 31b19352c6b732..b91166d6ade204 100644 --- a/lib/routes/camchina/index.js +++ b/lib/routes/camchina/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '1'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; diff --git a/lib/routes/camchina/router.js b/lib/routes/camchina/router.js index c34676efd9b9eb..28cef7111ec14a 100644 --- a/lib/routes/camchina/router.js +++ b/lib/routes/camchina/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id?', './index'); }; diff --git a/lib/routes/cankaoxiaoxi/index.js b/lib/routes/cankaoxiaoxi/index.js index c46d5c0dc5d983..edb9eb960158d8 100644 --- a/lib/routes/cankaoxiaoxi/index.js +++ b/lib/routes/cankaoxiaoxi/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'diyi'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; diff --git a/lib/routes/cankaoxiaoxi/router.js b/lib/routes/cankaoxiaoxi/router.js index 21b60618f26587..0142a3c1d9974c 100644 --- a/lib/routes/cankaoxiaoxi/router.js +++ b/lib/routes/cankaoxiaoxi/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/column/:id?', './'); router.get('/:id?', './'); }; diff --git a/lib/routes/cartoonmad/comic.js b/lib/routes/cartoonmad/comic.js index 71598656335264..e85bebb88c16e9 100644 --- a/lib/routes/cartoonmad/comic.js +++ b/lib/routes/cartoonmad/comic.js @@ -30,7 +30,7 @@ const getChapters = (id, list, tryGet) => ) ); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `${baseUrl}/comic/${id}`; diff --git a/lib/routes/cartoonmad/router.js b/lib/routes/cartoonmad/router.js index 5e90b73098a162..4b9ff0ae81e507 100644 --- a/lib/routes/cartoonmad/router.js +++ b/lib/routes/cartoonmad/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/comic/:id', './comic'); }; diff --git a/lib/routes/cas/cg/index.js b/lib/routes/cas/cg/index.js index 40d1ad88ad455a..a0a40bb65d72ed 100644 --- a/lib/routes/cas/cg/index.js +++ b/lib/routes/cas/cg/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const caty = ctx.req.param('caty') || 'zh'; const rootUrl = 'https://www.cas.cn'; diff --git a/lib/routes/cas/genetics/index.js b/lib/routes/cas/genetics/index.js index 0878a0faff1015..b41f515a790dee 100644 --- a/lib/routes/cas/genetics/index.js +++ b/lib/routes/cas/genetics/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://genetics.cas.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = ctx.req.param('path'); const currentUrl = `${baseUrl}/${path}/`; diff --git a/lib/routes/cas/ia/yjs.js b/lib/routes/cas/ia/yjs.js index 13a796cb2d2d93..97c771694c6c0d 100644 --- a/lib/routes/cas/ia/yjs.js +++ b/lib/routes/cas/ia/yjs.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://www.ia.cas.cn/yjsjy/zs/sszs/'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/cas/iee/kydt.js b/lib/routes/cas/iee/kydt.js index 1969245b168b4e..a5bbeeddf66993 100644 --- a/lib/routes/cas/iee/kydt.js +++ b/lib/routes/cas/iee/kydt.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://www.iee.cas.cn/xwzx/kydt/'; const response = await got({ method: 'get', diff --git a/lib/routes/cas/is/index.js b/lib/routes/cas/is/index.js index 441eb0600ba77d..d4eb3f03076a2f 100644 --- a/lib/routes/cas/is/index.js +++ b/lib/routes/cas/is/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://is.cas.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = ctx.req.param('path'); const response = await got(`${baseUrl}/${path}/`); diff --git a/lib/routes/cas/mesalab/kb.js b/lib/routes/cas/mesalab/kb.js index 30e6bfc80c3bcc..f8cc91ca281bf7 100644 --- a/lib/routes/cas/mesalab/kb.js +++ b/lib/routes/cas/mesalab/kb.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const homepage = 'https://www.mesalab.cn'; const url = `${homepage}/f/article/articleList?pageNo=1&pageSize=15&createTimeSort=DESC`; const response = await got(url); diff --git a/lib/routes/cas/router.js b/lib/routes/cas/router.js index 0854bc475c98a2..cb0164c4f95e7d 100644 --- a/lib/routes/cas/router.js +++ b/lib/routes/cas/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/cg/:caty?', './cg/index'); router.get('/genetics/:path+', './genetics/index'); router.get('/ia/yjs', './ia/yjs'); diff --git a/lib/routes/cas/sim/kyjz.js b/lib/routes/cas/sim/kyjz.js index df0359ddfb80fb..29075a980d3dba 100644 --- a/lib/routes/cas/sim/kyjz.js +++ b/lib/routes/cas/sim/kyjz.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'http://www.sim.cas.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = new URL('xwzx2016/kyjz/', host).href; const response = await got(link); diff --git a/lib/routes/cast/index.js b/lib/routes/cast/index.js index d8e9b4d8660420..f69d45bef42917 100644 --- a/lib/routes/cast/index.js +++ b/lib/routes/cast/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const baseUrl = 'https://www.cast.org.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { column = 457 } = ctx.req.param(); const { limit = 10 } = ctx.req.query(); const link = `${baseUrl}/col/col${column}/index.html`; diff --git a/lib/routes/cast/router.js b/lib/routes/cast/router.js index 86340220c7aeea..699c5cf13f17ff 100644 --- a/lib/routes/cast/router.js +++ b/lib/routes/cast/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:column?', './index'); }; diff --git a/lib/routes/cau/ele.js b/lib/routes/cau/ele.js index d0dc5a441ae3a7..9dfaab0cb0ad76 100644 --- a/lib/routes/cau/ele.js +++ b/lib/routes/cau/ele.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://ciee.cau.edu.cn'; const link = `${baseUrl}/col/col26712/index.html`; const response = await got(`${baseUrl}/module/web/jpage/dataproxy.jsp`, { diff --git a/lib/routes/cau/router.js b/lib/routes/cau/router.js index c884c525a53936..d3f2afcc4eb00d 100644 --- a/lib/routes/cau/router.js +++ b/lib/routes/cau/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/ele', './ele'); router.get('/yjs', './yjs'); }; diff --git a/lib/routes/cau/yjs.js b/lib/routes/cau/yjs.js index 18eb11e3cf0ebb..d13af1255c82ed 100644 --- a/lib/routes/cau/yjs.js +++ b/lib/routes/cau/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://yz.cau.edu.cn'; const link = `${baseUrl}/col/col41740/index.html`; const response = await got(`${baseUrl}/module/web/jpage/dataproxy.jsp`, { diff --git a/lib/routes/caus/index.js b/lib/routes/caus/index.js index 6389b9fe3cc0ab..53b6d9a744af11 100644 --- a/lib/routes/caus/index.js +++ b/lib/routes/caus/index.js @@ -28,7 +28,7 @@ const categories = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || '0'; const isHome = category === '0'; diff --git a/lib/routes/caus/router.js b/lib/routes/caus/router.js index 5db50869af4b34..0bcd82a5c2aa19 100644 --- a/lib/routes/caus/router.js +++ b/lib/routes/caus/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/cbaigui/index.js b/lib/routes/cbaigui/index.js index c2cb4a092f8fb4..bf8715acf0e1fb 100644 --- a/lib/routes/cbaigui/index.js +++ b/lib/routes/cbaigui/index.js @@ -7,7 +7,7 @@ import * as path from 'node:path'; const { rootUrl, apiSlug, GetFilterId } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; let filterName; diff --git a/lib/routes/cbaigui/router.js b/lib/routes/cbaigui/router.js index 6ea9e73a121a87..3e16705b558ae0 100644 --- a/lib/routes/cbaigui/router.js +++ b/lib/routes/cbaigui/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './'); }; diff --git a/lib/routes/cbc/router.js b/lib/routes/cbc/router.js index 9659062a03cb98..5fe41a17254508 100644 --- a/lib/routes/cbc/router.js +++ b/lib/routes/cbc/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/topics/:topic?', './topics'); }; diff --git a/lib/routes/cbc/topics.js b/lib/routes/cbc/topics.js index 5bf78c0f857aea..54ce3961483cfa 100644 --- a/lib/routes/cbc/topics.js +++ b/lib/routes/cbc/topics.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.cbc.ca'; const topic = ctx.req.param('topic') || ''; const url = `${baseUrl}/news${topic ? `/${topic.replace('-', '/')}` : ''}`; diff --git a/lib/routes/cbirc/index.js b/lib/routes/cbirc/index.js index 7102dee13645ae..0374fc7114c6e6 100644 --- a/lib/routes/cbirc/index.js +++ b/lib/routes/cbirc/index.js @@ -78,7 +78,7 @@ async function getContent(item) { return response.data.data.docClob; } -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'ggtz'; const cat = categories[category]; diff --git a/lib/routes/cbirc/router.js b/lib/routes/cbirc/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/cbirc/router.js +++ b/lib/routes/cbirc/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/cbnweek/index.js b/lib/routes/cbnweek/index.js index f0c89f64f08616..40df892fe15774 100644 --- a/lib/routes/cbnweek/index.js +++ b/lib/routes/cbnweek/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www2021.cbnweek.com'; const apiRootUrl = 'https://api2021.cbnweek.com'; const currentUrl = `${apiRootUrl}/v4/first_page_infos?per=1`; diff --git a/lib/routes/cbnweek/router.js b/lib/routes/cbnweek/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/cbnweek/router.js +++ b/lib/routes/cbnweek/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/ccac/news.js b/lib/routes/ccac/news.js index 25dc76664ee4f7..06452765879902 100644 --- a/lib/routes/ccac/news.js +++ b/lib/routes/ccac/news.js @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const browser = await puppeteer(); const lang = ctx.req.param('lang') ?? 'sc'; const type = utils.TYPE[ctx.req.param('type')]; diff --git a/lib/routes/ccac/router.js b/lib/routes/ccac/router.js index 61439a0318f668..3ffecf2b1c8bf0 100644 --- a/lib/routes/ccac/router.js +++ b/lib/routes/ccac/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:type/:lang?', './news'); }; diff --git a/lib/routes/ccf/ccfcv/index.js b/lib/routes/ccf/ccfcv/index.js index 90ccdb71251335..43570014de9b31 100644 --- a/lib/routes/ccf/ccfcv/index.js +++ b/lib/routes/ccf/ccfcv/index.js @@ -15,7 +15,7 @@ const cateTitleMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const cate = ctx.req.param('category'); diff --git a/lib/routes/ccf/news.js b/lib/routes/ccf/news.js index d5f332d29f524e..0596db897073e2 100644 --- a/lib/routes/ccf/news.js +++ b/lib/routes/ccf/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || 'Media_list'; const rootUrl = 'https://www.ccf.org.cn'; diff --git a/lib/routes/ccf/router.js b/lib/routes/ccf/router.js index b8cf49ca75d99f..44c8b249edfab1 100644 --- a/lib/routes/ccf/router.js +++ b/lib/routes/ccf/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/ccfcv/:channel/:category', './ccfcv/index'); router.get('/news/:category?', './news'); router.get('/tfbd/:caty/:id', './tfbd/index'); diff --git a/lib/routes/ccf/tfbd/index.js b/lib/routes/ccf/tfbd/index.js index 66c8a743998046..79a6d0aa70caed 100644 --- a/lib/routes/ccf/tfbd/index.js +++ b/lib/routes/ccf/tfbd/index.js @@ -3,7 +3,7 @@ const utils = require('./utils'); import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const base = utils.urlBase(ctx.req.param('caty'), ctx.req.param('id')); const res = await got(base); const info = utils.fetchAllArticles(res.data); diff --git a/lib/routes/ccnu/career.js b/lib/routes/ccnu/career.js index bde4a804026d0c..24094a74a17e06 100644 --- a/lib/routes/ccnu/career.js +++ b/lib/routes/ccnu/career.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://ccnu.91wllm.com'; const link = `${host}/news/index/tag/tzgg`; diff --git a/lib/routes/ccnu/cs.js b/lib/routes/ccnu/cs.js index a3db0b7af5edef..b83167dc0b7119 100644 --- a/lib/routes/ccnu/cs.js +++ b/lib/routes/ccnu/cs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://cs.ccnu.edu.cn/xwzx/tzgg.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/ccnu/router.js b/lib/routes/ccnu/router.js index 2c6014fb36117c..716467bafb81c5 100644 --- a/lib/routes/ccnu/router.js +++ b/lib/routes/ccnu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/career', './career'); router.get('/cs', './cs'); router.get('/wu', './wu'); diff --git a/lib/routes/ccnu/wu.js b/lib/routes/ccnu/wu.js index b7f71e315ef5c8..b7b9c985e858bc 100644 --- a/lib/routes/ccnu/wu.js +++ b/lib/routes/ccnu/wu.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://uowji.ccnu.edu.cn/tzgg.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/ccnu/yjs.js b/lib/routes/ccnu/yjs.js index 20bc46093513c0..7e157f6715f429 100644 --- a/lib/routes/ccnu/yjs.js +++ b/lib/routes/ccnu/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://gs.ccnu.edu.cn/zsgz/ssyjs.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/ccreports/index.js b/lib/routes/ccreports/index.js index d0b4a46d86687e..9b78e725a5c233 100644 --- a/lib/routes/ccreports/index.js +++ b/lib/routes/ccreports/index.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const rootUrl = 'https://www.ccreports.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const listData = await got.get(rootUrl); const $ = load(listData.data); const list = $('div.index-four-content > div.article-box') diff --git a/lib/routes/ccreports/router.js b/lib/routes/ccreports/router.js index c4ad5e17f0709a..bb216cc987010b 100644 --- a/lib/routes/ccreports/router.js +++ b/lib/routes/ccreports/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/article', './index'); }; diff --git a/lib/routes/cctv/category.js b/lib/routes/cctv/category.js index b870d81b6b04d0..5bdbab9f69e979 100644 --- a/lib/routes/cctv/category.js +++ b/lib/routes/cctv/category.js @@ -1,4 +1,4 @@ -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); let responseData; diff --git a/lib/routes/cctv/jx.js b/lib/routes/cctv/jx.js index 0915cfed757d5b..40b899d0d6f92d 100644 --- a/lib/routes/cctv/jx.js +++ b/lib/routes/cctv/jx.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://photo.cctv.com'; const currentUrl = `${rootUrl}/jx/`; const response = await got({ diff --git a/lib/routes/cctv/lm.js b/lib/routes/cctv/lm.js index 64fff4574be8aa..4a7def7787af63 100644 --- a/lib/routes/cctv/lm.js +++ b/lib/routes/cctv/lm.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'xwzk'; const rootUrl = 'https://tv.cctv.com'; diff --git a/lib/routes/cctv/router.js b/lib/routes/cctv/router.js index 7f3759fe7d775c..02536979d0f709 100644 --- a/lib/routes/cctv/router.js +++ b/lib/routes/cctv/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/lm/:id?', './lm'); router.get('/photo/jx', './jx'); router.get('/xwlb', './xwlb'); diff --git a/lib/routes/cctv/xwlb.js b/lib/routes/cctv/xwlb.js index 0868ce8438708d..22684639cf26ce 100644 --- a/lib/routes/cctv/xwlb.js +++ b/lib/routes/cctv/xwlb.js @@ -7,7 +7,7 @@ const dayjs = require('dayjs'); const customParseFormat = require('dayjs/plugin/customParseFormat'); dayjs.extend(customParseFormat); -module.exports = async (ctx) => { +export default async (ctx) => { const res = await got({ method: 'get', url: 'https://tv.cctv.com/lm/xwlb/' }); const $ = load(res.data); // 解析最新一期新闻联播的日期 diff --git a/lib/routes/cde/index.js b/lib/routes/cde/index.js index 27109efe554531..f7c882eb377c11 100644 --- a/lib/routes/cde/index.js +++ b/lib/routes/cde/index.js @@ -75,7 +75,7 @@ const requestData = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const cate = ctx.req.param('category'); requestData[channel][cate].pageSize = ctx.req.param('limit') ?? 25; diff --git a/lib/routes/cde/router.js b/lib/routes/cde/router.js index aeb99acb557b2c..34a9ddf8cb3b1d 100644 --- a/lib/routes/cde/router.js +++ b/lib/routes/cde/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/xxgk/:category', './xxgk'); router.get('/zdyz/:category', './zdyz'); router.get('/:channel/:category', './index'); diff --git a/lib/routes/cde/xxgk.js b/lib/routes/cde/xxgk.js index 5137c784f693d1..3e67a00edd749e 100644 --- a/lib/routes/cde/xxgk.js +++ b/lib/routes/cde/xxgk.js @@ -46,7 +46,7 @@ const xxgkMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const { data } = await got.post(`${baseUrl}/main${xxgkMap.xxgk[category].endPoint}`, { diff --git a/lib/routes/cde/zdyz.js b/lib/routes/cde/zdyz.js index 7e8d920a8610b5..a6ce27db1b109e 100644 --- a/lib/routes/cde/zdyz.js +++ b/lib/routes/cde/zdyz.js @@ -37,7 +37,7 @@ const zdyzMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const { data } = await got.post(`${baseUrl}${zdyzMap.zdyz[category].endPoint}`, { diff --git a/lib/routes/cdi/index.js b/lib/routes/cdi/index.js index b2426f4222dd1d..0aa30aece8caa3 100644 --- a/lib/routes/cdi/index.js +++ b/lib/routes/cdi/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '152'; const rootUrl = 'http://www.cdi.com.cn'; diff --git a/lib/routes/cdi/router.js b/lib/routes/cdi/router.js index c34676efd9b9eb..28cef7111ec14a 100644 --- a/lib/routes/cdi/router.js +++ b/lib/routes/cdi/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id?', './index'); }; diff --git a/lib/routes/cdzjryb/project-list.js b/lib/routes/cdzjryb/project-list.js index b7fc58d2ab9c7c..1e870075284fba 100644 --- a/lib/routes/cdzjryb/project-list.js +++ b/lib/routes/cdzjryb/project-list.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://zw.cdzjryb.com/lottery/accept/projectList'; const { data: response } = await got(url); const $ = load(response); diff --git a/lib/routes/cdzjryb/router.js b/lib/routes/cdzjryb/router.js index f17c8b2ac9cb9b..bc350ff95beb6c 100644 --- a/lib/routes/cdzjryb/router.js +++ b/lib/routes/cdzjryb/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/zw/projectList', './project-list'); }; diff --git a/lib/routes/cebbank/all.js b/lib/routes/cebbank/all.js index d5326c8999a87f..862f00e9259511 100644 --- a/lib/routes/cebbank/all.js +++ b/lib/routes/cebbank/all.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import md5 from '@/utils/md5'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.cebbank.com/eportal/ui?pageId=477257'; const content = await got({ method: 'get', diff --git a/lib/routes/cebbank/history.js b/lib/routes/cebbank/history.js index 887a32a463fc29..2912b16688e128 100644 --- a/lib/routes/cebbank/history.js +++ b/lib/routes/cebbank/history.js @@ -6,7 +6,7 @@ const utils = require('./utils'); const { TYPE } = utils; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const url = `https://www.cebbank.com/eportal/ui?struts.portlet.action=/portlet/whpjFront!toView.action&moduleId=12094&pageId=477260&currcode=${TYPE[type].id}¤tPagebak=1¤tPage=1`; const res = await got({ diff --git a/lib/routes/cebbank/router.js b/lib/routes/cebbank/router.js index 1a8ec793f62847..7640f0b48106a5 100644 --- a/lib/routes/cebbank/router.js +++ b/lib/routes/cebbank/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/quotation/all', './all'); router.get('/quotation/history/:type', './history'); }; diff --git a/lib/routes/cfachina/analygarden.js b/lib/routes/cfachina/analygarden.js index 05664377fd3ac5..d4c60d4a80a4b2 100644 --- a/lib/routes/cfachina/analygarden.js +++ b/lib/routes/cfachina/analygarden.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { let { program = '分析师园地' } = ctx.req.param(); const baseUrl = 'https://www.cfachina.org'; let pageData, diff --git a/lib/routes/cfachina/router.js b/lib/routes/cfachina/router.js index 6ddaf8cb9a1044..02608aeb7e3e7b 100644 --- a/lib/routes/cfachina/router.js +++ b/lib/routes/cfachina/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/servicesupport/analygarden/:program?', './analygarden'); }; diff --git a/lib/routes/cfmmc/index.js b/lib/routes/cfmmc/index.js index b66582a08ae4de..895f6dc12b1a62 100644 --- a/lib/routes/cfmmc/index.js +++ b/lib/routes/cfmmc/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = 'main/noticeannouncement/cfmmcnotice' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/cfmmc/router.js b/lib/routes/cfmmc/router.js index ee20bcfbc723a9..b00fca600581a1 100644 --- a/lib/routes/cfmmc/router.js +++ b/lib/routes/cfmmc/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id*', './'); }; diff --git a/lib/routes/cgtn/podcast.js b/lib/routes/cgtn/podcast.js index b08a8c850ad287..a425675ad4560e 100644 --- a/lib/routes/cgtn/podcast.js +++ b/lib/routes/cgtn/podcast.js @@ -13,7 +13,7 @@ function combDate(date, time) { return timezone(parseDate(date + ' ' + time), +8); } -module.exports = async (ctx) => { +export default async (ctx) => { const { category, id } = ctx.req.param(); const categoryMap = { ezfm: 1, other: 5 }; const data = await getData(categoryMap[category], id); diff --git a/lib/routes/cgtn/router.js b/lib/routes/cgtn/router.js index 3557b8c2a08f9c..e195634a91eedf 100644 --- a/lib/routes/cgtn/router.js +++ b/lib/routes/cgtn/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/podcast/:category/:id', './podcast.js'); }; diff --git a/lib/routes/chaincatcher/home.js b/lib/routes/chaincatcher/home.js index a212765c3b8c5d..8a502f1a10e86f 100644 --- a/lib/routes/chaincatcher/home.js +++ b/lib/routes/chaincatcher/home.js @@ -7,7 +7,7 @@ import * as path from 'node:path'; const rootUrl = 'https://www.chaincatcher.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got.post(`${rootUrl}/api/article/lists`, { form: { page: 1, diff --git a/lib/routes/chaincatcher/news.js b/lib/routes/chaincatcher/news.js index 9ac86ef9cbf3aa..497e358d089d06 100644 --- a/lib/routes/chaincatcher/news.js +++ b/lib/routes/chaincatcher/news.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; const rootUrl = 'https://www.chaincatcher.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got.post(`${rootUrl}/index/content/lists`, { form: { page: 1, diff --git a/lib/routes/chaincatcher/router.js b/lib/routes/chaincatcher/router.js index 6a5c9a29a8225d..85b714e7f87324 100644 --- a/lib/routes/chaincatcher/router.js +++ b/lib/routes/chaincatcher/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './home'); router.get('/news', './news'); }; diff --git a/lib/routes/changba/router.js b/lib/routes/changba/router.js index d843249f6a72e1..ef34beadae5c21 100644 --- a/lib/routes/changba/router.js +++ b/lib/routes/changba/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:userid', './user'); }; diff --git a/lib/routes/changba/user.js b/lib/routes/changba/user.js index b73ccf36c7fd9d..2336cfdd675aef 100644 --- a/lib/routes/changba/user.js +++ b/lib/routes/changba/user.js @@ -5,7 +5,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const headers = { 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1' }; -module.exports = async (ctx) => { +export default async (ctx) => { const userid = ctx.req.param('userid'); const url = `https://changba.com/wap/index.php?s=${userid}`; const response = await got({ diff --git a/lib/routes/chaoxing/qk.js b/lib/routes/chaoxing/qk.js index a3bec6fb86136c..5fa05ed442318f 100644 --- a/lib/routes/chaoxing/qk.js +++ b/lib/routes/chaoxing/qk.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const needContent = /t|y/i.test(ctx.req.param('needContent') ?? 'true'); diff --git a/lib/routes/chaoxing/router.js b/lib/routes/chaoxing/router.js index 317e8ef4057edc..ff40be1bdf5686 100644 --- a/lib/routes/chaoxing/router.js +++ b/lib/routes/chaoxing/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/qk/:id/:needContent?', './qk'); }; diff --git a/lib/routes/chaping/banner.js b/lib/routes/chaping/banner.js index 6b474211685c80..e8504ac8712023 100644 --- a/lib/routes/chaping/banner.js +++ b/lib/routes/chaping/banner.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = `https://chaping.cn/`; const response = await got({ method: 'get', diff --git a/lib/routes/chaping/news.js b/lib/routes/chaping/news.js index 20e39afb2ce51a..529e39674e1c28 100644 --- a/lib/routes/chaping/news.js +++ b/lib/routes/chaping/news.js @@ -14,7 +14,7 @@ const titles = { 9: '公里每小时', }; -module.exports = async (ctx) => { +export default async (ctx) => { const caty = ctx.req.param('caty') ?? ''; const targetUrl = `https://chaping.cn/news?cate=${caty}`; diff --git a/lib/routes/chaping/newsflash.js b/lib/routes/chaping/newsflash.js index 41b6068fe36034..d47f73c44baae8 100644 --- a/lib/routes/chaping/newsflash.js +++ b/lib/routes/chaping/newsflash.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'https://chaping.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const newflashAPI = `${host}/api/official/information/newsflash?page=1&limit=21`; const response = await got(newflashAPI).json(); const data = response.data; diff --git a/lib/routes/chaping/router.js b/lib/routes/chaping/router.js index 35cb22ba9d5e92..1d95f2b280fe81 100644 --- a/lib/routes/chaping/router.js +++ b/lib/routes/chaping/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/banner', './banner'); router.get('/news/:caty?', './news'); router.get('/newsflash', './newsflash'); diff --git a/lib/routes/chiculture/router.js b/lib/routes/chiculture/router.js index 166a6565897aea..ee4223bada9d5d 100644 --- a/lib/routes/chiculture/router.js +++ b/lib/routes/chiculture/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/topic/:category?', './topic'); }; diff --git a/lib/routes/chiculture/topic.js b/lib/routes/chiculture/topic.js index 9b0d40b7715697..cd9dc6066b2155 100644 --- a/lib/routes/chiculture/topic.js +++ b/lib/routes/chiculture/topic.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || ''; const rootUrl = 'https://ls.chiculture.org.hk'; diff --git a/lib/routes/china/finance/finance.js b/lib/routes/china/finance/finance.js index e7e31b425a8fba..f0293e8968b56c 100644 --- a/lib/routes/china/finance/finance.js +++ b/lib/routes/china/finance/finance.js @@ -15,7 +15,7 @@ const CATEGORY_MAP = { IPO: 'IPO', // IPO观察 }; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://finance.china.com'; const category = CATEGORY_MAP[ctx.req.param('category')] ?? CATEGORY_MAP.tuijian; const websiteUrl = `${baseUrl}/${category}`; diff --git a/lib/routes/china/news/highlights/news.js b/lib/routes/china/news/highlights/news.js index ffaf9450e82e44..80e799986ca84f 100644 --- a/lib/routes/china/news/highlights/news.js +++ b/lib/routes/china/news/highlights/news.js @@ -9,7 +9,7 @@ const CATEGORY_MAP = { news100: 'news100', }; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://news.china.com'; const category = CATEGORY_MAP[ctx.req.param('category')] ?? CATEGORY_MAP.domestic; const websiteUrl = `${baseUrl}/${category}`; diff --git a/lib/routes/china/news/military/news.js b/lib/routes/china/news/military/news.js index 904a3272d05610..04356eab140d18 100644 --- a/lib/routes/china/news/military/news.js +++ b/lib/routes/china/news/military/news.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const websiteUrl = 'https://military.china.com/news/'; const response = await got(websiteUrl); const data = response.data; diff --git a/lib/routes/china/router.js b/lib/routes/china/router.js index 08a906c972f77f..95ac6c24f575f4 100644 --- a/lib/routes/china/router.js +++ b/lib/routes/china/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/finance/:category?', './finance/finance.js'); router.get('/news/military', './news/military/news.js'); router.get('/news/:category?', './news/highlights/news.js'); diff --git a/lib/routes/chinadegrees/province.js b/lib/routes/chinadegrees/province.js index dd8215f6ed9a19..1611fd85693043 100644 --- a/lib/routes/chinadegrees/province.js +++ b/lib/routes/chinadegrees/province.js @@ -7,7 +7,7 @@ import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; const baseUrl = 'http://www.chinadegrees.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { province = '11' } = ctx.req.param(); const url = `${baseUrl}/help/unitSwqk${province}.html`; diff --git a/lib/routes/chinadegrees/router.js b/lib/routes/chinadegrees/router.js index 76aab4e98d82fa..a1515a48340022 100644 --- a/lib/routes/chinadegrees/router.js +++ b/lib/routes/chinadegrees/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:province?', './province'); }; diff --git a/lib/routes/chinafactcheck/index.js b/lib/routes/chinafactcheck/index.js index 23b388684b6914..d826825a1e2851 100644 --- a/lib/routes/chinafactcheck/index.js +++ b/lib/routes/chinafactcheck/index.js @@ -3,7 +3,7 @@ const utils = require('./utils'); import { load } from 'cheerio'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(utils.siteLink, { headers: { 'user-agent': utils.trueUA, diff --git a/lib/routes/chinafactcheck/router.js b/lib/routes/chinafactcheck/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/chinafactcheck/router.js +++ b/lib/routes/chinafactcheck/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/chinaisa/index.js b/lib/routes/chinaisa/index.js index 55be0483e0a1f4..540e97ed3feca3 100644 --- a/lib/routes/chinaisa/index.js +++ b/lib/routes/chinaisa/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = '58af05dfb6b4300151760176d2aad0a04c275aaadbb1315039263f021f920dcd' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 15; diff --git a/lib/routes/chinaisa/router.js b/lib/routes/chinaisa/router.js index 9a89c08e9369b2..6c52c5718bdda8 100644 --- a/lib/routes/chinaisa/router.js +++ b/lib/routes/chinaisa/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id?', './'); }; diff --git a/lib/routes/chinamoney/notice.js b/lib/routes/chinamoney/notice.js index b77fde37e03a93..181ed65b1416c7 100644 --- a/lib/routes/chinamoney/notice.js +++ b/lib/routes/chinamoney/notice.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { channels } = require('./channels'); -module.exports = async (ctx) => { +export default async (ctx) => { const { channelId = 2834 } = ctx.req.param(); const baseUrl = 'https://www.chinamoney.com.cn'; diff --git a/lib/routes/chinamoney/router.js b/lib/routes/chinamoney/router.js index 728775facfe696..82e4b54c03b10f 100644 --- a/lib/routes/chinamoney/router.js +++ b/lib/routes/chinamoney/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:channelId?', './notice'); }; diff --git a/lib/routes/chinanews/index.js b/lib/routes/chinanews/index.js index 78af74c062caf2..0f27b53e166b7c 100644 --- a/lib/routes/chinanews/index.js +++ b/lib/routes/chinanews/index.js @@ -6,7 +6,7 @@ import { load } from 'cheerio'; const rootUrl = 'https://www.chinanews.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/scroll-news/news1.html`; const response = await got({ method: 'get', diff --git a/lib/routes/chinanews/router.js b/lib/routes/chinanews/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/chinanews/router.js +++ b/lib/routes/chinanews/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/chinathinktanks/router.js b/lib/routes/chinathinktanks/router.js index 9b5aa3ccd70ea1..dfdbb4af50d94b 100644 --- a/lib/routes/chinathinktanks/router.js +++ b/lib/routes/chinathinktanks/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id', './viewpoint'); }; diff --git a/lib/routes/chinathinktanks/viewpoint.js b/lib/routes/chinathinktanks/viewpoint.js index 70c3c41f07fa2a..444d5437c7e90c 100644 --- a/lib/routes/chinathinktanks/viewpoint.js +++ b/lib/routes/chinathinktanks/viewpoint.js @@ -8,7 +8,7 @@ const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); const baseUrl = 'https://www.chinathinktanks.org.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `https://www.chinathinktanks.org.cn/content/list?id=${ctx.req.param('id')}&pt=1`; const response = await got(link, { diff --git a/lib/routes/chinaventure/index.js b/lib/routes/chinaventure/index.js index 70d8782160d012..617ba832b343e3 100644 --- a/lib/routes/chinaventure/index.js +++ b/lib/routes/chinaventure/index.js @@ -18,7 +18,7 @@ const nodes = { 116: '新消费', }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const currentUrl = rootUrl.concat(id ? `/news/${id}.html` : '/index.html'); diff --git a/lib/routes/chinaventure/router.js b/lib/routes/chinaventure/router.js index 335af3d090db76..6c0d57b8ae5f64 100644 --- a/lib/routes/chinaventure/router.js +++ b/lib/routes/chinaventure/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:id?', './index'); }; diff --git a/lib/routes/chinawriter/index.js b/lib/routes/chinawriter/index.js index 3de621d2981202..53a23473957c1b 100644 --- a/lib/routes/chinawriter/index.js +++ b/lib/routes/chinawriter/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 40; diff --git a/lib/routes/chinawriter/router.js b/lib/routes/chinawriter/router.js index ee20bcfbc723a9..b00fca600581a1 100644 --- a/lib/routes/chinawriter/router.js +++ b/lib/routes/chinawriter/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id*', './'); }; diff --git a/lib/routes/chsi/hotnews.js b/lib/routes/chsi/hotnews.js index a63eff722c4ca0..dbe53e8353e6d1 100644 --- a/lib/routes/chsi/hotnews.js +++ b/lib/routes/chsi/hotnews.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'https://yz.chsi.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(host); const $ = load(response.data); const list = $('.focus-part .index-hot a'); diff --git a/lib/routes/chsi/kydt.js b/lib/routes/chsi/kydt.js index 80bf1c2c934f4f..06c4d3ca19b33d 100644 --- a/lib/routes/chsi/kydt.js +++ b/lib/routes/chsi/kydt.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'https://yz.chsi.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(`${host}/kyzx/kydt`); const $ = load(response.data); diff --git a/lib/routes/chsi/kyzx.js b/lib/routes/chsi/kyzx.js index 45bd73aa2fb92d..61a360270d5f2a 100644 --- a/lib/routes/chsi/kyzx.js +++ b/lib/routes/chsi/kyzx.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'https://yz.chsi.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type } = ctx.req.param(); const response = await got(`${host}/kyzx/${type}`); const $ = load(response.data); diff --git a/lib/routes/chsi/router.js b/lib/routes/chsi/router.js index 6b650ba4486988..841b649dea1836 100644 --- a/lib/routes/chsi/router.js +++ b/lib/routes/chsi/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/hotnews', './hotnews'); router.get('/kydt', './kydt'); router.get('/kyzx/:type', './kyzx'); diff --git a/lib/routes/chuanliu/nice.js b/lib/routes/chuanliu/nice.js index e0a3ae3011b465..f8c9d83e68cdda 100644 --- a/lib/routes/chuanliu/nice.js +++ b/lib/routes/chuanliu/nice.js @@ -7,7 +7,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 100; const rootUrl = 'https://chuanliu.org'; diff --git a/lib/routes/chuanliu/router.js b/lib/routes/chuanliu/router.js index 87d6590b48e011..eeaf8279b4747c 100644 --- a/lib/routes/chuanliu/router.js +++ b/lib/routes/chuanliu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/nice', './nice'); }; diff --git a/lib/routes/cib/router.js b/lib/routes/cib/router.js index de958e2e6cb021..11abba62a3f623 100644 --- a/lib/routes/cib/router.js +++ b/lib/routes/cib/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/whpj/:format?', './whpj'); }; diff --git a/lib/routes/cib/whpj.js b/lib/routes/cib/whpj.js index 2da9b3428976d0..689b6c5cb8dbc3 100644 --- a/lib/routes/cib/whpj.js +++ b/lib/routes/cib/whpj.js @@ -6,7 +6,7 @@ const https = require('https'); const crypto = require('crypto'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { // fix unsafe legacy renegotiation disabled const agent = new https.Agent({ secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT, diff --git a/lib/routes/ciidbnu/index.js b/lib/routes/ciidbnu/index.js index 224a76766962b0..97c415314d523e 100644 --- a/lib/routes/ciidbnu/index.js +++ b/lib/routes/ciidbnu/index.js @@ -5,7 +5,7 @@ const iconv = require('iconv-lite'); import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '1'; const rootUrl = 'http://www.ciidbnu.org'; diff --git a/lib/routes/ciidbnu/router.js b/lib/routes/ciidbnu/router.js index e0420d96132fea..28cef7111ec14a 100644 --- a/lib/routes/ciidbnu/router.js +++ b/lib/routes/ciidbnu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id?', './index'); }; diff --git a/lib/routes/civitai/discussions.js b/lib/routes/civitai/discussions.js index 84008957248b0e..16deacddb43b6c 100644 --- a/lib/routes/civitai/discussions.js +++ b/lib/routes/civitai/discussions.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = ctx.req.param(); const modelId = Number.parseInt(params.modelId); diff --git a/lib/routes/civitai/models.js b/lib/routes/civitai/models.js index 455a33773b5685..0e66db68bedcd2 100644 --- a/lib/routes/civitai/models.js +++ b/lib/routes/civitai/models.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got(`https://civitai.com/api/v1/models`, { searchParams: { limit: 20, diff --git a/lib/routes/civitai/router.js b/lib/routes/civitai/router.js index a2ea0202396d53..6ece3b6baa8a49 100644 --- a/lib/routes/civitai/router.js +++ b/lib/routes/civitai/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/models', './models'); router.get('/discussions/:modelId', './discussions'); }; diff --git a/lib/routes/ciweimao/chapter.js b/lib/routes/ciweimao/chapter.js index 6a20367845ff27..d93a94ceab7cab 100644 --- a/lib/routes/ciweimao/chapter.js +++ b/lib/routes/ciweimao/chapter.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param.get('id'); const limit = Number.parseInt(ctx.req.query('limit')) || 10; diff --git a/lib/routes/ciweimao/router.js b/lib/routes/ciweimao/router.js index 81d0ce005f570c..bf5f0b92e5d9ed 100644 --- a/lib/routes/ciweimao/router.js +++ b/lib/routes/ciweimao/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/chapter/:id', require('./chapter')); }; diff --git a/lib/routes/clickme/index.js b/lib/routes/clickme/index.js index 49d4978b2f6d2b..95926ceb590239 100644 --- a/lib/routes/clickme/index.js +++ b/lib/routes/clickme/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const site = ctx.req.param('site') === 'r18' ? 'r18' : ''; const grouping = ctx.req.param('grouping') === 'tag' ? 'tag' : 'category'; const name = ctx.req.param('name'); diff --git a/lib/routes/clickme/router.js b/lib/routes/clickme/router.js index 78fe3011905cb2..e3e7278484b751 100644 --- a/lib/routes/clickme/router.js +++ b/lib/routes/clickme/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:site/:grouping/:name', './index'); }; diff --git a/lib/routes/cloudnative/blog.js b/lib/routes/cloudnative/blog.js index 179b310d23c3f4..2ff6f9d14cbc87 100644 --- a/lib/routes/cloudnative/blog.js +++ b/lib/routes/cloudnative/blog.js @@ -24,7 +24,7 @@ async function getArticles() { }); } -module.exports = async (ctx) => { +export default async (ctx) => { const articles = await getArticles(); ctx.set('data', { title: '博客 | 云原生社区(中国)', diff --git a/lib/routes/cloudnative/router.js b/lib/routes/cloudnative/router.js index e08aa776942a77..da5910733e49ed 100644 --- a/lib/routes/cloudnative/router.js +++ b/lib/routes/cloudnative/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog', './blog'); }; diff --git a/lib/routes/cls/depth.js b/lib/routes/cls/depth.js index 31a1fe28a9c78e..90c66ec78e8c00 100644 --- a/lib/routes/cls/depth.js +++ b/lib/routes/cls/depth.js @@ -25,7 +25,7 @@ const categories = { 1176: '投教', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '1000'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; diff --git a/lib/routes/cls/hot.js b/lib/routes/cls/hot.js index d0e42984226b10..7bdc514aaeeadb 100644 --- a/lib/routes/cls/hot.js +++ b/lib/routes/cls/hot.js @@ -7,7 +7,7 @@ import * as path from 'node:path'; const { rootUrl, getSearchParams } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; const apiUrl = `${rootUrl}/v2/article/hot/list`; diff --git a/lib/routes/cls/router.js b/lib/routes/cls/router.js index ba575a18e1e6dc..3ec3224465b7cf 100644 --- a/lib/routes/cls/router.js +++ b/lib/routes/cls/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/depth/:category?', './depth'); router.get('/hot', './hot'); router.get('/telegraph/:category?', './telegraph'); diff --git a/lib/routes/cls/telegraph.js b/lib/routes/cls/telegraph.js index df5c5932744886..6915ae34cd9644 100644 --- a/lib/routes/cls/telegraph.js +++ b/lib/routes/cls/telegraph.js @@ -16,7 +16,7 @@ const categories = { hk: '港股', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; diff --git a/lib/routes/cma/channel.js b/lib/routes/cma/channel.js index 19e00b0d1ad89c..e30b515175e02e 100644 --- a/lib/routes/cma/channel.js +++ b/lib/routes/cma/channel.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = '380' } = ctx.req.param(); const author = '中国气象局·天气预报'; diff --git a/lib/routes/cma/router.js b/lib/routes/cma/router.js index 2bc54d13027620..f067105bdbf5d1 100644 --- a/lib/routes/cma/router.js +++ b/lib/routes/cma/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/channel/:id?', './channel'); }; diff --git a/lib/routes/cmde/index.js b/lib/routes/cmde/index.js index d2435646c3a117..2e40d561043c56 100644 --- a/lib/routes/cmde/index.js +++ b/lib/routes/cmde/index.js @@ -6,7 +6,7 @@ import puppeteer from '@/utils/puppeteer'; const rootURL = 'https://www.cmde.org.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const cate = ctx.req.param('cate') ?? 'xwdt/zxyw'; const url = `${rootURL}/${cate}/`; const browser = await puppeteer({ stealth: true }); diff --git a/lib/routes/cmde/router.js b/lib/routes/cmde/router.js index af1fc16e312b9e..d78ef6be000f48 100644 --- a/lib/routes/cmde/router.js +++ b/lib/routes/cmde/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:cate*', './index'); }; diff --git a/lib/routes/cmpxchg8b/articles.js b/lib/routes/cmpxchg8b/articles.js index a7252a003bbad3..4b3e22ea74d421 100644 --- a/lib/routes/cmpxchg8b/articles.js +++ b/lib/routes/cmpxchg8b/articles.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; const baseUrl = 'https://lock.cmpxchg8b.com/'; const title = 'cmpxchg8b'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got(baseUrl); const $ = load(response); diff --git a/lib/routes/cmpxchg8b/router.js b/lib/routes/cmpxchg8b/router.js index 83c90bd9b516b0..9a797dbf8b5e62 100644 --- a/lib/routes/cmpxchg8b/router.js +++ b/lib/routes/cmpxchg8b/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/articles', './articles'); }; diff --git a/lib/routes/cn-healthcare/index.js b/lib/routes/cn-healthcare/index.js index 79e9a3eebf85a1..47201f03f94c68 100644 --- a/lib/routes/cn-healthcare/index.js +++ b/lib/routes/cn-healthcare/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.cn-healthcare.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: `${baseUrl}/api/article/articlelist?data={%22start%22:%221%22,%22size%22:%2250%22,%22arctype%22:%220%22,%22wmstart%22:%220%22,%22flag%22:%222%22}`, diff --git a/lib/routes/cn-healthcare/router.js b/lib/routes/cn-healthcare/router.js index 2d9095f937a3d5..5dc900cd258eb4 100644 --- a/lib/routes/cn-healthcare/router.js +++ b/lib/routes/cn-healthcare/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/index', './index'); }; diff --git a/lib/routes/cna/index.js b/lib/routes/cna/index.js index f628a642af88ec..54ff8dfd3e5978 100644 --- a/lib/routes/cna/index.js +++ b/lib/routes/cna/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') || 'aall'; const isTopic = /^\d+$/.test(id); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20; diff --git a/lib/routes/cna/router.js b/lib/routes/cna/router.js index 152674dd2e13e4..772e0c2869f23e 100644 --- a/lib/routes/cna/router.js +++ b/lib/routes/cna/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id?', './'); router.get('/web/:id?', './web/'); }; diff --git a/lib/routes/cna/web/index.js b/lib/routes/cna/web/index.js index 1723179ba086b4..412a4d036bd49e 100644 --- a/lib/routes/cna/web/index.js +++ b/lib/routes/cna/web/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') || 'aall'; const rootUrl = /^\d+$/.test(id) ? `https://www.cna.com.tw/topic/newstopic/${id}.aspx` : `https://www.cna.com.tw/list/${id}.aspx`; diff --git a/lib/routes/cnbc/router.js b/lib/routes/cnbc/router.js index b5ad68a74114dc..806f509d58c758 100644 --- a/lib/routes/cnbc/router.js +++ b/lib/routes/cnbc/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/rss/:id?', './rss'); }; diff --git a/lib/routes/cnbc/rss.js b/lib/routes/cnbc/rss.js index 0fd159e67dab0f..4348d5ba355e65 100644 --- a/lib/routes/cnbc/rss.js +++ b/lib/routes/cnbc/rss.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import parser from '@/utils/rss-parser'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = '100003114' } = ctx.req.param(); const feed = await parser.parseURL(`https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=${id}`); diff --git a/lib/routes/cnbeta/router.js b/lib/routes/cnbeta/router.js index 73bf5d64519f5b..1a464e16eaa4d5 100644 --- a/lib/routes/cnbeta/router.js +++ b/lib/routes/cnbeta/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type/:id', './type'); router.get('/', './type'); }; diff --git a/lib/routes/cnbeta/type.js b/lib/routes/cnbeta/type.js index 5d85e678f28e71..d1122ad8596f37 100644 --- a/lib/routes/cnbeta/type.js +++ b/lib/routes/cnbeta/type.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { type, id } = ctx.req.param(); const currentUrl = type ? `${rootUrl}/${type}/${id}.htm` : rootUrl; diff --git a/lib/routes/cnblogs/common.js b/lib/routes/cnblogs/common.js index 8a8e46b4df0331..cb6c82cad1f048 100644 --- a/lib/routes/cnblogs/common.js +++ b/lib/routes/cnblogs/common.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `https://www.cnblogs.com${getSubPath(ctx)}`; const response = await got(link); const data = response.data; diff --git a/lib/routes/cnblogs/router.js b/lib/routes/cnblogs/router.js index f091a5de226e19..bdc0146f73c350 100644 --- a/lib/routes/cnblogs/router.js +++ b/lib/routes/cnblogs/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/aggsite/topdiggs', './common'); router.get('/aggsite/topviews', './common'); router.get('/aggsite/headline', './common'); diff --git a/lib/routes/cncf/index.js b/lib/routes/cncf/index.js index 6a5036591d789d..e09a11683dd9de 100644 --- a/lib/routes/cncf/index.js +++ b/lib/routes/cncf/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootURL = 'https://www.cncf.io'; -module.exports = async (ctx) => { +export default async (ctx) => { const cate = ctx.req.param('cate') ?? 'blog'; const url = `${rootURL}/${cate}/`; diff --git a/lib/routes/cncf/reports.js b/lib/routes/cncf/reports.js index d825dbbcdacd05..4fb631623a1cdf 100644 --- a/lib/routes/cncf/reports.js +++ b/lib/routes/cncf/reports.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootURL = 'https://www.cncf.io'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${rootURL}/reports/`; const response = await got(url); diff --git a/lib/routes/cncf/router.js b/lib/routes/cncf/router.js index 971a6ae3c468a1..220528d80177f5 100644 --- a/lib/routes/cncf/router.js +++ b/lib/routes/cncf/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/reports', './reports'); router.get('/:cate?', './index'); }; diff --git a/lib/routes/cneb/router.js b/lib/routes/cneb/router.js index 7a2cc28f7b588e..5acb6bf57d37c5 100644 --- a/lib/routes/cneb/router.js +++ b/lib/routes/cneb/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/yjxw/:category?', './yjxw'); router.get('/yjxx/*', './yjxx'); }; diff --git a/lib/routes/cneb/yjxw.js b/lib/routes/cneb/yjxw.js index 6a69ed1e33cfd3..4a99c52dbec648 100644 --- a/lib/routes/cneb/yjxw.js +++ b/lib/routes/cneb/yjxw.js @@ -9,7 +9,7 @@ const indexs = { gjxw: 1, }; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 400; const category = ctx.req.param('category') ?? ''; diff --git a/lib/routes/cneb/yjxx.js b/lib/routes/cneb/yjxx.js index d56df7088ce581..2b96944c91e00c 100644 --- a/lib/routes/cneb/yjxx.js +++ b/lib/routes/cneb/yjxx.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 200; const options = decodeURI(getSubPath(ctx)) diff --git a/lib/routes/cngal/entry.js b/lib/routes/cngal/entry.js index fe35fcdeee4f24..d432c5bbdda11a 100644 --- a/lib/routes/cngal/entry.js +++ b/lib/routes/cngal/entry.js @@ -4,7 +4,7 @@ import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const entryId = ctx.req.param('id'); const response = await got(`https://www.cngal.org/api/entries/GetEntryView/${entryId}`); diff --git a/lib/routes/cngal/router.js b/lib/routes/cngal/router.js index 09531002290a2b..8034f2f1c51a69 100644 --- a/lib/routes/cngal/router.js +++ b/lib/routes/cngal/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/entry/:id', './entry'); router.get('/weekly', './weekly'); }; diff --git a/lib/routes/cngal/weekly.js b/lib/routes/cngal/weekly.js index 90e0af5a5e4e63..b1afab9433a605 100644 --- a/lib/routes/cngal/weekly.js +++ b/lib/routes/cngal/weekly.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://www.cngal.org/api/news/GetWeeklyNewsOverview'); ctx.set('data', { diff --git a/lib/routes/cnjxol/index.js b/lib/routes/cnjxol/index.js index 6ab3c88e8291c0..98d772d60baf72 100644 --- a/lib/routes/cnjxol/index.js +++ b/lib/routes/cnjxol/index.js @@ -10,7 +10,7 @@ const categories = { nhwb: '南湖晚报', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'jxrb'; const id = ctx.req.param('id'); if (!Object.keys(categories).includes(category)) { diff --git a/lib/routes/cnjxol/router.js b/lib/routes/cnjxol/router.js index 56b183011a03d5..053ae4cee08413 100644 --- a/lib/routes/cnjxol/router.js +++ b/lib/routes/cnjxol/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?/:id?', './index'); }; diff --git a/lib/routes/cnki/author.js b/lib/routes/cnki/author.js index 38e2607e8fc1b8..baee834445b13b 100644 --- a/lib/routes/cnki/author.js +++ b/lib/routes/cnki/author.js @@ -5,7 +5,7 @@ const utils = require('./utils'); const rootUrl = 'https://kns.cnki.net'; -module.exports = async (ctx) => { +export default async (ctx) => { const code = ctx.req.param('code'); const authorInfoUrl = `${rootUrl}/kcms/detail/knetsearch.aspx?sfield=au&code=${code}`; diff --git a/lib/routes/cnki/debut.js b/lib/routes/cnki/debut.js index 54287cfb815a1c..93581cf875fc67 100644 --- a/lib/routes/cnki/debut.js +++ b/lib/routes/cnki/debut.js @@ -7,7 +7,7 @@ import * as path from 'node:path'; const rootUrl = 'https://chn.oversea.cnki.net'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const journalUrl = `${rootUrl}/knavi/JournalDetail?pcode=CjFD&pykm=${name}`; diff --git a/lib/routes/cnki/journals.js b/lib/routes/cnki/journals.js index 20bc72f24579cb..aacd29ec9bf1cd 100644 --- a/lib/routes/cnki/journals.js +++ b/lib/routes/cnki/journals.js @@ -6,7 +6,7 @@ const { ProcessItem } = require('./utils'); const rootUrl = 'https://navi.cnki.net'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const journalUrl = `${rootUrl}/knavi/journals/${name}/detail`; const title = await got.get(journalUrl).then((res) => load(res.data)('head > title').text()); diff --git a/lib/routes/cnki/router.js b/lib/routes/cnki/router.js index c28fa3c4f7ef19..e8ee53fa5e3039 100644 --- a/lib/routes/cnki/router.js +++ b/lib/routes/cnki/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/journals/:name', './journals'); router.get('/journals/debut/:name', './debut'); router.get('/author/:code', './author'); diff --git a/lib/routes/cnljxh/index.js b/lib/routes/cnljxh/index.js index 8620e5d8f5ccb9..c508827e374d62 100644 --- a/lib/routes/cnljxh/index.js +++ b/lib/routes/cnljxh/index.js @@ -11,7 +11,7 @@ const defaultIds = { price: '299', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'news', id = Object.hasOwn(defaultIds, category) ? defaultIds[category] : '10' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/cnljxh/router.js b/lib/routes/cnljxh/router.js index 3190ab5e164c6f..611f80b11b9081 100644 --- a/lib/routes/cnljxh/router.js +++ b/lib/routes/cnljxh/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?/:id?', './'); }; diff --git a/lib/routes/cntheory/paper.js b/lib/routes/cntheory/paper.js index 8b42eb36be4376..72441f5c6bb4a9 100644 --- a/lib/routes/cntheory/paper.js +++ b/lib/routes/cntheory/paper.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://paper.cntheory.com'; diff --git a/lib/routes/cntheory/router.js b/lib/routes/cntheory/router.js index e7ee9aa57b3a9c..98a5ec9fb1b96a 100644 --- a/lib/routes/cntheory/router.js +++ b/lib/routes/cntheory/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/paper/:id?', './paper'); }; diff --git a/lib/routes/cntv/column.js b/lib/routes/cntv/column.js index 84e9655564353a..2c6edd825feb6b 100644 --- a/lib/routes/cntv/column.js +++ b/lib/routes/cntv/column.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('column'); const limit = isNaN(Number.parseInt(ctx.req.query('limit'))) ? 25 : Number.parseInt(ctx.req.query('limit')); diff --git a/lib/routes/cntv/router.js b/lib/routes/cntv/router.js index 01b75bbd29ea74..4929d9f60f9b2c 100644 --- a/lib/routes/cntv/router.js +++ b/lib/routes/cntv/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:column', './column'); }; diff --git a/lib/routes/codeforces/contests.js b/lib/routes/codeforces/contests.js index a2585f740e156d..5eb44250a213dd 100644 --- a/lib/routes/codeforces/contests.js +++ b/lib/routes/codeforces/contests.js @@ -13,7 +13,7 @@ const sec2str = (sec) => dayjs.duration(Number.parseInt(sec), 'seconds').humaniz const contestAPI = 'https://codeforces.com/api/contest.list'; -module.exports = async (ctx) => { +export default async (ctx) => { const contestsData = await got.get(contestAPI).json(); const contests = contestsData.result; diff --git a/lib/routes/codeforces/recent-actions.js b/lib/routes/codeforces/recent-actions.js index 0215d224056948..fa02d29a62efea 100644 --- a/lib/routes/codeforces/recent-actions.js +++ b/lib/routes/codeforces/recent-actions.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const minRating = ctx.req.param('minrating') || 1; const rsp = await got.get('https://codeforces.com/api/recentActions?maxCount=100').json(); diff --git a/lib/routes/codeforces/router.js b/lib/routes/codeforces/router.js index 013be054fc95ce..b79340dcac1250 100644 --- a/lib/routes/codeforces/router.js +++ b/lib/routes/codeforces/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/contests', './contests'); router.get('/recent-actions/:minrating?', './recent-actions'); }; diff --git a/lib/routes/coindesk/index.js b/lib/routes/coindesk/index.js index 242670ed33b4ff..f15faccc5663fa 100644 --- a/lib/routes/coindesk/index.js +++ b/lib/routes/coindesk/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const rootUrl = 'https://www.coindesk.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel') ?? 'consensus-magazine'; const response = await got.get(`${rootUrl}/${channel}/`); diff --git a/lib/routes/coindesk/router.js b/lib/routes/coindesk/router.js index 1b1b0636e2747d..10fa80c1dd2273 100644 --- a/lib/routes/coindesk/router.js +++ b/lib/routes/coindesk/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/consensus-magazine', './index'); }; diff --git a/lib/routes/comicat/router.js b/lib/routes/comicat/router.js index fd54ced0f61073..ccb09a9471aca0 100644 --- a/lib/routes/comicat/router.js +++ b/lib/routes/comicat/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/search/:keyword', './search'); }; diff --git a/lib/routes/comicat/search.js b/lib/routes/comicat/search.js index 23d19cc9b67f15..0c7d802086b1c7 100644 --- a/lib/routes/comicat/search.js +++ b/lib/routes/comicat/search.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://comicat.org'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const { data: response } = await got(`${baseUrl}/search.php?keyword=${encodeURIComponent(keyword)}`); const $ = load(response); diff --git a/lib/routes/comicskingdom/index.js b/lib/routes/comicskingdom/index.js index cc76466443a158..b9687b52f2be4a 100644 --- a/lib/routes/comicskingdom/index.js +++ b/lib/routes/comicskingdom/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseURL = 'https://comicskingdom.com'; const name = ctx.req.param('name'); const url = `${baseURL}/${name}/archive`; diff --git a/lib/routes/comicskingdom/router.js b/lib/routes/comicskingdom/router.js index 2a211958ddfead..e0d08ed1874fca 100644 --- a/lib/routes/comicskingdom/router.js +++ b/lib/routes/comicskingdom/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:name', './index'); }; diff --git a/lib/routes/consumer/index.js b/lib/routes/consumer/index.js index 35468b07fa4596..7283f7029b3138 100644 --- a/lib/routes/consumer/index.js +++ b/lib/routes/consumer/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'test'; const language = ctx.req.param('language') ?? 'tc'; const keyword = ctx.req.param('keyword') ?? ''; diff --git a/lib/routes/consumer/router.js b/lib/routes/consumer/router.js index 1d9c5508e44690..e237750dd3e7af 100644 --- a/lib/routes/consumer/router.js +++ b/lib/routes/consumer/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/shopping-guide/:category?/:language?', './shopping-guide'); router.get('/:category?/:language?/:keyword?', './index'); }; diff --git a/lib/routes/consumer/shopping-guide.js b/lib/routes/consumer/shopping-guide.js index 9bea67680eedf9..1bfe70d5ed99e0 100644 --- a/lib/routes/consumer/shopping-guide.js +++ b/lib/routes/consumer/shopping-guide.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'trivia', language = 'tc' } = ctx.req.param(); const rootUrl = 'https://www.consumer.org.hk'; const currentUrl = `${rootUrl}/${language}/shopping-guide/${category}`; diff --git a/lib/routes/cool18/index.js b/lib/routes/cool18/index.js index beba4f3fec34a1..7ce45f0c71863d 100644 --- a/lib/routes/cool18/index.js +++ b/lib/routes/cool18/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'bbs4'; const type = ctx.req.param('type') ?? ''; const keyword = ctx.req.param('keyword') ?? ''; diff --git a/lib/routes/cool18/router.js b/lib/routes/cool18/router.js index 08d5f62fedde86..8dc9e2e2c376c5 100644 --- a/lib/routes/cool18/router.js +++ b/lib/routes/cool18/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id?/:type?/:keyword?', './index'); }; diff --git a/lib/routes/coolapk/dyh.js b/lib/routes/coolapk/dyh.js index a69b8abdf20464..127bd410e2af20 100644 --- a/lib/routes/coolapk/dyh.js +++ b/lib/routes/coolapk/dyh.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const dyhId = ctx.req.param('dyhId'); const full_url = utils.base_url + `/v6/dyhArticle/list?dyhId=${dyhId}&type=all&page=1`; const r = await got(`${utils.base_url}/v6/dyh/detail?dyhId=${dyhId}`, { diff --git a/lib/routes/coolapk/hot.js b/lib/routes/coolapk/hot.js index 74ed06b680c258..9520e18b9fabe6 100644 --- a/lib/routes/coolapk/hot.js +++ b/lib/routes/coolapk/hot.js @@ -65,7 +65,7 @@ const getLinkAndTitle = (type, period) => { return res; }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'jrrm'; const period = ctx.req.param('period') || 'daily'; const { link, title } = getLinkAndTitle(type, period); diff --git a/lib/routes/coolapk/huati.js b/lib/routes/coolapk/huati.js index f718cbb1ae6fa7..6ed469db1144d8 100644 --- a/lib/routes/coolapk/huati.js +++ b/lib/routes/coolapk/huati.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const full_url = utils.base_url + `/v6/page/dataList?url=%23%2Ffeed%2FmultiTagFeedList%3FlistType%3Ddateline_desc%26tag=${tag}&title=%E6%9C%80%E6%96%B0%E5%8F%91%E5%B8%83&subTitle=&page=1`; const response = await got(full_url, { diff --git a/lib/routes/coolapk/router.js b/lib/routes/coolapk/router.js index 4dfb78005a0e2d..0d5b2da9b6ec32 100644 --- a/lib/routes/coolapk/router.js +++ b/lib/routes/coolapk/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/dyh/:dyhId', './dyh'); router.get('/huati/:tag', './huati'); router.get('/hot/:type?/:period?', './hot'); diff --git a/lib/routes/coolapk/toutiao.js b/lib/routes/coolapk/toutiao.js index fac7fb1a627c57..59b1674da08e44 100644 --- a/lib/routes/coolapk/toutiao.js +++ b/lib/routes/coolapk/toutiao.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'history'; const urls = { history: { diff --git a/lib/routes/coolapk/tuwen.js b/lib/routes/coolapk/tuwen.js index 9486a9c06cecbe..60f5a37bba9f1b 100644 --- a/lib/routes/coolapk/tuwen.js +++ b/lib/routes/coolapk/tuwen.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'hot'; let full_url, feedTitle; if (ctx.originalUrl.startsWith(`/coolapk/tuwen-xinxian`) || type === 'latest') { diff --git a/lib/routes/coolapk/user-dynamic.js b/lib/routes/coolapk/user-dynamic.js index ad5f6eb97627c9..57d2da0bbac24c 100644 --- a/lib/routes/coolapk/user-dynamic.js +++ b/lib/routes/coolapk/user-dynamic.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const full_url = utils.base_url + `/v6/user/feedList?uid=${uid}&page=1&showAnonymous=0&isIncludeTop=1&showDoing=1`; let username; diff --git a/lib/routes/coomer/artist.js b/lib/routes/coomer/artist.js index 0e3d64a08e6d3c..bfb1aac105c84c 100644 --- a/lib/routes/coomer/artist.js +++ b/lib/routes/coomer/artist.js @@ -1,6 +1,6 @@ const fetchItems = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const currentUrl = `onlyfans/user/${id}`; diff --git a/lib/routes/coomer/posts.js b/lib/routes/coomer/posts.js index 52e12d77e7b320..4d0fd2d2d133d6 100644 --- a/lib/routes/coomer/posts.js +++ b/lib/routes/coomer/posts.js @@ -1,6 +1,6 @@ const fetchItems = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = 'posts'; ctx.set('data', await fetchItems(ctx, currentUrl)); diff --git a/lib/routes/coomer/router.js b/lib/routes/coomer/router.js index d9b312005db885..86e018dfec5faf 100644 --- a/lib/routes/coomer/router.js +++ b/lib/routes/coomer/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/artist/:id', './artist'); router.get('/posts', './posts'); }; diff --git a/lib/routes/copymanga/comic.js b/lib/routes/copymanga/comic.js index b39c207b5e0aa7..b8665610a1c96b 100644 --- a/lib/routes/copymanga/comic.js +++ b/lib/routes/copymanga/comic.js @@ -7,7 +7,7 @@ import * as path from 'node:path'; import { config } from '@/config'; const asyncPool = require('tiny-async-pool'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); // 用于控制返回的章节数量 const chapterCnt = Number(ctx.req.param('chapterCnt') || 10); diff --git a/lib/routes/copymanga/router.js b/lib/routes/copymanga/router.js index 99f7d042656bf8..1bc6a3f6b08b30 100644 --- a/lib/routes/copymanga/router.js +++ b/lib/routes/copymanga/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/comic/:id/:chapterCnt?', './comic'); }; diff --git a/lib/routes/cpcey/index.js b/lib/routes/cpcey/index.js index 48614260a0f202..990ed2b4458b71 100644 --- a/lib/routes/cpcey/index.js +++ b/lib/routes/cpcey/index.js @@ -16,7 +16,7 @@ const typeMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'xwg'; const url = rootUrl + typeMap[type].url; diff --git a/lib/routes/cpcey/router.js b/lib/routes/cpcey/router.js index 47ce2498dc8532..6fd05f06e15564 100644 --- a/lib/routes/cpcey/router.js +++ b/lib/routes/cpcey/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?', './index'); }; diff --git a/lib/routes/cpuid/news.js b/lib/routes/cpuid/news.js index 208726a8204c28..ffebecddfd1d9d 100644 --- a/lib/routes/cpuid/news.js +++ b/lib/routes/cpuid/news.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const newsUrl = 'https://www.cpuid.com/news.html'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(newsUrl); const $ = load(response.data); diff --git a/lib/routes/cpuid/router.js b/lib/routes/cpuid/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/cpuid/router.js +++ b/lib/routes/cpuid/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/cqgas/router.js b/lib/routes/cqgas/router.js index 79e4bbf4add05b..e460f3080382b0 100644 --- a/lib/routes/cqgas/router.js +++ b/lib/routes/cqgas/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/tqtz', './tqtz'); }; diff --git a/lib/routes/cqgas/tqtz.js b/lib/routes/cqgas/tqtz.js index 6551c4e3071c30..5c29e60f158c24 100644 --- a/lib/routes/cqgas/tqtz.js +++ b/lib/routes/cqgas/tqtz.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const url = 'http://www.cqgas.cn/portal/article/page?cateId=1082&pageNo=1'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got(url); const $ = load(response); const contentUrl = (id) => `http://www.cqgas.cn/portal/article/content?contentId=${id}`; diff --git a/lib/routes/cqwu/index.js b/lib/routes/cqwu/index.js index 81dd31b33d763f..2030bfd425b10d 100644 --- a/lib/routes/cqwu/index.js +++ b/lib/routes/cqwu/index.js @@ -13,7 +13,7 @@ const titleMap = { academiceve: '学术活动', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'academiceve'; const link = host + map[type]; const title = '重文理' + titleMap[type] + '公告'; diff --git a/lib/routes/cqwu/router.js b/lib/routes/cqwu/router.js index a19819fc81b70a..43e7c58a8c1e5b 100644 --- a/lib/routes/cqwu/router.js +++ b/lib/routes/cqwu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:type?', './index'); }; diff --git a/lib/routes/crac/index.js b/lib/routes/crac/index.js index 82329f33babc87..e75fbd6e30464d 100644 --- a/lib/routes/crac/index.js +++ b/lib/routes/crac/index.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://www.crac.org.cn'; const type = ctx.req.param('type'); const link = type ? `${baseUrl}/News/List?type=${type}` : `${baseUrl}/News/List`; diff --git a/lib/routes/crac/router.js b/lib/routes/crac/router.js index 47ce2498dc8532..6fd05f06e15564 100644 --- a/lib/routes/crac/router.js +++ b/lib/routes/crac/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?', './index'); }; diff --git a/lib/routes/creative-comic/book.js b/lib/routes/creative-comic/book.js index 495563bf9fbf0f..8cdb87864c0aac 100644 --- a/lib/routes/creative-comic/book.js +++ b/lib/routes/creative-comic/book.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { getUuid, getBook, getChapter, getChapters, getImgEncrypted, getImgKey, decrypt, getRealKey, siteHost } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, coverOnly = 'true', quality = '1' } = ctx.req.param(); const uuid = await getUuid(cache.tryGet); const { diff --git a/lib/routes/creative-comic/router.js b/lib/routes/creative-comic/router.js index 59c55af9a8bdcf..bed4f0ea27993d 100644 --- a/lib/routes/creative-comic/router.js +++ b/lib/routes/creative-comic/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/book/:id/:coverOnly?/:quality?', './book'); }; diff --git a/lib/routes/crossbell/feeds/following.js b/lib/routes/crossbell/feeds/following.js index 8ee02b4fd3eddf..05675bf2749c9c 100644 --- a/lib/routes/crossbell/feeds/following.js +++ b/lib/routes/crossbell/feeds/following.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const characterId = ctx.req.param('characterId'); const response = await got(`https://indexer.crossbell.io/v1/characters/${characterId}/feed/follow`); ctx.set('data', { diff --git a/lib/routes/crossbell/notes/character.js b/lib/routes/crossbell/notes/character.js index 25fed9b4754eb4..85559835567566 100644 --- a/lib/routes/crossbell/notes/character.js +++ b/lib/routes/crossbell/notes/character.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { getItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const characterId = ctx.req.param('characterId'); const response = await got('https://indexer.crossbell.io/v1/notes', { diff --git a/lib/routes/crossbell/notes/index.js b/lib/routes/crossbell/notes/index.js index c25fb54b02dc0d..b5fdd0b02dab25 100644 --- a/lib/routes/crossbell/notes/index.js +++ b/lib/routes/crossbell/notes/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { getItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://indexer.crossbell.io/v1/notes', { searchParams: { includeCharacter: true, diff --git a/lib/routes/crossbell/notes/source.js b/lib/routes/crossbell/notes/source.js index f008755dfb0315..5be0ed8cc7e52f 100644 --- a/lib/routes/crossbell/notes/source.js +++ b/lib/routes/crossbell/notes/source.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { getItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const source = ctx.req.param('source'); const response = await got('https://indexer.crossbell.io/v1/notes', { diff --git a/lib/routes/crossbell/router.js b/lib/routes/crossbell/router.js index 2334d3e4e63f04..742ac57c2a35d1 100644 --- a/lib/routes/crossbell/router.js +++ b/lib/routes/crossbell/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/notes/character/:characterId', './notes/character'); router.get('/notes/source/:source', './notes/source'); router.get('/notes', './notes/index'); diff --git a/lib/routes/cs/index.js b/lib/routes/cs/index.js index 2f2d694cb76ccf..3c447e720321ce 100644 --- a/lib/routes/cs/index.js +++ b/lib/routes/cs/index.js @@ -12,7 +12,7 @@ const decodeBufferByCharset = (buffer) => { return iconv.decode(buffer, encoding); }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'xwzx' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/cs/router.js b/lib/routes/cs/router.js index 9fc19339d4f654..f994ea4a8051c9 100644 --- a/lib/routes/cs/router.js +++ b/lib/routes/cs/router.js @@ -5,7 +5,7 @@ const toZzkx = (ctx) => { ctx.redirect(redirectTo); }; -module.exports = (router) => { +export default (router) => { router.get('/news/zzkx', toZzkx); router.get('/zzkx', toZzkx); router.get('/video/:category?', './video'); diff --git a/lib/routes/cs/video.js b/lib/routes/cs/video.js index 340386363fe3ec..26e9832abc9c8a 100644 --- a/lib/routes/cs/video.js +++ b/lib/routes/cs/video.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '今日聚焦' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/csdn/blog.js b/lib/routes/csdn/blog.js index 5779100ae80da4..6c806bd0e67542 100644 --- a/lib/routes/csdn/blog.js +++ b/lib/routes/csdn/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import rssParser from '@/utils/rss-parser'; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const rootUrl = 'https://blog.csdn.net'; diff --git a/lib/routes/csdn/router.js b/lib/routes/csdn/router.js index 54cc6456e1f56e..ca3e65042d0cb4 100644 --- a/lib/routes/csdn/router.js +++ b/lib/routes/csdn/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:user', './blog'); }; diff --git a/lib/routes/cssn/iolaw.js b/lib/routes/cssn/iolaw.js index 6da147060fe9cf..f51c2d8a20460c 100644 --- a/lib/routes/cssn/iolaw.js +++ b/lib/routes/cssn/iolaw.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const section = ctx.req.param('section') ?? 'zxzp'; const domain = 'iolaw.cssn.cn'; const response = await got(`http://${domain}/${section}/`); diff --git a/lib/routes/cssn/router.js b/lib/routes/cssn/router.js index 804dfa6c2d1052..4dcbeea03f58b8 100644 --- a/lib/routes/cssn/router.js +++ b/lib/routes/cssn/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/iolaw/:section?', './iolaw'); }; diff --git a/lib/routes/cste/index.js b/lib/routes/cste/index.js index 1746c320111f10..10435700322e21 100644 --- a/lib/routes/cste/index.js +++ b/lib/routes/cste/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '16'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10; diff --git a/lib/routes/cste/router.js b/lib/routes/cste/router.js index c34676efd9b9eb..28cef7111ec14a 100644 --- a/lib/routes/cste/router.js +++ b/lib/routes/cste/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id?', './index'); }; diff --git a/lib/routes/csu/career.js b/lib/routes/csu/career.js index 5a0f986c568bc0..a125dfc524c5ad 100644 --- a/lib/routes/csu/career.js +++ b/lib/routes/csu/career.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { unzip } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://career.csu.edu.cn'; const link = `${baseUrl}/campus/index/category/1`; const { data: response } = await got(link); diff --git a/lib/routes/csu/cse.js b/lib/routes/csu/cse.js index cf1c90e4e11cad..57553ccd9ef7fd 100644 --- a/lib/routes/csu/cse.js +++ b/lib/routes/csu/cse.js @@ -13,7 +13,7 @@ async function fetch(address) { }; } -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://cse.csu.edu.cn/index/'; const type = ctx.req.param('type') ?? 'tzgg'; const link = url + type + '.htm'; diff --git a/lib/routes/csu/mail.js b/lib/routes/csu/mail.js index f3be3558f1881f..46de38c93217d2 100644 --- a/lib/routes/csu/mail.js +++ b/lib/routes/csu/mail.js @@ -10,7 +10,7 @@ async function fetch(address) { return $('.tb-ct-info').html(); } -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://oa.csu.edu.cn'; const { type = '01' } = ctx.req.param(); const link = `${baseUrl}/mailbox/NoAuth/MailList_Pub?tp=${type}`; diff --git a/lib/routes/csu/router.js b/lib/routes/csu/router.js index 189dcb92f69840..eab313fbe7d47b 100644 --- a/lib/routes/csu/router.js +++ b/lib/routes/csu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/career', './career'); router.get('/cse/:type?', './cse'); router.get('/mail/:type?', './mail'); diff --git a/lib/routes/cts/news.js b/lib/routes/cts/news.js index f5e6937eb6aa8e..dc4557e3f838fb 100644 --- a/lib/routes/cts/news.js +++ b/lib/routes/cts/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const asyncPool = require('tiny-async-pool'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const currentUrl = `https://news.cts.com.tw/${category}/index.html`; const response = await got(currentUrl); diff --git a/lib/routes/cts/router.js b/lib/routes/cts/router.js index b8b9026e85000d..3eb67b2b4e1295 100644 --- a/lib/routes/cts/router.js +++ b/lib/routes/cts/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category', './news'); }; diff --git a/lib/routes/cuc/router.js b/lib/routes/cuc/router.js index 895ce569ec0263..462d4b218d89f9 100644 --- a/lib/routes/cuc/router.js +++ b/lib/routes/cuc/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/yz', './yz'); }; diff --git a/lib/routes/cuc/yz.js b/lib/routes/cuc/yz.js index b6bb67c4903c96..7e094ab36d5135 100644 --- a/lib/routes/cuc/yz.js +++ b/lib/routes/cuc/yz.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; /* 研究生招生网通知公告*/ -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://yz.cuc.edu.cn'; const link = `${host}/8549/list.htm`; const response = await got({ diff --git a/lib/routes/curiouscat/router.js b/lib/routes/curiouscat/router.js index ed709f330aa29a..a7fbaa70aa8a1e 100644 --- a/lib/routes/curiouscat/router.js +++ b/lib/routes/curiouscat/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/user/:id', './user'); }; diff --git a/lib/routes/curiouscat/user.js b/lib/routes/curiouscat/user.js index f6c553e45b1d06..0814992c0c7c47 100644 --- a/lib/routes/curiouscat/user.js +++ b/lib/routes/curiouscat/user.js @@ -6,7 +6,7 @@ const fetchAPIByUser = async (user) => { return data; }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const user = id; const data = await fetchAPIByUser(user); diff --git a/lib/routes/curius/links.js b/lib/routes/curius/links.js index c7b9995ad1c034..23fc07ba25eb34 100644 --- a/lib/routes/curius/links.js +++ b/lib/routes/curius/links.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const username = ctx.req.param('name'); const name_response = await got(`https://curius.app/api/users/${username}`, { diff --git a/lib/routes/curius/router.js b/lib/routes/curius/router.js index 646d5210e4a1bc..30fd063164f251 100644 --- a/lib/routes/curius/router.js +++ b/lib/routes/curius/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/links/:name', './links'); }; diff --git a/lib/routes/cw/author.js b/lib/routes/cw/author.js index c2107f7a85d310..991f3912b1b229 100644 --- a/lib/routes/cw/author.js +++ b/lib/routes/cw/author.js @@ -1,7 +1,7 @@ const { baseUrl, parsePage } = require('./utils'); import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const browser = await puppeteer(); const { $, items } = await parsePage('author', browser, ctx); diff --git a/lib/routes/cw/master.js b/lib/routes/cw/master.js index f566072145a5bd..86665fb6e0387c 100644 --- a/lib/routes/cw/master.js +++ b/lib/routes/cw/master.js @@ -1,7 +1,7 @@ const { baseUrl, parsePage } = require('./utils'); import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const browser = await puppeteer(); const { $, items } = await parsePage('master', browser, ctx); diff --git a/lib/routes/cw/router.js b/lib/routes/cw/router.js index 16d8df1bbff44e..3d716907febcc1 100644 --- a/lib/routes/cw/router.js +++ b/lib/routes/cw/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/author/:channel', './author'); router.get('/master/:channel', './master'); router.get('/sub/:channel', './sub'); diff --git a/lib/routes/cw/sub.js b/lib/routes/cw/sub.js index 46449992b06c0f..ddd9308f0fecd0 100644 --- a/lib/routes/cw/sub.js +++ b/lib/routes/cw/sub.js @@ -1,7 +1,7 @@ const { baseUrl, parsePage } = require('./utils'); import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const browser = await puppeteer(); const { $, items } = await parsePage('sub', browser, ctx); diff --git a/lib/routes/cw/today.js b/lib/routes/cw/today.js index a31f1d2cd7208b..d78893fc0aa1ff 100644 --- a/lib/routes/cw/today.js +++ b/lib/routes/cw/today.js @@ -1,7 +1,7 @@ const { baseUrl, parsePage } = require('./utils'); import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const browser = await puppeteer(); const { $, items } = await parsePage('today', browser, ctx); diff --git a/lib/routes/cyzone/author.js b/lib/routes/cyzone/author.js index caaf8acac9b7d5..2f9b2e0d9e5abb 100644 --- a/lib/routes/cyzone/author.js +++ b/lib/routes/cyzone/author.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, apiRootUrl, processItems, getInfo } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 5; diff --git a/lib/routes/cyzone/index.js b/lib/routes/cyzone/index.js index 009bbc834ba609..c3f8923162bb77 100644 --- a/lib/routes/cyzone/index.js +++ b/lib/routes/cyzone/index.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, apiRootUrl, processItems, getInfo } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id = 'news' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 5; diff --git a/lib/routes/cyzone/label.js b/lib/routes/cyzone/label.js index 42f020d91108d8..5ba631b1edbde8 100644 --- a/lib/routes/cyzone/label.js +++ b/lib/routes/cyzone/label.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, apiRootUrl, processItems, getInfo } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 5; diff --git a/lib/routes/cyzone/router.js b/lib/routes/cyzone/router.js index 63e2a2ab17fdd6..3ced832a5d7bcf 100644 --- a/lib/routes/cyzone/router.js +++ b/lib/routes/cyzone/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/author/:id', './author'); router.get('/channel/:id?', './'); router.get('/label/:name', './label'); diff --git a/lib/routes/cztv/daily.js b/lib/routes/cztv/daily.js index e55ba6d7fb3106..fb9044fd064baf 100644 --- a/lib/routes/cztv/daily.js +++ b/lib/routes/cztv/daily.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; const renderDesc = (item) => art(path.join(__dirname, 'templates/daily.art'), item); -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'http://www.cztv.com/videos/zjxwlb'; const { data: res } = await got(url); diff --git a/lib/routes/cztv/router.js b/lib/routes/cztv/router.js index 9ee95834fde465..67ca83c08d55dd 100644 --- a/lib/routes/cztv/router.js +++ b/lib/routes/cztv/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/zjxwlb', './zjxwlb'); router.get('/zjxwlb/daily', './daily'); }; diff --git a/lib/routes/cztv/zjxwlb.js b/lib/routes/cztv/zjxwlb.js index dc358986d3d6b8..5b2264ae0ebc9d 100644 --- a/lib/routes/cztv/zjxwlb.js +++ b/lib/routes/cztv/zjxwlb.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; const renderDesc = (item) => art(path.join(__dirname, 'templates/zjxwlb.art'), item); -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'http://www.cztv.com/videos/zjxwlb'; const { data: res } = await got(url); diff --git a/lib/routes/dahecube/index.js b/lib/routes/dahecube/index.js index d911f6629c6786..e7cab19c7e4fc8 100644 --- a/lib/routes/dahecube/index.js +++ b/lib/routes/dahecube/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const utils = require('./utils'); const { TYPE, parseUrl } = utils; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'recommend'; const params = JSON.stringify({ channelid: TYPE[type].id, diff --git a/lib/routes/dahecube/router.js b/lib/routes/dahecube/router.js index 47ce2498dc8532..6fd05f06e15564 100644 --- a/lib/routes/dahecube/router.js +++ b/lib/routes/dahecube/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?', './index'); }; diff --git a/lib/routes/daily/discussed.js b/lib/routes/daily/discussed.js index 0e0ec2a542f30a..02d30d447426d1 100644 --- a/lib/routes/daily/discussed.js +++ b/lib/routes/daily/discussed.js @@ -56,7 +56,7 @@ const graphqlQuery = { variables, }; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://app.daily.dev/discussed'; const data = await getData(graphqlQuery); const list = getList(data); diff --git a/lib/routes/daily/index.js b/lib/routes/daily/index.js index d469ebcd1ac25b..95e4ed8391c86b 100644 --- a/lib/routes/daily/index.js +++ b/lib/routes/daily/index.js @@ -66,7 +66,7 @@ const graphqlQuery = { variables, }; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://app.daily.dev/popular'; const data = await getData(graphqlQuery); const list = getList(data); diff --git a/lib/routes/daily/router.js b/lib/routes/daily/router.js index 696459adc37d4a..4e49cd94e6bc7d 100644 --- a/lib/routes/daily/router.js +++ b/lib/routes/daily/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/discussed', './discussed'); router.get('/upvoted', './upvoted'); diff --git a/lib/routes/daily/upvoted.js b/lib/routes/daily/upvoted.js index f595a54ab8fba7..ba08a20704044e 100644 --- a/lib/routes/daily/upvoted.js +++ b/lib/routes/daily/upvoted.js @@ -60,7 +60,7 @@ const graphqlQuery = { variables, }; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://app.daily.dev/upvoted'; const data = await getData(graphqlQuery); const list = getList(data); diff --git a/lib/routes/damai/activity.js b/lib/routes/damai/activity.js index 4cfdf814f7d48c..fbb70d93e66567 100644 --- a/lib/routes/damai/activity.js +++ b/lib/routes/damai/activity.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const city = ctx.req.param('city') === '全部' ? '' : ctx.req.param('city'); const category = ctx.req.param('category') === '全部' ? '' : ctx.req.param('category'); const subcategory = ctx.req.param('subcategory') === '全部' ? '' : ctx.req.param('subcategory'); diff --git a/lib/routes/damai/router.js b/lib/routes/damai/router.js index bfc3fcad3cea83..31e02da6985fda 100644 --- a/lib/routes/damai/router.js +++ b/lib/routes/damai/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/activity/:city/:category/:subcategory/:keyword?', './activity'); }; diff --git a/lib/routes/dapenti/router.js b/lib/routes/dapenti/router.js index b43ac2fed32bb0..acf4f77ed5d6ef 100644 --- a/lib/routes/dapenti/router.js +++ b/lib/routes/dapenti/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/tugua', './tugua'); router.get('/subject/:id', './subject'); }; diff --git a/lib/routes/dapenti/subject.js b/lib/routes/dapenti/subject.js index 981bc29b6956a1..f6059dca5cb638 100644 --- a/lib/routes/dapenti/subject.js +++ b/lib/routes/dapenti/subject.js @@ -1,5 +1,5 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { ctx.set('data', await utils.parseFeed({ subjectid: ctx.req.param('id') })); }; diff --git a/lib/routes/dapenti/tugua.js b/lib/routes/dapenti/tugua.js index d16a816d3ba623..753605c6e2a589 100644 --- a/lib/routes/dapenti/tugua.js +++ b/lib/routes/dapenti/tugua.js @@ -1,5 +1,5 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { ctx.set('data', await utils.parseFeed({ subjectid: 70 })); }; diff --git a/lib/routes/darwinawards/index.js b/lib/routes/darwinawards/index.js index c9a463ef9174a8..6d8ad29b5ed9a1 100644 --- a/lib/routes/darwinawards/index.js +++ b/lib/routes/darwinawards/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://darwinawards.com'; const currentUrl = `${rootUrl}/darwin/`; diff --git a/lib/routes/darwinawards/router.js b/lib/routes/darwinawards/router.js index c97a6976c367f7..b89a202c16f825 100644 --- a/lib/routes/darwinawards/router.js +++ b/lib/routes/darwinawards/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/all', './index'); router.get('/', './index'); }; diff --git a/lib/routes/dayanzai/index.js b/lib/routes/dayanzai/index.js index 4f20efa98b172f..ef9b4e2f991f79 100644 --- a/lib/routes/dayanzai/index.js +++ b/lib/routes/dayanzai/index.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const rootUrl = 'http://www.dayanzai.me/'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category, fulltext } = ctx.req.param(); const currentUrl = rootUrl + category; const response = await got.get(currentUrl); diff --git a/lib/routes/dayanzai/router.js b/lib/routes/dayanzai/router.js index e9c52c6aa38a6a..e533a250a72d46 100644 --- a/lib/routes/dayanzai/router.js +++ b/lib/routes/dayanzai/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category/:fulltext?', './index'); }; diff --git a/lib/routes/dblp/publication.js b/lib/routes/dblp/publication.js index 9a150750d4b42c..9ea1ef15a5ac1f 100644 --- a/lib/routes/dblp/publication.js +++ b/lib/routes/dblp/publication.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; // 自订的 got // import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { // 在此处编写您的逻辑 const field = ctx.req.param('field'); diff --git a/lib/routes/dblp/router.js b/lib/routes/dblp/router.js index 2b01ed033e8a76..908c3aa7e7348f 100644 --- a/lib/routes/dblp/router.js +++ b/lib/routes/dblp/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:field', './publication'); }; diff --git a/lib/routes/dcard/router.js b/lib/routes/dcard/router.js index 0865a50ff98542..9974b8a6198ac1 100644 --- a/lib/routes/dcard/router.js +++ b/lib/routes/dcard/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:section/:type?', './section'); }; diff --git a/lib/routes/dcard/section.js b/lib/routes/dcard/section.js index d92ad1b6be534c..9f66b3af3a8a21 100644 --- a/lib/routes/dcard/section.js +++ b/lib/routes/dcard/section.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const utils = require('./utils'); import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'latest', section = 'posts' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number(ctx.req.query('limit')) : 30; const browser = await puppeteer(); diff --git a/lib/routes/dcfever/news.js b/lib/routes/dcfever/news.js index 7f9f66b4af6591..acaa3393bb9174 100644 --- a/lib/routes/dcfever/news.js +++ b/lib/routes/dcfever/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const response = await got(`${baseUrl}/news/index.php`, { diff --git a/lib/routes/dcfever/reviews.js b/lib/routes/dcfever/reviews.js index e35db8423101df..8ec4386b64f3b1 100644 --- a/lib/routes/dcfever/reviews.js +++ b/lib/routes/dcfever/reviews.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'cameras' } = ctx.req.param(); const response = await got(`${baseUrl}/${type}/reviews.php`); diff --git a/lib/routes/dcfever/router.js b/lib/routes/dcfever/router.js index 8d0b71b35a3917..db9ee6e6796f1f 100644 --- a/lib/routes/dcfever/router.js +++ b/lib/routes/dcfever/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:type?', './news'); router.get('/reviews/:type?', './reviews'); router.get('/trading/search/:keyword/:mainCat?', './trading-search'); diff --git a/lib/routes/dcfever/trading-search.js b/lib/routes/dcfever/trading-search.js index e964328ccc15bb..a2fa1706740ae3 100644 --- a/lib/routes/dcfever/trading-search.js +++ b/lib/routes/dcfever/trading-search.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; // import { parseRelativeDate } from '@/utils/parse-date'; const { baseUrl, parseTradeItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { keyword, mainCat } = ctx.req.param(); const response = await got(`${baseUrl}/trading/search.php`, { diff --git a/lib/routes/dcfever/trading.js b/lib/routes/dcfever/trading.js index ff3708200b6918..7c74477e1acf5b 100644 --- a/lib/routes/dcfever/trading.js +++ b/lib/routes/dcfever/trading.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; // import { parseRelativeDate } from '@/utils/parse-date'; const { baseUrl, parseTradeItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, order = 'new' } = ctx.req.param(); const response = await got(`${baseUrl}/trading/listing.php`, { diff --git a/lib/routes/ddosi/category.js b/lib/routes/ddosi/category.js index 4bbff00998418f..b30ea129369e0a 100644 --- a/lib/routes/ddosi/category.js +++ b/lib/routes/ddosi/category.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.ddosi.org/category'; const userAgent = envs.UA || 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1'; const category = ctx.req.param('category'); diff --git a/lib/routes/ddosi/index.js b/lib/routes/ddosi/index.js index 369d05cbda6515..68bfd1fd2885fb 100644 --- a/lib/routes/ddosi/index.js +++ b/lib/routes/ddosi/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.ddosi.org/'; const userAgent = envs.UA || 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1'; const response = await got({ diff --git a/lib/routes/ddosi/router.js b/lib/routes/ddosi/router.js index 529ad6af47eebe..73961ec778aea1 100644 --- a/lib/routes/ddosi/router.js +++ b/lib/routes/ddosi/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/category/:category?', './category'); router.get('/', './index'); }; diff --git a/lib/routes/deadline/posts.js b/lib/routes/deadline/posts.js index ac923297d6129b..aabcc6fe94440d 100644 --- a/lib/routes/deadline/posts.js +++ b/lib/routes/deadline/posts.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://deadline.com'; const response = await got(`${baseUrl}/wp-json/wp/v2/posts`, { searchParams: { diff --git a/lib/routes/deadline/router.js b/lib/routes/deadline/router.js index e51016ca9a9535..59494d73ce0dca 100644 --- a/lib/routes/deadline/router.js +++ b/lib/routes/deadline/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './posts'); }; diff --git a/lib/routes/dedao/index.js b/lib/routes/dedao/index.js index 542e4d72fa770e..10b2cba6673765 100644 --- a/lib/routes/dedao/index.js +++ b/lib/routes/dedao/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'news'; const rootUrl = `https://www.igetget.com/${category === 'video' ? 'video' : 'news'}`; diff --git a/lib/routes/dedao/knowledge.js b/lib/routes/dedao/knowledge.js index fd3ffe2f09a043..db0ebf72153908 100644 --- a/lib/routes/dedao/knowledge.js +++ b/lib/routes/dedao/knowledge.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const topic = ctx.req.param('topic') ?? ''; const type = /t|y/i.test(ctx.req.param('type') ?? 'true'); const count = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 100; diff --git a/lib/routes/dedao/list.js b/lib/routes/dedao/list.js index 126a4cfa0de2db..438fcf3264bf67 100644 --- a/lib/routes/dedao/list.js +++ b/lib/routes/dedao/list.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '年度日更'; const rootUrl = 'https://www.igetget.com'; diff --git a/lib/routes/dedao/router.js b/lib/routes/dedao/router.js index 49b42d478cc1fe..5b9de0a5d38e16 100644 --- a/lib/routes/dedao/router.js +++ b/lib/routes/dedao/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/knowledge/:topic?/:type?', './knowledge'); router.get('/list/:category?', './list'); router.get('/user/:id/:type?', './user'); diff --git a/lib/routes/dedao/user.js b/lib/routes/dedao/user.js index a1ffafb5be93b8..eb2e6ac1723cd3 100644 --- a/lib/routes/dedao/user.js +++ b/lib/routes/dedao/user.js @@ -9,7 +9,7 @@ const types = { 12: '视频', }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const type = ctx.req.param('type') ? Number.parseInt(ctx.req.param('type')) : 0; const count = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 100; diff --git a/lib/routes/deeplearning/router.js b/lib/routes/deeplearning/router.js index 7b11c9dd91a79e..d30b59e4fbc964 100644 --- a/lib/routes/deeplearning/router.js +++ b/lib/routes/deeplearning/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/thebatch', './thebatch'); }; diff --git a/lib/routes/deeplearning/thebatch.js b/lib/routes/deeplearning/thebatch.js index 1473153d350583..21d4a467d54b6b 100644 --- a/lib/routes/deeplearning/thebatch.js +++ b/lib/routes/deeplearning/thebatch.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const page = await got({ method: 'get', url: `https://www.deeplearning.ai/the-batch/`, diff --git a/lib/routes/deepmind/blog.js b/lib/routes/deepmind/blog.js index 7a0d9f379e316c..e2b85fac1e1555 100644 --- a/lib/routes/deepmind/blog.js +++ b/lib/routes/deepmind/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import parser from '@/utils/rss-parser'; -module.exports = async (ctx) => { +export default async (ctx) => { const feed = await parser.parseURL('https://www.deepmind.com/blog/rss.xml'); const items = await Promise.all( diff --git a/lib/routes/deepmind/router.js b/lib/routes/deepmind/router.js index e08aa776942a77..da5910733e49ed 100644 --- a/lib/routes/deepmind/router.js +++ b/lib/routes/deepmind/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog', './blog'); }; diff --git a/lib/routes/deltaio/blog.js b/lib/routes/deltaio/blog.js index e668bb11382d67..3a2bcac481d754 100644 --- a/lib/routes/deltaio/blog.js +++ b/lib/routes/deltaio/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://delta.io'; const dataUrl = `${baseUrl}/page-data/blog/page-data.json`; diff --git a/lib/routes/deltaio/router.js b/lib/routes/deltaio/router.js index e08aa776942a77..da5910733e49ed 100644 --- a/lib/routes/deltaio/router.js +++ b/lib/routes/deltaio/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog', './blog'); }; diff --git a/lib/routes/devolverdigital/blog.js b/lib/routes/devolverdigital/blog.js index 90d7babe30b27b..18f8687fd5df66 100644 --- a/lib/routes/devolverdigital/blog.js +++ b/lib/routes/devolverdigital/blog.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.devolverdigital.com/blog'; const { data: response } = await got(baseUrl); diff --git a/lib/routes/devolverdigital/router.js b/lib/routes/devolverdigital/router.js index e08aa776942a77..da5910733e49ed 100644 --- a/lib/routes/devolverdigital/router.js +++ b/lib/routes/devolverdigital/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog', './blog'); }; diff --git a/lib/routes/dgjyw/index.js b/lib/routes/dgjyw/index.js index 1d8b198b6c243b..f174804f7078e4 100644 --- a/lib/routes/dgjyw/index.js +++ b/lib/routes/dgjyw/index.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = getSubPath(ctx); const rootUrl = 'https://www.dgjyw.com'; diff --git a/lib/routes/dgjyw/router.js b/lib/routes/dgjyw/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/dgjyw/router.js +++ b/lib/routes/dgjyw/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/dhu/jiaowu/news.js b/lib/routes/dhu/jiaowu/news.js index fb87ff442e76d0..5793162a24b261 100644 --- a/lib/routes/dhu/jiaowu/news.js +++ b/lib/routes/dhu/jiaowu/news.js @@ -9,7 +9,7 @@ const map = { student: '/tzggwxszl/list.htm', teacher: '/tzggwjszl/list.htm', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const link = Object.hasOwn(map, type) ? `${base_url}${map[type]}` : `${base_url}/tzggwxszl/list.htm`; const response = await got({ diff --git a/lib/routes/dhu/news/xsxx.js b/lib/routes/dhu/news/xsxx.js index fe85131a1d2512..28215a60cdf4a1 100644 --- a/lib/routes/dhu/news/xsxx.js +++ b/lib/routes/dhu/news/xsxx.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://news.dhu.edu.cn/_wp3services/generalQuery?queryObj=articles&siteId=14&columnId=6410&pageIndex=1&rows=20'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got(baseUrl, { headers: { Referer: 'https://news.dhu.edu.cn/6410/', diff --git a/lib/routes/dhu/router.js b/lib/routes/dhu/router.js index 6e76408146e231..485e7c2a18d6a5 100644 --- a/lib/routes/dhu/router.js +++ b/lib/routes/dhu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/jiaowu/news/:type?', './jiaowu/news'); router.get('/news/xsxx', './news/xsxx'); router.get('/xxgk/news', './xxgk/news'); diff --git a/lib/routes/dhu/xxgk/news.js b/lib/routes/dhu/xxgk/news.js index 0385ee14cbf020..683a49c0c91ff1 100644 --- a/lib/routes/dhu/xxgk/news.js +++ b/lib/routes/dhu/xxgk/news.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; const base_url = 'https://xxgk.dhu.edu.cn/1737/list.htm'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = base_url; const response = await got({ method: 'get', diff --git a/lib/routes/dhu/yjs/news.js b/lib/routes/dhu/yjs/news.js index 043966e71bccf7..8d91d91b0d05b2 100644 --- a/lib/routes/dhu/yjs/news.js +++ b/lib/routes/dhu/yjs/news.js @@ -10,7 +10,7 @@ const map = { notice: '/7206/list.htm', class: '/xkks/list.htm', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'class'; const link = `${baseUrl}${map[type]}`; const { data: response } = await got(link); diff --git a/lib/routes/dhu/yjs/zs.js b/lib/routes/dhu/yjs/zs.js index 328354473bef03..08d8ad8e857cf5 100644 --- a/lib/routes/dhu/yjs/zs.js +++ b/lib/routes/dhu/yjs/zs.js @@ -9,7 +9,7 @@ const map = { doctor: '/7126/list.htm', master: '/7128/list.htm', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'master'; const link = `${baseUrl}${map[type]}`; const { data: response } = await got(link); diff --git a/lib/routes/diandong/news.js b/lib/routes/diandong/news.js index 9ff1b00760ad29..87ef0cb6a00455 100644 --- a/lib/routes/diandong/news.js +++ b/lib/routes/diandong/news.js @@ -16,7 +16,7 @@ const titleMap = { 23: '行业', }; -module.exports = async (ctx) => { +export default async (ctx) => { const cate = ctx.req.param('cate') ?? 0; const limit = ctx.req.query('limit') ? Number(ctx.req.query('limit')) : 25; const url = `${rootUrl}/content/list?page=1&size=${limit}&source_id=12&content_type=news&content_ids=&category_id=${cate}`; diff --git a/lib/routes/diandong/router.js b/lib/routes/diandong/router.js index f44bf3586fc6c0..a62147db6e0169 100644 --- a/lib/routes/diandong/router.js +++ b/lib/routes/diandong/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:cate?', './news'); }; diff --git a/lib/routes/diershoubing/news.js b/lib/routes/diershoubing/news.js index f96453cace47b1..1e78f886ace516 100644 --- a/lib/routes/diershoubing/news.js +++ b/lib/routes/diershoubing/news.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const renderDesc = (data) => art(path.join(__dirname, 'templates/news.art'), data); -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got(`https://api.diershoubing.com:5001/feed/tag/?pn=0&rn=${ctx.req.query('limit') ? Number(ctx.req.query('limit')) : 20}&tag_type=0&src=ios`); const items = data.feeds.map((item) => { diff --git a/lib/routes/diershoubing/router.js b/lib/routes/diershoubing/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/diershoubing/router.js +++ b/lib/routes/diershoubing/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/discord/channel.js b/lib/routes/discord/channel.js index 9577811b6a788d..d8161c87e31ad9 100644 --- a/lib/routes/discord/channel.js +++ b/lib/routes/discord/channel.js @@ -5,7 +5,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { baseUrl, getChannel, getChannelMessages, getGuild } = require('./discord-api'); -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.discord || !config.discord.authorization) { throw new Error('Discord RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/discord/router.js b/lib/routes/discord/router.js index 3495c2678c7991..6c4f8d60dc5dd7 100644 --- a/lib/routes/discord/router.js +++ b/lib/routes/discord/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/channel/:channelId', './channel'); }; diff --git a/lib/routes/discourse/notifications.js b/lib/routes/discourse/notifications.js index aa0fda74812613..81f8278d5e5ce3 100644 --- a/lib/routes/discourse/notifications.js +++ b/lib/routes/discourse/notifications.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; const { getConfig } = require('./utils'); import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const { link, key } = getConfig(ctx); const response = await got(`${link}/notifications.json`, { headers: { 'User-Api-Key': key } }).json(); diff --git a/lib/routes/discourse/posts.js b/lib/routes/discourse/posts.js index 1c134cb755ad47..daf05c89b2cb1a 100644 --- a/lib/routes/discourse/posts.js +++ b/lib/routes/discourse/posts.js @@ -2,7 +2,7 @@ const { getConfig } = require('./utils'); import got from '@/utils/got'; import RSSParser from '@/utils/rss-parser'; -module.exports = async (ctx) => { +export default async (ctx) => { const { link, key } = getConfig(ctx); const feed = await RSSParser.parseString( diff --git a/lib/routes/discourse/router.js b/lib/routes/discourse/router.js index 550a8fa7f86357..ee535c161374b5 100644 --- a/lib/routes/discourse/router.js +++ b/lib/routes/discourse/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:configId/posts', './posts'); router.get('/:configId/notifications/:fulltext?', './notifications'); }; diff --git a/lib/routes/discuz/discuz.js b/lib/routes/discuz/discuz.js index 7c71effb11bedd..5f4b923dc90b78 100644 --- a/lib/routes/discuz/discuz.js +++ b/lib/routes/discuz/discuz.js @@ -52,7 +52,7 @@ async function loadContent(itemLink, charset, header) { return { description }; } -module.exports = async (ctx) => { +export default async (ctx) => { let link = ctx.req.param('link'); const ver = ctx.req.param('ver') ? ctx.req.param('ver').toUpperCase() : undefined; const cid = ctx.req.param('cid'); diff --git a/lib/routes/discuz/router.js b/lib/routes/discuz/router.js index fc504540000a12..187287dc8ae224 100644 --- a/lib/routes/discuz/router.js +++ b/lib/routes/discuz/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:ver([7|x])/:cid([0-9]{2})/:link(.*)', './discuz'); router.get('/:ver([7|x])/:link(.*)', './discuz'); router.get('/:link(.*)', './discuz'); diff --git a/lib/routes/disinfo/publications.js b/lib/routes/disinfo/publications.js index d4e9e943d29f77..f284234c9e3f58 100644 --- a/lib/routes/disinfo/publications.js +++ b/lib/routes/disinfo/publications.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.disinfo.eu'; const currentUrl = `${rootUrl}/publications`; const response = await got({ diff --git a/lib/routes/disinfo/router.js b/lib/routes/disinfo/router.js index 2d54e41c6a7143..fd8327057f32b4 100644 --- a/lib/routes/disinfo/router.js +++ b/lib/routes/disinfo/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/publications', './publications'); }; diff --git a/lib/routes/diskanalyzer/router.js b/lib/routes/diskanalyzer/router.js index 082ee7d78d3880..df85a13b06d096 100644 --- a/lib/routes/diskanalyzer/router.js +++ b/lib/routes/diskanalyzer/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/whats-new', './whats-new'); }; diff --git a/lib/routes/diskanalyzer/whats-new.js b/lib/routes/diskanalyzer/whats-new.js index 9311419fc0a25f..aa19e423752aee 100644 --- a/lib/routes/diskanalyzer/whats-new.js +++ b/lib/routes/diskanalyzer/whats-new.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://diskanalyzer.com'; const currentUrl = `${rootUrl}/whats-new`; diff --git a/lib/routes/distill/index.js b/lib/routes/distill/index.js index 01f774ae7ece7f..f7f4ad8a47f36d 100644 --- a/lib/routes/distill/index.js +++ b/lib/routes/distill/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://distill.pub'; const response = await got({ diff --git a/lib/routes/distill/router.js b/lib/routes/distill/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/distill/router.js +++ b/lib/routes/distill/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/dlnews/category.js b/lib/routes/dlnews/category.js index b8fc63f7afa7b1..eb85afb8efe796 100644 --- a/lib/routes/dlnews/category.js +++ b/lib/routes/dlnews/category.js @@ -57,7 +57,7 @@ const extractArticle = (item) => return item; }); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const baseUrl = 'https://www.dlnews.com'; const apiPath = '/pf/api/v3/content/fetch/articles-api'; diff --git a/lib/routes/dlnews/router.js b/lib/routes/dlnews/router.js index 29f238038caec0..22dfff62dde7e4 100644 --- a/lib/routes/dlnews/router.js +++ b/lib/routes/dlnews/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './category'); }; diff --git a/lib/routes/dlsite/campaign.js b/lib/routes/dlsite/campaign.js index 30af047eb5e8fc..cb2aad17ea4cba 100644 --- a/lib/routes/dlsite/campaign.js +++ b/lib/routes/dlsite/campaign.js @@ -118,7 +118,7 @@ const setUrl = (info) => { return paramsPath.slice(1); }; -module.exports = async (ctx) => { +export default async (ctx) => { const info = infos[ctx.req.param('type')]; // 判断参数是否合理 if (info === undefined) { diff --git a/lib/routes/dlsite/ci-en/article.js b/lib/routes/dlsite/ci-en/article.js index 7e7e6f384d1395..4535da2c976e40 100644 --- a/lib/routes/dlsite/ci-en/article.js +++ b/lib/routes/dlsite/ci-en/article.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '7400'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10; diff --git a/lib/routes/dlsite/index.js b/lib/routes/dlsite/index.js index 77ff0f7ab869ce..151d49e094e6f5 100644 --- a/lib/routes/dlsite/index.js +++ b/lib/routes/dlsite/index.js @@ -1,5 +1,5 @@ const { ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { ctx.set('data', await ProcessItems(ctx)); }; diff --git a/lib/routes/dlsite/new.js b/lib/routes/dlsite/new.js index adb85a4eab0731..479c08295b328a 100644 --- a/lib/routes/dlsite/new.js +++ b/lib/routes/dlsite/new.js @@ -49,7 +49,7 @@ const infos = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const info = infos[ctx.req.param('type')]; // 判断参数是否合理 if (info === undefined) { diff --git a/lib/routes/dlsite/router.js b/lib/routes/dlsite/router.js index 3a80e677b0c0ee..9aedae6ac7e2cd 100644 --- a/lib/routes/dlsite/router.js +++ b/lib/routes/dlsite/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/campaign/:type/:free?', './campaign'); router.get('/ci-en/:id/article', './ci-en/article'); router.get('/new/:type', './new'); diff --git a/lib/routes/dmzj/news.js b/lib/routes/dmzj/news.js index 72394130dc5351..ce4b2fb37e7977 100644 --- a/lib/routes/dmzj/news.js +++ b/lib/routes/dmzj/news.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://news.dmzj.com/${ctx.req.param('category') || ''}`; const $ = load((await got(url)).data); ctx.set('data', { diff --git a/lib/routes/dmzj/router.js b/lib/routes/dmzj/router.js index 94e58c83a4832c..ec7c5eda5bf4b4 100644 --- a/lib/routes/dmzj/router.js +++ b/lib/routes/dmzj/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:category?', './news'); }; diff --git a/lib/routes/dn/news.js b/lib/routes/dn/news.js index 35a328330751f3..3acf430d6f5acb 100644 --- a/lib/routes/dn/news.js +++ b/lib/routes/dn/news.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { language, category = '' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/dn/router.js b/lib/routes/dn/router.js index 396def541899c0..6d93649e3ddd44 100644 --- a/lib/routes/dn/router.js +++ b/lib/routes/dn/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:language/news/:category?', './news'); }; diff --git a/lib/routes/dnaindia/category.js b/lib/routes/dnaindia/category.js index 676ee5f00e94f2..2ca19c6309eed7 100644 --- a/lib/routes/dnaindia/category.js +++ b/lib/routes/dnaindia/category.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import logger from '@/utils/logger'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category, topic } = ctx.req.param(); const baseUrl = 'https://www.dnaindia.com'; let route; diff --git a/lib/routes/dnaindia/router.js b/lib/routes/dnaindia/router.js index 82ec203e8e5083..0354c963f6b38b 100644 --- a/lib/routes/dnaindia/router.js +++ b/lib/routes/dnaindia/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category', './category'); router.get('/topic/:topic', './category'); }; diff --git a/lib/routes/dockerhub/build.js b/lib/routes/dockerhub/build.js index 0128597f0d6333..9f595fb55f96ca 100644 --- a/lib/routes/dockerhub/build.js +++ b/lib/routes/dockerhub/build.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { hash } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { owner, image, tag = 'latest' } = ctx.req.param(); const namespace = `${owner}/${image}`; diff --git a/lib/routes/dockerhub/router.js b/lib/routes/dockerhub/router.js index bb301da1515574..76628fd41674bb 100644 --- a/lib/routes/dockerhub/router.js +++ b/lib/routes/dockerhub/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/build/:owner/:image/:tag?', './build'); router.get('/tag/:owner/:image/:limits?', './tag'); }; diff --git a/lib/routes/dockerhub/tag.js b/lib/routes/dockerhub/tag.js index fb28c1ba332140..264c5d00c06810 100644 --- a/lib/routes/dockerhub/tag.js +++ b/lib/routes/dockerhub/tag.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { hash } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { owner, image, limits } = ctx.req.param(); const namespace = `${owner}/${image}`; diff --git a/lib/routes/docschina/jsweekly.js b/lib/routes/docschina/jsweekly.js index 72016fb115249b..3404bbbffe44b9 100644 --- a/lib/routes/docschina/jsweekly.js +++ b/lib/routes/docschina/jsweekly.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt(); -module.exports = async (ctx) => { +export default async (ctx) => { const baseURL = 'https://docschina.org'; const { data: res } = await got(`${baseURL}/weekly/js/docs/`); diff --git a/lib/routes/docschina/router.js b/lib/routes/docschina/router.js index 5da5762ce78101..c120fac13f266b 100644 --- a/lib/routes/docschina/router.js +++ b/lib/routes/docschina/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/jsweekly', './jsweekly'); }; diff --git a/lib/routes/dol/announce.js b/lib/routes/dol/announce.js index f35b396d417449..b9db3816944d92 100644 --- a/lib/routes/dol/announce.js +++ b/lib/routes/dol/announce.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://announce.dol.go.th'; const { owner, province, office } = ctx.req.param(); const queryParams = { diff --git a/lib/routes/dol/router.js b/lib/routes/dol/router.js index c544a7093b2105..189469e019a71a 100644 --- a/lib/routes/dol/router.js +++ b/lib/routes/dol/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/announce/:owner?/:province?/:office?', './announce'); }; diff --git a/lib/routes/domp4/detail.js b/lib/routes/domp4/detail.js index bf9135e9995a1b..7e2f4af5fa0649 100644 --- a/lib/routes/domp4/detail.js +++ b/lib/routes/domp4/detail.js @@ -69,7 +69,7 @@ function getMetaInfo($) { }; } -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { domain, second } = ctx.req.query(); let pureId = id; diff --git a/lib/routes/domp4/latest.js b/lib/routes/domp4/latest.js index 6bfaaeddd4e68b..e1b4e216e551cf 100644 --- a/lib/routes/domp4/latest.js +++ b/lib/routes/domp4/latest.js @@ -16,7 +16,7 @@ function getItemList($, type) { return list; } -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'vod' } = ctx.req.param(); const { domain } = ctx.req.query(); diff --git a/lib/routes/domp4/router.js b/lib/routes/domp4/router.js index 18a6e6d77943ae..8af476d8b371bf 100644 --- a/lib/routes/domp4/router.js +++ b/lib/routes/domp4/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/detail/:id', './detail'); router.get('/latest/:type?', './latest'); }; diff --git a/lib/routes/dongqiudi/daily.js b/lib/routes/dongqiudi/daily.js index 55ee1b8d66f5fc..a05b65de46d153 100644 --- a/lib/routes/dongqiudi/daily.js +++ b/lib/routes/dongqiudi/daily.js @@ -1,3 +1,3 @@ -module.exports = (ctx) => { +export default (ctx) => { ctx.redirect('/dongqiudi/special/48'); }; diff --git a/lib/routes/dongqiudi/player-news.js b/lib/routes/dongqiudi/player-news.js index bc6043a424810b..d0c979c26c28c1 100644 --- a/lib/routes/dongqiudi/player-news.js +++ b/lib/routes/dongqiudi/player-news.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const playerId = ctx.req.param('id'); await utils.ProcessFeed(ctx, 'player', playerId); diff --git a/lib/routes/dongqiudi/result.js b/lib/routes/dongqiudi/result.js index 79fbef5d1c3966..94abec61ecddb1 100644 --- a/lib/routes/dongqiudi/result.js +++ b/lib/routes/dongqiudi/result.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const { JSDOM } = require('jsdom'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const team = ctx.req.param('team'); const link = `https://www.dongqiudi.com/team/${team}.html`; diff --git a/lib/routes/dongqiudi/router.js b/lib/routes/dongqiudi/router.js index 0fd99a80fe3dbc..f114f35e909d4a 100644 --- a/lib/routes/dongqiudi/router.js +++ b/lib/routes/dongqiudi/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/daily', './daily'); router.get('/player_news/:id', './player-news'); router.get('/result/:team', './result'); diff --git a/lib/routes/dongqiudi/special.js b/lib/routes/dongqiudi/special.js index b81a05e5518f8a..dffa9a9da9c9f4 100644 --- a/lib/routes/dongqiudi/special.js +++ b/lib/routes/dongqiudi/special.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { data: response } = await got(`https://www.dongqiudi.com/api/old/columns/${id}`); diff --git a/lib/routes/dongqiudi/team-news.js b/lib/routes/dongqiudi/team-news.js index 6bea7a44b316ee..4dcf2d4e24e960 100644 --- a/lib/routes/dongqiudi/team-news.js +++ b/lib/routes/dongqiudi/team-news.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const teamId = ctx.req.param('team'); await utils.ProcessFeed(ctx, 'team', teamId); diff --git a/lib/routes/dongqiudi/top-news.js b/lib/routes/dongqiudi/top-news.js index 5b21a3b0b8829c..b9a0772cc21f72 100644 --- a/lib/routes/dongqiudi/top-news.js +++ b/lib/routes/dongqiudi/top-news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 1; const { data } = await got(`https://api.dongqiudi.com/app/tabs/web/${id}.json`); const articles = data.articles; diff --git a/lib/routes/dorohedoro/news.js b/lib/routes/dorohedoro/news.js index 916a4d8b9234e1..d6f46022392c73 100644 --- a/lib/routes/dorohedoro/news.js +++ b/lib/routes/dorohedoro/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25; const rootUrl = 'https://dorohedoro.net'; diff --git a/lib/routes/dorohedoro/router.js b/lib/routes/dorohedoro/router.js index bd25c22a2fd87b..3c9877e17cb637 100644 --- a/lib/routes/dorohedoro/router.js +++ b/lib/routes/dorohedoro/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/douban/book/rank.js b/lib/routes/douban/book/rank.js index 88db290011f1ec..b7c80a1190549a 100644 --- a/lib/routes/douban/book/rank.js +++ b/lib/routes/douban/book/rank.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = '' } = ctx.req.param(); const referer = `https://m.douban.com/book/${type}`; diff --git a/lib/routes/douban/channel/subject.js b/lib/routes/douban/channel/subject.js index fc53fd1e86a498..94222a6592d5c2 100644 --- a/lib/routes/douban/channel/subject.js +++ b/lib/routes/douban/channel/subject.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const nav = ctx.req.param('nav'); const link = `https://www.douban.com/subject/${id}`; diff --git a/lib/routes/douban/channel/topic.js b/lib/routes/douban/channel/topic.js index 6770a0e9e41913..6ba4d9ac45a343 100644 --- a/lib/routes/douban/channel/topic.js +++ b/lib/routes/douban/channel/topic.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const nav = ctx.req.param('nav') || 'default'; const link = `https://www.douban.com/channel/${id}`; diff --git a/lib/routes/douban/commercialpress/latest.js b/lib/routes/douban/commercialpress/latest.js index 4fd8444208b44f..95a7b23a156db4 100644 --- a/lib/routes/douban/commercialpress/latest.js +++ b/lib/routes/douban/commercialpress/latest.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://site.douban.com/commercialpress/room/827243/'; const { data: roomResponse } = await got({ method: 'get', diff --git a/lib/routes/douban/event/hot.js b/lib/routes/douban/event/hot.js index ce2c1f392cf673..4bdfd27cf0598c 100644 --- a/lib/routes/douban/event/hot.js +++ b/lib/routes/douban/event/hot.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const { locationId = 0 } = ctx.req.param(); const referer = 'https://m.douban.com/app_topic/event_hot'; diff --git a/lib/routes/douban/other/bookstore.js b/lib/routes/douban/other/bookstore.js index 8e42cedde8f540..e0bec260427ffd 100644 --- a/lib/routes/douban/other/bookstore.js +++ b/lib/routes/douban/other/bookstore.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://market.douban.com/book/'; const response = await got({ method: 'get', diff --git a/lib/routes/douban/other/celebrity.js b/lib/routes/douban/other/celebrity.js index aa0202df7d1e4d..bc14d98fcca42d 100644 --- a/lib/routes/douban/other/celebrity.js +++ b/lib/routes/douban/other/celebrity.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const sort = ctx.req.param('sort') || 'time'; diff --git a/lib/routes/douban/other/classification.js b/lib/routes/douban/other/classification.js index 7ac8f3f9d7ce86..31880a92152177 100644 --- a/lib/routes/douban/other/classification.js +++ b/lib/routes/douban/other/classification.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const sort = ctx.req.param('sort') || 'U'; const score = Number.parseFloat(ctx.req.param('score')) || 0; const tags = ctx.req.param('tags') || ''; diff --git a/lib/routes/douban/other/discussion.js b/lib/routes/douban/other/discussion.js index 7145ea8655ec53..b36fddf46a3b39 100644 --- a/lib/routes/douban/other/discussion.js +++ b/lib/routes/douban/other/discussion.js @@ -9,7 +9,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = 'https://book.douban.com/subject'; const { data: response } = await got(`${link}/${id}/discussion/`); diff --git a/lib/routes/douban/other/doulist.js b/lib/routes/douban/other/doulist.js index 7aafe250787a36..3d3ac3b80de22e 100644 --- a/lib/routes/douban/other/doulist.js +++ b/lib/routes/douban/other/doulist.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const url = `https://www.douban.com/doulist/${id}`; diff --git a/lib/routes/douban/other/explore-column.js b/lib/routes/douban/other/explore-column.js index 61372ca2a6c8b2..b9610d60bc59c8 100644 --- a/lib/routes/douban/other/explore-column.js +++ b/lib/routes/douban/other/explore-column.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const url = require('url'); const host = 'https://www.douban.com/explore/column/'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = url.resolve(host, id); const response = await got.get(link); diff --git a/lib/routes/douban/other/explore.js b/lib/routes/douban/other/explore.js index 8057b04da9c9d5..6b40df44771c57 100644 --- a/lib/routes/douban/other/explore.js +++ b/lib/routes/douban/other/explore.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://www.douban.com/explore', diff --git a/lib/routes/douban/other/group.js b/lib/routes/douban/other/group.js index 072ab230d86504..1da37f54ef2498 100644 --- a/lib/routes/douban/other/group.js +++ b/lib/routes/douban/other/group.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const groupid = ctx.req.param('groupid'); const type = ctx.req.param('type'); diff --git a/lib/routes/douban/other/jobs.js b/lib/routes/douban/other/jobs.js index 81868a487c21c1..7937c36641432e 100644 --- a/lib/routes/douban/other/jobs.js +++ b/lib/routes/douban/other/jobs.js @@ -9,7 +9,7 @@ const titleMap = { intern: '实习生招聘', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const url = `${rootUrl}/jobs/${type}`; diff --git a/lib/routes/douban/other/later.js b/lib/routes/douban/other/later.js index 696adcbe556813..af2abad59be5ac 100644 --- a/lib/routes/douban/other/later.js +++ b/lib/routes/douban/other/later.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://movie.douban.com/cinema/later/beijing/', diff --git a/lib/routes/douban/other/latest-book.js b/lib/routes/douban/other/latest-book.js index d03d3fc1af815e..b656dae54a8479 100644 --- a/lib/routes/douban/other/latest-book.js +++ b/lib/routes/douban/other/latest-book.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const url = 'https://book.douban.com/latest'; -module.exports = async (ctx) => { +export default async (ctx) => { const res = await got.get(url); const $ = load(res.data); const list = $('#content').find('li').get(); diff --git a/lib/routes/douban/other/latest-music.js b/lib/routes/douban/other/latest-music.js index 29d38f1e435f89..ec9ec8d2d6d917 100644 --- a/lib/routes/douban/other/latest-music.js +++ b/lib/routes/douban/other/latest-music.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const { area = '' } = ctx.req.param(); const title = '豆瓣最新增加的音乐'; let data; diff --git a/lib/routes/douban/other/list.js b/lib/routes/douban/other/list.js index 7b98d14c7757ff..b85af49cea0868 100644 --- a/lib/routes/douban/other/list.js +++ b/lib/routes/douban/other/list.js @@ -3,7 +3,7 @@ import * as path from 'node:path'; import { art } from '@/utils/render'; import { fallback, queryToInteger } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'subject_real_time_hotest'; const routeParams = Object.fromEntries(new URLSearchParams(ctx.req.param('routeParams'))); const playable = fallback(undefined, queryToInteger(routeParams.playable), 0); diff --git a/lib/routes/douban/other/playing.js b/lib/routes/douban/other/playing.js index ad9e11b55685b9..2951b6b9de8906 100644 --- a/lib/routes/douban/other/playing.js +++ b/lib/routes/douban/other/playing.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const score = Number.parseFloat(ctx.req.param('score')) || 0; const response = await got({ method: 'get', diff --git a/lib/routes/douban/other/recommended.js b/lib/routes/douban/other/recommended.js index 2ee3fa5e19c73c..fd5ca29b7b13a7 100644 --- a/lib/routes/douban/other/recommended.js +++ b/lib/routes/douban/other/recommended.js @@ -3,7 +3,7 @@ import * as path from 'node:path'; import { art } from '@/utils/render'; import { fallback, queryToInteger } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { const subjectType = ctx.req.param('type') || 'tv'; const apiKey = '0ac44ae016490db2204ce0a042db2916'; let url = `https://frodo.douban.com/api/v2/skynet/new_playlists?apikey=${apiKey}&subject_type=${subjectType}`; diff --git a/lib/routes/douban/other/replied.js b/lib/routes/douban/other/replied.js index 1f9dd992e62f66..435a4f9cb5f1bf 100644 --- a/lib/routes/douban/other/replied.js +++ b/lib/routes/douban/other/replied.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `https://www.douban.com/people/${ctx.req.param('uid')}/notes`; const response = await got({ method: 'get', diff --git a/lib/routes/douban/other/replies.js b/lib/routes/douban/other/replies.js index f06a0fe97bef7f..c3ba61df558c5d 100644 --- a/lib/routes/douban/other/replies.js +++ b/lib/routes/douban/other/replies.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `https://www.douban.com/people/${ctx.req.param('uid')}/notes`; const response = await got({ method: 'get', diff --git a/lib/routes/douban/other/topic.js b/lib/routes/douban/other/topic.js index 21739d9b99931a..f244c7188186ea 100644 --- a/lib/routes/douban/other/topic.js +++ b/lib/routes/douban/other/topic.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const sort = ctx.req.param('sort') || 'new'; diff --git a/lib/routes/douban/other/ustop.js b/lib/routes/douban/other/ustop.js index ea3cd581d98d0a..14249af0b10df8 100644 --- a/lib/routes/douban/other/ustop.js +++ b/lib/routes/douban/other/ustop.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://api.douban.com/v2/movie/us_box?apikey=0df993c66c0c636e29ecbb5344252a4a', diff --git a/lib/routes/douban/other/weekly-best.js b/lib/routes/douban/other/weekly-best.js index 177e2cab62d429..089eb59ace42e2 100644 --- a/lib/routes/douban/other/weekly-best.js +++ b/lib/routes/douban/other/weekly-best.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'movie_weekly_best'; const link = 'https://m.douban.com/movie'; diff --git a/lib/routes/douban/people/status.js b/lib/routes/douban/people/status.js index 8d753e03000891..68d78168519c98 100644 --- a/lib/routes/douban/people/status.js +++ b/lib/routes/douban/people/status.js @@ -443,7 +443,7 @@ async function getFullTextItems(items) { ); } -module.exports = async (ctx) => { +export default async (ctx) => { const userid = ctx.req.param('userid'); const url = `https://m.douban.com/rexxar/api/v2/status/user_timeline/${userid}`; const items = await cache.tryGet( diff --git a/lib/routes/douban/people/wish.js b/lib/routes/douban/people/wish.js index 54f07d16111c20..ed36ec193072ca 100644 --- a/lib/routes/douban/people/wish.js +++ b/lib/routes/douban/people/wish.js @@ -3,7 +3,7 @@ const querystring = require('querystring'); import { load } from 'cheerio'; import got from '@/utils/got'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const userid = ctx.req.param('userid'); const routeParams = querystring.parse(ctx.req.param('routeParams')); diff --git a/lib/routes/douban/router.js b/lib/routes/douban/router.js index 1a3b59603fd3f3..4c43dab3201d13 100644 --- a/lib/routes/douban/router.js +++ b/lib/routes/douban/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/book/latest', './other/latest-book'); router.get('/book/rank/:type?', './book/rank'); router.get('/bookstore', './other/bookstore'); diff --git a/lib/routes/douyin/hashtag.js b/lib/routes/douyin/hashtag.js index 4bbb454e931bcd..2ae067d5506e46 100644 --- a/lib/routes/douyin/hashtag.js +++ b/lib/routes/douyin/hashtag.js @@ -6,7 +6,7 @@ import { fallback, queryToBoolean } from '@/utils/readable-social'; const { templates, resolveUrl, proxyVideo, getOriginAvatar } = require('./utils'); import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const cid = ctx.req.param('cid'); if (isNaN(cid)) { throw new TypeError('Invalid tag ID. Tag ID should be a number.'); diff --git a/lib/routes/douyin/live.js b/lib/routes/douyin/live.js index c9783493ac6af9..ed1a3a18f866f8 100644 --- a/lib/routes/douyin/live.js +++ b/lib/routes/douyin/live.js @@ -4,7 +4,7 @@ const { getOriginAvatar } = require('./utils'); import logger from '@/utils/logger'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const rid = ctx.req.param('rid'); if (isNaN(rid)) { throw new TypeError('Invalid room ID. Room ID should be a number.'); diff --git a/lib/routes/douyin/router.js b/lib/routes/douyin/router.js index 63d992af80f483..29c9fb7d18dae4 100644 --- a/lib/routes/douyin/router.js +++ b/lib/routes/douyin/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/hashtag/:cid/:routeParams?', './hashtag'); router.get('/live/:rid', './live'); router.get('/user/:uid/:routeParams?', './user'); diff --git a/lib/routes/douyin/user.js b/lib/routes/douyin/user.js index 2c0468e75d796d..237ec69da09aba 100644 --- a/lib/routes/douyin/user.js +++ b/lib/routes/douyin/user.js @@ -5,7 +5,7 @@ import { config } from '@/config'; import { fallback, queryToBoolean } from '@/utils/readable-social'; const { templates, resolveUrl, proxyVideo, getOriginAvatar, universalGet } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); if (!uid.startsWith('MS4wLjABAAAA')) { throw new Error('Invalid UID. UID should start with MS4wLjABAAAA.'); diff --git a/lib/routes/douyu/group.js b/lib/routes/douyu/group.js index e2c1c82114037f..f20ca4ad1f00bf 100644 --- a/lib/routes/douyu/group.js +++ b/lib/routes/douyu/group.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const sort = ctx.req.param('sort') ?? '2'; diff --git a/lib/routes/douyu/post.js b/lib/routes/douyu/post.js index 11d841a5496eab..bcec5f3ffa5c05 100644 --- a/lib/routes/douyu/post.js +++ b/lib/routes/douyu/post.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://yuba.douyu.com'; diff --git a/lib/routes/douyu/room.js b/lib/routes/douyu/room.js index 179be7a694f5fa..0ddcb5e48cb576 100644 --- a/lib/routes/douyu/room.js +++ b/lib/routes/douyu/room.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got({ diff --git a/lib/routes/douyu/router.js b/lib/routes/douyu/router.js index f7990e239981d5..d5ccb390f5ef2c 100644 --- a/lib/routes/douyu/router.js +++ b/lib/routes/douyu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/group/:id/:sort?', './group'); router.get('/post/:id', './post'); router.get('/room/:id', './room'); diff --git a/lib/routes/dribbble/keyword.js b/lib/routes/dribbble/keyword.js index 5dc871fae5c11b..1763838c80375f 100644 --- a/lib/routes/dribbble/keyword.js +++ b/lib/routes/dribbble/keyword.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const url = `https://dribbble.com/search/shots/recent?q=${keyword}`; diff --git a/lib/routes/dribbble/popular.js b/lib/routes/dribbble/popular.js index a1de87d7b0949f..16cd6a82a37363 100644 --- a/lib/routes/dribbble/popular.js +++ b/lib/routes/dribbble/popular.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const timeframe = ctx.req.param('timeframe'); const url = `https://dribbble.com/shots/popular${timeframe ? `?timeframe=${timeframe}` : ''}`; diff --git a/lib/routes/dribbble/router.js b/lib/routes/dribbble/router.js index 02abc62b3fc65a..0d185d085e1259 100644 --- a/lib/routes/dribbble/router.js +++ b/lib/routes/dribbble/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/keyword/:keyword', './keyword'); router.get('/popular/:timeframe?', './popular'); router.get('/user/:name', './user'); diff --git a/lib/routes/dribbble/user.js b/lib/routes/dribbble/user.js index 1ced515b817661..dda8f68cfbc9b1 100644 --- a/lib/routes/dribbble/user.js +++ b/lib/routes/dribbble/user.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const url = `https://dribbble.com/${name}`; diff --git a/lib/routes/dtcj/datahero.js b/lib/routes/dtcj/datahero.js index b77d23b5ff30d3..497989e3e6be2f 100644 --- a/lib/routes/dtcj/datahero.js +++ b/lib/routes/dtcj/datahero.js @@ -10,7 +10,7 @@ const titles = { 10: '阿里云天池', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://dtcj.com'; diff --git a/lib/routes/dtcj/datainsight.js b/lib/routes/dtcj/datainsight.js index 5728784ee8a22e..9737fcbbd05d88 100644 --- a/lib/routes/dtcj/datainsight.js +++ b/lib/routes/dtcj/datainsight.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const rootUrl = 'https://dtcj.com'; diff --git a/lib/routes/dtcj/router.js b/lib/routes/dtcj/router.js index 70b0c418543fe4..2807c69d5a7621 100644 --- a/lib/routes/dtcj/router.js +++ b/lib/routes/dtcj/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/datahero/:category?', './datahero'); router.get('/datainsight/:id?', './datainsight'); }; diff --git a/lib/routes/duozhuayu/router.js b/lib/routes/duozhuayu/router.js index 4d162848312431..ae50c87fc9570e 100644 --- a/lib/routes/duozhuayu/router.js +++ b/lib/routes/duozhuayu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/search/:wd', './search'); }; diff --git a/lib/routes/duozhuayu/search.js b/lib/routes/duozhuayu/search.js index e62fa21403fa4d..6d6e5810aafc6a 100644 --- a/lib/routes/duozhuayu/search.js +++ b/lib/routes/duozhuayu/search.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const wd = ctx.req.param('wd'); const baseUrl = 'https://www.duozhuayu.com'; const type = 'book'; diff --git a/lib/routes/dushu/fuzhou/index.js b/lib/routes/dushu/fuzhou/index.js index 44e5667a17ec81..1533163df7b648 100644 --- a/lib/routes/dushu/fuzhou/index.js +++ b/lib/routes/dushu/fuzhou/index.js @@ -13,7 +13,7 @@ const transformTime = (item) => { item.endTime = `${endTime.getFullYear()}-${endTime.getMonth() + 1}-${endTime.getDate()} ${endTime.getHours()}:${endTime.getMinutes()}`; }; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got .post(host, { json: { diff --git a/lib/routes/dushu/router.js b/lib/routes/dushu/router.js index 80d98ef6d9d5f3..51c7ef570fd39f 100644 --- a/lib/routes/dushu/router.js +++ b/lib/routes/dushu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/fuzhou', './fuzhou/index'); }; diff --git a/lib/routes/dut/index.js b/lib/routes/dut/index.js index 07af9906dbbd8c..ca33823f3752af 100644 --- a/lib/routes/dut/index.js +++ b/lib/routes/dut/index.js @@ -6,7 +6,7 @@ const defaults = require('./defaults'); const shortcuts = require('./shortcuts'); import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const site = ctx.params[0] ?? 'news'; if (!isValidHost(site)) { throw new Error('Invalid site'); diff --git a/lib/routes/dut/router.js b/lib/routes/dut/router.js index a840d2ce95a005..38a45b7bb7d424 100644 --- a/lib/routes/dut/router.js +++ b/lib/routes/dut/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/*/*', './index'); router.get('/:0?', './index'); }; diff --git a/lib/routes/dx2025/index.js b/lib/routes/dx2025/index.js index 0ea8de378be190..425d38f576898d 100644 --- a/lib/routes/dx2025/index.js +++ b/lib/routes/dx2025/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || ''; const category = ctx.req.param('category') || ''; diff --git a/lib/routes/dx2025/router.js b/lib/routes/dx2025/router.js index c57b4b9b661e8a..8591b506201fae 100644 --- a/lib/routes/dx2025/router.js +++ b/lib/routes/dx2025/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?/:category?', './index'); }; diff --git a/lib/routes/dxy/profile/thread.js b/lib/routes/dxy/profile/thread.js index e1b3e12426f362..54182f20c96f57 100644 --- a/lib/routes/dxy/profile/thread.js +++ b/lib/routes/dxy/profile/thread.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const { webBaseUrl, generateNonce, sign, getPost } = require('../utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const userId = ctx.req.param('userId'); const { limit = '30' } = ctx.req.query(); diff --git a/lib/routes/dxy/router.js b/lib/routes/dxy/router.js index d9f882b753a45f..987dbd204b756e 100644 --- a/lib/routes/dxy/router.js +++ b/lib/routes/dxy/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/bbs/profile/thread/:userId', './profile/thread'); router.get('/bbs/special/:specialId', './special'); }; diff --git a/lib/routes/dxy/special.js b/lib/routes/dxy/special.js index c05d27fa4c1597..b4bb14b94b7df3 100644 --- a/lib/routes/dxy/special.js +++ b/lib/routes/dxy/special.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const { phoneBaseUrl, webBaseUrl, generateNonce, sign, getPost } = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const specialId = ctx.req.param('specialId'); const { limit = '10' } = ctx.req.query(); diff --git a/lib/routes/e-hentai/index.js b/lib/routes/e-hentai/index.js index 49937217193d64..6340f71ab325f3 100644 --- a/lib/routes/e-hentai/index.js +++ b/lib/routes/e-hentai/index.js @@ -5,7 +5,7 @@ import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const what = ctx.req.param('what') ?? ''; const needTorrents = /t|y/i.test(ctx.req.param('needTorrents') ?? 'true'); diff --git a/lib/routes/e-hentai/router.js b/lib/routes/e-hentai/router.js index 8e696e70caa2c7..e1ea344d89313b 100644 --- a/lib/routes/e-hentai/router.js +++ b/lib/routes/e-hentai/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:what?/:id?/:needTorrents?/:needImages?', './index'); }; diff --git a/lib/routes/eagle/blog.js b/lib/routes/eagle/blog.js index 27b91186b6e857..5fbd2c2a3507d4 100644 --- a/lib/routes/eagle/blog.js +++ b/lib/routes/eagle/blog.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { isValidHost } from '@/utils/valid-host'; const cateList = new Set(['all', 'design-resources', 'learn-design', 'inside-eagle']); -module.exports = async (ctx) => { +export default async (ctx) => { let cate = ctx.req.param('cate') ?? 'all'; let language = ctx.req.param('language') ?? 'cn'; if (!isValidHost(cate) || !isValidHost(language)) { diff --git a/lib/routes/eagle/changelog.js b/lib/routes/eagle/changelog.js index e509522385c660..88a096cb0a9ceb 100644 --- a/lib/routes/eagle/changelog.js +++ b/lib/routes/eagle/changelog.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { let language = ctx.req.param('language'); let changelog = ''; diff --git a/lib/routes/eagle/router.js b/lib/routes/eagle/router.js index e90c10dd3f91d7..02bb81bef1b7c6 100644 --- a/lib/routes/eagle/router.js +++ b/lib/routes/eagle/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:cate?/:language?', './blog'); router.get('/changelog/:language?', './changelog'); }; diff --git a/lib/routes/earthquake/ceic.js b/lib/routes/earthquake/ceic.js index 6417509293da42..f9c7f8a92f6106 100644 --- a/lib/routes/earthquake/ceic.js +++ b/lib/routes/earthquake/ceic.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { let type = Number(ctx.req.param('type')); type = type ?? 1; const baseUrl = 'http://www.ceic.ac.cn'; diff --git a/lib/routes/earthquake/index.js b/lib/routes/earthquake/index.js index 0da7c155c36440..d87ae47d2fb79a 100644 --- a/lib/routes/earthquake/index.js +++ b/lib/routes/earthquake/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const region = ctx.req.param('region') ?? 1; const api = 'https://www.cea.gov.cn/eportal/ui?struts.portlet.mode=view&struts.portlet.action=/portlet/expressEarthquake!queryExpressEarthquakeList.action&pageId=363409&moduleId=a852ba487b534470a84a30f00e7d6670'; const link = 'https://www.cea.gov.cn/cea/xwzx/zqsd/index.html'; diff --git a/lib/routes/earthquake/router.js b/lib/routes/earthquake/router.js index 05045b720aed6a..505206d5aa08ba 100644 --- a/lib/routes/earthquake/router.js +++ b/lib/routes/earthquake/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/ceic/:type?', './ceic'); router.get('/:region?', './index'); }; diff --git a/lib/routes/eastday/24.js b/lib/routes/eastday/24.js index 2e298c8fcb2e3c..16aebafd050b90 100644 --- a/lib/routes/eastday/24.js +++ b/lib/routes/eastday/24.js @@ -22,7 +22,7 @@ const categories = { 教育: 'jiaoyu', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '社会'; const rootUrl = 'https://mini.eastday.com'; diff --git a/lib/routes/eastday/portrait.js b/lib/routes/eastday/portrait.js index bc07ff04e461a3..9d8a254ac7017b 100644 --- a/lib/routes/eastday/portrait.js +++ b/lib/routes/eastday/portrait.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://apin.eastday.com'; const currentUrl = `${rootUrl}/api/news/Portrait`; diff --git a/lib/routes/eastday/router.js b/lib/routes/eastday/router.js index 70a2a0f04553e9..c63e40dfe66483 100644 --- a/lib/routes/eastday/router.js +++ b/lib/routes/eastday/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/24/:category?', './24'); router.get('/portrait', './portrait'); router.get('/sh', './sh'); diff --git a/lib/routes/eastday/sh.js b/lib/routes/eastday/sh.js index 6bf3f173863508..06ed1359f7903b 100644 --- a/lib/routes/eastday/sh.js +++ b/lib/routes/eastday/sh.js @@ -5,7 +5,7 @@ import logger from '@/utils/logger'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const domain = 'http://wap.eastday.com'; const response = await got({ diff --git a/lib/routes/eastmoney/report/index.js b/lib/routes/eastmoney/report/index.js index d61ecbbc1a30fd..60b7a33b4c32a0 100644 --- a/lib/routes/eastmoney/report/index.js +++ b/lib/routes/eastmoney/report/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://data.eastmoney.com'; const { category = 'strategyreport' } = ctx.req.param(); diff --git a/lib/routes/eastmoney/router.js b/lib/routes/eastmoney/router.js index 994c83adb5dc5a..da195d0783761d 100644 --- a/lib/routes/eastmoney/router.js +++ b/lib/routes/eastmoney/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/report/:category', './report/index'); router.get('/search/:keyword', './search/index'); router.get('/ttjj/user/:uid', './ttjj/user'); diff --git a/lib/routes/eastmoney/search/index.js b/lib/routes/eastmoney/search/index.js index 8b0cd08b0b30ff..cb933d30e99cef 100644 --- a/lib/routes/eastmoney/search/index.js +++ b/lib/routes/eastmoney/search/index.js @@ -2,7 +2,7 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const link = `https://so.eastmoney.com/News/s?KeyWord=${keyword}`; const body = { diff --git a/lib/routes/eastmoney/ttjj/user.js b/lib/routes/eastmoney/ttjj/user.js index ec1881f75308f1..56df98895188e1 100644 --- a/lib/routes/eastmoney/ttjj/user.js +++ b/lib/routes/eastmoney/ttjj/user.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const urlPrefix = 'https://jijinbaapi.eastmoney.com/gubaapi/v3/read'; diff --git a/lib/routes/ecnu/contest.js b/lib/routes/ecnu/contest.js index 4e33f236389315..25bc5a2955dd7b 100644 --- a/lib/routes/ecnu/contest.js +++ b/lib/routes/ecnu/contest.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const publicOnly = category === 'public'; const rootUrl = 'https://acm.ecnu.edu.cn'; diff --git a/lib/routes/ecnu/router.js b/lib/routes/ecnu/router.js index 112c756873c741..2cab9e4ac10432 100644 --- a/lib/routes/ecnu/router.js +++ b/lib/routes/ecnu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/acm/contest/:category?', './contest'); router.get('/yjs', './yjs'); }; diff --git a/lib/routes/ecnu/yjs.js b/lib/routes/ecnu/yjs.js index 3c2915a00ec96a..f266025a8dd4cf 100644 --- a/lib/routes/ecnu/yjs.js +++ b/lib/routes/ecnu/yjs.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://yz.kaoyan.com/ecnu/tiaoji/'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/economist/espresso.js b/lib/routes/economist/espresso.js index d609d88e661eda..fce23df05685c4 100644 --- a/lib/routes/economist/espresso.js +++ b/lib/routes/economist/espresso.js @@ -5,7 +5,7 @@ import { config } from '@/config'; const link = 'https://www.economist.com/the-world-in-brief'; -module.exports = async (ctx) => { +export default async (ctx) => { const $ = await cache.tryGet( link, async () => { diff --git a/lib/routes/economist/full.js b/lib/routes/economist/full.js index bd890625afb48c..070314ef76f8ea 100644 --- a/lib/routes/economist/full.js +++ b/lib/routes/economist/full.js @@ -18,7 +18,7 @@ const getArticleDetail = (link) => return { article, categories }; }); -module.exports = async (ctx) => { +export default async (ctx) => { const endpoint = ctx.req.param('endpoint'); const feed = await parser.parseURL(`https://www.economist.com/${endpoint}/rss.xml`); diff --git a/lib/routes/economist/global-business-review.js b/lib/routes/economist/global-business-review.js index e5ec4ad9d98316..304f0031c3efd6 100644 --- a/lib/routes/economist/global-business-review.js +++ b/lib/routes/economist/global-business-review.js @@ -65,7 +65,7 @@ const getArticleDetail = (article_id, language) => { }); }; -module.exports = async (ctx) => { +export default async (ctx) => { const language = (ctx.req.param('language') && ctx.req .param('language') diff --git a/lib/routes/economist/router.js b/lib/routes/economist/router.js index e6986463c45118..4db89016c5cec0 100644 --- a/lib/routes/economist/router.js +++ b/lib/routes/economist/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/espresso', './espresso'); router.get('/global-business-review/:language?', './global-business-review'); router.get('/:endpoint', './full'); diff --git a/lib/routes/ecust/e/news.js b/lib/routes/ecust/e/news.js index 2c52fdd4661e1a..b8d2fa35790a8e 100644 --- a/lib/routes/ecust/e/news.js +++ b/lib/routes/ecust/e/news.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://e.ecust.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got.post(`${baseUrl}/engine2/general/1301/type/more-datas`, { form: { engineInstanceId: 1_732_458, diff --git a/lib/routes/ecust/gschool/yjs.js b/lib/routes/ecust/gschool/yjs.js index 88ec065875d2c4..a9db29accbad48 100644 --- a/lib/routes/ecust/gschool/yjs.js +++ b/lib/routes/ecust/gschool/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://gschool.ecust.edu.cn'; const link = `${baseUrl}/12753/list.htm`; const response = await got(link); diff --git a/lib/routes/ecust/jwc/notice.js b/lib/routes/ecust/jwc/notice.js index dfdc12988d4491..757f5f51a9dca7 100644 --- a/lib/routes/ecust/jwc/notice.js +++ b/lib/routes/ecust/jwc/notice.js @@ -33,7 +33,7 @@ const get_from_link = async (link) => { }); return articleList; }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'all' } = ctx.req.param(); const categoryItem = categoryMap[category] || null; // all -> null const pageUrl = categoryItem ? [`${baseUrl}${categoryItem.link}/list.htm`] : Object.values(categoryMap).map((item) => `${baseUrl}${item.link}/list.htm`); diff --git a/lib/routes/ecust/router.js b/lib/routes/ecust/router.js index 6a7a636ab6be71..fddf686c0df1b5 100644 --- a/lib/routes/ecust/router.js +++ b/lib/routes/ecust/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/jwc/:category?', './jwc/notice'); router.get('/jxjy/news', './e/news'); router.get('/yjs', './gschool/yjs'); diff --git a/lib/routes/egsea/flash.js b/lib/routes/egsea/flash.js index 4abd036953bb7c..c65ea24a415103 100644 --- a/lib/routes/egsea/flash.js +++ b/lib/routes/egsea/flash.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://www.egsea.com/news/flash-list?per-page=30', diff --git a/lib/routes/egsea/router.js b/lib/routes/egsea/router.js index 7ff9d2f2c4e662..d49f55ee2f9348 100644 --- a/lib/routes/egsea/router.js +++ b/lib/routes/egsea/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/flash', './flash'); }; diff --git a/lib/routes/ehentai/favorites.js b/lib/routes/ehentai/favorites.js index eb7ad0c4d3a650..8b215a98e3588c 100644 --- a/lib/routes/ehentai/favorites.js +++ b/lib/routes/ehentai/favorites.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const EhAPI = require('./ehapi'); -module.exports = async (ctx) => { +export default async (ctx) => { if (!EhAPI.has_cookie) { throw new Error('Ehentai favorites RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/ehentai/router.js b/lib/routes/ehentai/router.js index 7acdd684e11213..1357b6171325e9 100644 --- a/lib/routes/ehentai/router.js +++ b/lib/routes/ehentai/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/favorites/:favcat?/:order?/:page?/:routeParams?', './favorites'); router.get('/search/:params?/:page?/:routeParams?', './search'); router.get('/tag/:tag/:page?/:routeParams?', './tag'); diff --git a/lib/routes/ehentai/search.js b/lib/routes/ehentai/search.js index c93f5655f0b7d9..52d568161b88cf 100644 --- a/lib/routes/ehentai/search.js +++ b/lib/routes/ehentai/search.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const EhAPI = require('./ehapi'); -module.exports = async (ctx) => { +export default async (ctx) => { const page = ctx.req.param('page'); let params = ctx.req.param('params'); const routeParams = new URLSearchParams(ctx.req.param('routeParams')); diff --git a/lib/routes/ehentai/tag.js b/lib/routes/ehentai/tag.js index 9888faec716e03..d6ec8f7c5794a7 100644 --- a/lib/routes/ehentai/tag.js +++ b/lib/routes/ehentai/tag.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const EhAPI = require('./ehapi'); -module.exports = async (ctx) => { +export default async (ctx) => { const page = ctx.req.param('page'); const tag = ctx.req.param('tag'); const routeParams = new URLSearchParams(ctx.req.param('routeParams')); diff --git a/lib/routes/ekantipur/issue.js b/lib/routes/ekantipur/issue.js index 9c66d1c2495210..0bff6e78068bc1 100644 --- a/lib/routes/ekantipur/issue.js +++ b/lib/routes/ekantipur/issue.js @@ -3,7 +3,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; // a customised got import { load } from 'cheerio'; // an HTML parser with a jQuery-like API -module.exports = async (ctx) => { +export default async (ctx) => { // Your logic here // Defining base URL const baseUrl = 'https://ekantipur.com'; diff --git a/lib/routes/ekantipur/router.js b/lib/routes/ekantipur/router.js index 53a7441250f50c..6e2e6c9f72dcf1 100644 --- a/lib/routes/ekantipur/router.js +++ b/lib/routes/ekantipur/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:channel?', './issue'); }; diff --git a/lib/routes/elasticsearch-cn/index.js b/lib/routes/elasticsearch-cn/index.js index 009b65a8e02d45..461dfc1620f38e 100644 --- a/lib/routes/elasticsearch-cn/index.js +++ b/lib/routes/elasticsearch-cn/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = ctx.req.param('params') ?? ''; const rootUrl = 'https://elasticsearch.cn'; diff --git a/lib/routes/elasticsearch-cn/router.js b/lib/routes/elasticsearch-cn/router.js index d36fa1a0bc5379..78b6037fe4ebca 100644 --- a/lib/routes/elasticsearch-cn/router.js +++ b/lib/routes/elasticsearch-cn/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:params?', './index'); }; diff --git a/lib/routes/eleduck/jobs.js b/lib/routes/eleduck/jobs.js index 8ba3d2be591061..a89fde1f214908 100644 --- a/lib/routes/eleduck/jobs.js +++ b/lib/routes/eleduck/jobs.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got('https://svc.eleduck.com/api/v1/posts', { searchParams: { category: 5, diff --git a/lib/routes/eleduck/posts.js b/lib/routes/eleduck/posts.js index 9985ef29568397..4fded878c2667b 100644 --- a/lib/routes/eleduck/posts.js +++ b/lib/routes/eleduck/posts.js @@ -15,7 +15,7 @@ const getCateName = async (cid = 0) => { return cates[cid] || '全部'; }; -module.exports = async (ctx) => { +export default async (ctx) => { const cid = ctx.req.param('id') || 0; const response = await got(`https://svc.eleduck.com/api/v1/posts?category=${cid}&sort=-published_at&page=1`); diff --git a/lib/routes/eleduck/router.js b/lib/routes/eleduck/router.js index 3223b3141be754..eb8d7e06db36d7 100644 --- a/lib/routes/eleduck/router.js +++ b/lib/routes/eleduck/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/jobs', './jobs'); router.get('/posts/:id?', './posts'); }; diff --git a/lib/routes/elsevier/issue.js b/lib/routes/elsevier/issue.js index f0c99f621b6963..a62b0bb52e04e2 100644 --- a/lib/routes/elsevier/issue.js +++ b/lib/routes/elsevier/issue.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); -module.exports = async (ctx) => { +export default async (ctx) => { const journal = ctx.req.param('journal'); const issue = 'Volume ' + ctx.req.param('issue').replace('-', ' Issue '); const host = 'https://www.sciencedirect.com'; diff --git a/lib/routes/elsevier/journal.js b/lib/routes/elsevier/journal.js index 5aa023ee4e173c..adb63a2f39c1cf 100644 --- a/lib/routes/elsevier/journal.js +++ b/lib/routes/elsevier/journal.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); -module.exports = async (ctx) => { +export default async (ctx) => { const journal = ctx.req.param('journal'); const host = 'https://www.sciencedirect.com'; const jrnlUrl = `${host}/journal/${journal}`; diff --git a/lib/routes/elsevier/router.js b/lib/routes/elsevier/router.js index 7db606c90a5774..737fe485d2ccd6 100644 --- a/lib/routes/elsevier/router.js +++ b/lib/routes/elsevier/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/:journal/latest', './journal'); // deprecated router.get('/:journal/vol/:issue', './issue'); // deprecated router.get('/:journal', './journal'); diff --git a/lib/routes/embassy/index.js b/lib/routes/embassy/index.js index ab18cd90810db3..980a9129eaf45a 100644 --- a/lib/routes/embassy/index.js +++ b/lib/routes/embassy/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const supportedList = require('./supported-list'); -module.exports = async (ctx) => { +export default async (ctx) => { const country = ctx.req.param('country'); const city = ctx.req.param('city') ?? undefined; diff --git a/lib/routes/embassy/router.js b/lib/routes/embassy/router.js index 3e990bd301af58..fe1635b1a84d15 100644 --- a/lib/routes/embassy/router.js +++ b/lib/routes/embassy/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:country/:city?', './index'); }; diff --git a/lib/routes/epicgames/index.js b/lib/routes/epicgames/index.js index 142b5bb3830ce2..f91498d3470691 100644 --- a/lib/routes/epicgames/index.js +++ b/lib/routes/epicgames/index.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const dayjs = require('dayjs'); -module.exports = async (ctx) => { +export default async (ctx) => { const locale = ctx.req.param('locale') ?? 'en-US'; const country = ctx.req.param('country') ?? 'US'; diff --git a/lib/routes/epicgames/router.js b/lib/routes/epicgames/router.js index 45a568a03f4259..7869f5d92d9c41 100644 --- a/lib/routes/epicgames/router.js +++ b/lib/routes/epicgames/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/freegames/:locale?/:country?', './index'); }; diff --git a/lib/routes/eprice/router.js b/lib/routes/eprice/router.js index 8e36c80e099705..4d51e8ea1905ca 100644 --- a/lib/routes/eprice/router.js +++ b/lib/routes/eprice/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:region?', './rss'); }; diff --git a/lib/routes/eprice/rss.js b/lib/routes/eprice/rss.js index aa0797dceee0b6..23a9d67f872ac1 100644 --- a/lib/routes/eprice/rss.js +++ b/lib/routes/eprice/rss.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const allowRegion = new Set(['tw', 'hk']); -module.exports = async (ctx) => { +export default async (ctx) => { const region = ctx.req.param('region') ?? 'tw'; if (!allowRegion.has(region)) { throw new Error('Invalid region'); diff --git a/lib/routes/eventernote/actors.js b/lib/routes/eventernote/actors.js index f4d2eb35113455..d130b8c743ec3d 100644 --- a/lib/routes/eventernote/actors.js +++ b/lib/routes/eventernote/actors.js @@ -11,7 +11,7 @@ const timeStringRegexes = [ const maxPages = 5; const pageCount = 10; -module.exports = async (ctx) => { +export default async (ctx) => { const { name, id } = ctx.req.param(); const title = `${name}のイベント・ライブ情報一覧`; diff --git a/lib/routes/eventernote/router.js b/lib/routes/eventernote/router.js index 68fae7b7fcf861..91d7c9ce60754c 100644 --- a/lib/routes/eventernote/router.js +++ b/lib/routes/eventernote/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/actors/:name/:id', './actors'); }; diff --git a/lib/routes/famitsu/category.js b/lib/routes/famitsu/category.js index 3ea6fb9c1fbf86..df93baf04357fa 100644 --- a/lib/routes/famitsu/category.js +++ b/lib/routes/famitsu/category.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'https://www.famitsu.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'new-article' } = ctx.req.param(); const url = `${baseUrl}/search/?category=${category}`; const { data } = await got(url); diff --git a/lib/routes/famitsu/router.js b/lib/routes/famitsu/router.js index b1570402b50b37..c6ab0aaab50887 100644 --- a/lib/routes/famitsu/router.js +++ b/lib/routes/famitsu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/category/:category?', './category'); }; diff --git a/lib/routes/fansly/post.js b/lib/routes/fansly/post.js index b41683869e9c3b..9d7eafaaf2e1ee 100644 --- a/lib/routes/fansly/post.js +++ b/lib/routes/fansly/post.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; const { getAccountByUsername, getTimelineByAccountId, parseDescription, baseUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const username = ctx.req.param('username'); const account = await getAccountByUsername(username, cache.tryGet); diff --git a/lib/routes/fansly/router.js b/lib/routes/fansly/router.js index 02031caaec4672..f85bbe8091f03f 100644 --- a/lib/routes/fansly/router.js +++ b/lib/routes/fansly/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/tag/:tag', './tag'); router.get('/user/:username', './post'); }; diff --git a/lib/routes/fansly/tag.js b/lib/routes/fansly/tag.js index bc0a414392abaa..bcf0891faab056 100644 --- a/lib/routes/fansly/tag.js +++ b/lib/routes/fansly/tag.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; const { getTagId, getTagSuggestion, findAccountById, parseDescription, baseUrl, icon } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const tagId = await getTagId(tag, cache.tryGet); diff --git a/lib/routes/fantia/router.js b/lib/routes/fantia/router.js index 331e92ef3ac3e3..53af2d054e3830 100644 --- a/lib/routes/fantia/router.js +++ b/lib/routes/fantia/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/search/:type?/:caty?/:period?/:order?/:rating?/:keyword?', './search'); router.get('/user/:id', './user'); }; diff --git a/lib/routes/fantia/search.js b/lib/routes/fantia/search.js index 8d1978820afec0..267cd0a6aa9343 100644 --- a/lib/routes/fantia/search.js +++ b/lib/routes/fantia/search.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'posts'; const caty = ctx.req.param('caty') || ''; const order = ctx.req.param('order') || 'updater'; diff --git a/lib/routes/fantia/user.js b/lib/routes/fantia/user.js index ac695b976251ac..6f893457d21ccb 100644 --- a/lib/routes/fantia/user.js +++ b/lib/routes/fantia/user.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://fantia.jp'; const userUrl = `${rootUrl}/api/v1/fanclubs/${ctx.req.param('id')}`; diff --git a/lib/routes/farmatters/index.js b/lib/routes/farmatters/index.js index 6ffe1e350c2b1a..e8852809bb428f 100644 --- a/lib/routes/farmatters/index.js +++ b/lib/routes/farmatters/index.js @@ -14,7 +14,7 @@ const ids = { 3: 1, }; -module.exports = async (ctx) => { +export default async (ctx) => { const { type, id, locale = 'zh-CN' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/farmatters/router.js b/lib/routes/farmatters/router.js index 3d39f0010dcffe..566fc3f85b95ca 100644 --- a/lib/routes/farmatters/router.js +++ b/lib/routes/farmatters/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/exclusive/:locale?', './'); router.get('/news/:locale?', './'); router.get('/:locale?', './'); diff --git a/lib/routes/fastbull/express-news.js b/lib/routes/fastbull/express-news.js index d2219ba26b68f8..53712ace908fab 100644 --- a/lib/routes/fastbull/express-news.js +++ b/lib/routes/fastbull/express-news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.fastbull.cn'; const currentUrl = `${rootUrl}/express-news`; diff --git a/lib/routes/fastbull/news.js b/lib/routes/fastbull/news.js index 452c00a539f9c6..2d623464eb4953 100644 --- a/lib/routes/fastbull/news.js +++ b/lib/routes/fastbull/news.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.fastbull.cn'; const currentUrl = `${rootUrl}/news`; diff --git a/lib/routes/fastbull/router.js b/lib/routes/fastbull/router.js index b4948de1a89e0b..45d0d38fd046fb 100644 --- a/lib/routes/fastbull/router.js +++ b/lib/routes/fastbull/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/express-news', './express-news'); router.get('/news', './news'); router.get('/', './news'); diff --git a/lib/routes/fda/cdrh.js b/lib/routes/fda/cdrh.js index e03ef6efb9e5fe..247e4533dbb107 100644 --- a/lib/routes/fda/cdrh.js +++ b/lib/routes/fda/cdrh.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const titleOnly = !!(ctx.req.param('titleOnly') ?? ''); const rootUrl = 'https://www.fda.gov'; const currentUrl = `${rootUrl}/medical-devices/news-events-medical-devices/cdrhnew-news-and-updates`; diff --git a/lib/routes/fda/router.js b/lib/routes/fda/router.js index 013bfc2fcea152..e8da2631f5a792 100644 --- a/lib/routes/fda/router.js +++ b/lib/routes/fda/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/cdrh/:titleOnly?', './cdrh'); }; diff --git a/lib/routes/feng/forum.js b/lib/routes/feng/forum.js index e9f93e0777ee9c..91db82b06b29c6 100644 --- a/lib/routes/feng/forum.js +++ b/lib/routes/feng/forum.js @@ -3,7 +3,7 @@ const { baseUrl, getForumMeta, getThreads, getThread } = require('./utils'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const topicId = Number(ctx.req.param('id')); const { type = 'all' } = ctx.req.param(); diff --git a/lib/routes/feng/router.js b/lib/routes/feng/router.js index 3b9aa47b951801..b34522a6f833c4 100644 --- a/lib/routes/feng/router.js +++ b/lib/routes/feng/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/forum/:id/:type?', './forum'); }; diff --git a/lib/routes/ff14/ff14-global.js b/lib/routes/ff14/ff14-global.js index 078f560e003022..4b2288e5df6dde 100644 --- a/lib/routes/ff14/ff14-global.js +++ b/lib/routes/ff14/ff14-global.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const lang = ctx.req.param('lang'); const type = ctx.req.param('type') ?? 'all'; diff --git a/lib/routes/ff14/ff14-zh.js b/lib/routes/ff14/ff14-zh.js index 67d7919af06822..93064748e1c0a1 100644 --- a/lib/routes/ff14/ff14-zh.js +++ b/lib/routes/ff14/ff14-zh.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const referer = 'https://ff.sdo.com/web8/index.html'; const type = ctx.req.param('type') ?? 'all'; diff --git a/lib/routes/ff14/router.js b/lib/routes/ff14/router.js index a35b0b3a5d9491..b6a6109be5b60a 100644 --- a/lib/routes/ff14/router.js +++ b/lib/routes/ff14/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/global/:lang/:type?', './ff14-global'); router.get('/zh/:type?', './ff14-zh'); // Deprecated diff --git a/lib/routes/fffdm/manhua/manhua.js b/lib/routes/fffdm/manhua/manhua.js index 78a4c23d23ff1f..ce6c46d4689ecc 100644 --- a/lib/routes/fffdm/manhua/manhua.js +++ b/lib/routes/fffdm/manhua/manhua.js @@ -17,7 +17,7 @@ const get_pic = async (url) => { }; }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const count = ctx.req.query('limit') || 99999; const cdnNum = ctx.req.param('cdn') || 5; diff --git a/lib/routes/fffdm/router.js b/lib/routes/fffdm/router.js index 5e095972fa3782..f97f3480f563f6 100644 --- a/lib/routes/fffdm/router.js +++ b/lib/routes/fffdm/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/manhua/:id/:cdn?', './manhua/manhua'); }; diff --git a/lib/routes/finology/bullets.js b/lib/routes/finology/bullets.js index 7ebb10324083a9..17f363c2196c7d 100644 --- a/lib/routes/finology/bullets.js +++ b/lib/routes/finology/bullets.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://insider.finology.in/bullets'; const { data: response } = await got(baseUrl); diff --git a/lib/routes/finology/most-viewed.js b/lib/routes/finology/most-viewed.js index 052c5af57107cf..5efe5bd6affd16 100644 --- a/lib/routes/finology/most-viewed.js +++ b/lib/routes/finology/most-viewed.js @@ -1,7 +1,7 @@ import logger from '@/utils/logger'; const { getItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://insider.finology.in/most-viewed'; let selector; let title; diff --git a/lib/routes/finology/router.js b/lib/routes/finology/router.js index 4decbf8a3549ce..4765fc5e75a77a 100644 --- a/lib/routes/finology/router.js +++ b/lib/routes/finology/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/bullets', './bullets'); router.get('/:category', './tag'); router.get('/most-viewed/:time', './most-viewed'); diff --git a/lib/routes/finology/tag.js b/lib/routes/finology/tag.js index be5606675de269..972238c2f6b3bb 100644 --- a/lib/routes/finology/tag.js +++ b/lib/routes/finology/tag.js @@ -1,7 +1,7 @@ import logger from '@/utils/logger'; const { getItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { topic, category } = ctx.req.param(); const baseUrl = 'https://insider.finology.in'; let route; diff --git a/lib/routes/finviz/news.js b/lib/routes/finviz/news.js index bf38efc04bcc4a..19ad701832bb60 100644 --- a/lib/routes/finviz/news.js +++ b/lib/routes/finviz/news.js @@ -8,7 +8,7 @@ const categories = { blogs: 1, }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'News' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 200; diff --git a/lib/routes/finviz/quote.js b/lib/routes/finviz/quote.js index 6a58e9d757e73c..7d18552d82b606 100644 --- a/lib/routes/finviz/quote.js +++ b/lib/routes/finviz/quote.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `https://finviz.com/quote.ashx?t=${ctx.req.param('ticker')}`; const response = await got(link); diff --git a/lib/routes/finviz/router.js b/lib/routes/finviz/router.js index ae69fb8f1cf43a..f7fa910854f56a 100644 --- a/lib/routes/finviz/router.js +++ b/lib/routes/finviz/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:ticker', './quote'); router.get('/:category?', './news'); }; diff --git a/lib/routes/firecore/index.js b/lib/routes/firecore/index.js index 47120a85d96fef..47ecfe86378cee 100644 --- a/lib/routes/firecore/index.js +++ b/lib/routes/firecore/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://firecore.com/releases'; const { data } = await got(host); const $ = load(data); diff --git a/lib/routes/firecore/router.js b/lib/routes/firecore/router.js index b7ed2a88ab618e..569b405803ecd1 100644 --- a/lib/routes/firecore/router.js +++ b/lib/routes/firecore/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:os', './index'); }; diff --git a/lib/routes/firefox/addons.js b/lib/routes/firefox/addons.js index 196642e196a5c6..497e0fa154a62b 100644 --- a/lib/routes/firefox/addons.js +++ b/lib/routes/firefox/addons.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got({ diff --git a/lib/routes/firefox/breaches.js b/lib/routes/firefox/breaches.js index fbad7777aca1dc..6c174c7d9f05cc 100644 --- a/lib/routes/firefox/breaches.js +++ b/lib/routes/firefox/breaches.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://monitor.firefox.com'; const response = await got(`${baseUrl}/breaches`); diff --git a/lib/routes/firefox/release.js b/lib/routes/firefox/release.js index d3ef0df20ae512..f8ecc541158941 100644 --- a/lib/routes/firefox/release.js +++ b/lib/routes/firefox/release.js @@ -10,7 +10,7 @@ const platformSlugs = { ios: 'ios/notes', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { platform = 'desktop' } = ctx.req.param(); const devicePlatform = platform.replace('-', '/'); diff --git a/lib/routes/firefox/router.js b/lib/routes/firefox/router.js index 4ae2a78407a412..aa406de8e6001f 100644 --- a/lib/routes/firefox/router.js +++ b/lib/routes/firefox/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/addons/:id', './addons'); router.get('/breaches', './breaches'); router.get('/release/:platform?', './release'); diff --git a/lib/routes/fisher-spb/news.js b/lib/routes/fisher-spb/news.js index 38fc18056d1c1a..e5eef68b83366a 100644 --- a/lib/routes/fisher-spb/news.js +++ b/lib/routes/fisher-spb/news.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const renderVideo = (link) => art(path.join(__dirname, './templates/video.art'), { link }); const renderImage = (href) => art(path.join(__dirname, './templates/image.art'), { href }); diff --git a/lib/routes/fisher-spb/router.js b/lib/routes/fisher-spb/router.js index bd25c22a2fd87b..3c9877e17cb637 100644 --- a/lib/routes/fisher-spb/router.js +++ b/lib/routes/fisher-spb/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/fishshell/index.js b/lib/routes/fishshell/index.js index 2641d499d2063c..9fab39c5d0da21 100644 --- a/lib/routes/fishshell/index.js +++ b/lib/routes/fishshell/index.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://fishshell.com/docs/current/relnotes.html'; const data = await cache.tryGet(link, async () => (await got(link)).data, config.cache.contentExpire, false); const $ = load(data); diff --git a/lib/routes/fishshell/router.js b/lib/routes/fishshell/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/fishshell/router.js +++ b/lib/routes/fishshell/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/fjksbm/index.js b/lib/routes/fjksbm/index.js index fa8c5c419b01a7..ae56e418f81d47 100644 --- a/lib/routes/fjksbm/index.js +++ b/lib/routes/fjksbm/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '0'; const id = Number.parseInt(category); diff --git a/lib/routes/fjksbm/router.js b/lib/routes/fjksbm/router.js index b610024188e52a..74ed533fca356e 100644 --- a/lib/routes/fjksbm/router.js +++ b/lib/routes/fjksbm/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './'); }; diff --git a/lib/routes/flyert/creditcard.js b/lib/routes/flyert/creditcard.js index 4274793861eaf2..46c0744cc24623 100644 --- a/lib/routes/flyert/creditcard.js +++ b/lib/routes/flyert/creditcard.js @@ -7,7 +7,7 @@ const iconv = require('iconv-lite'); const gbk2utf8 = (s) => iconv.decode(s, 'gbk'); const host = 'https://www.flyert.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const bank = ctx.req.param('bank'); const target = `${host}/forum-${bank}-1.html`; let bankname = ''; diff --git a/lib/routes/flyert/preferential.js b/lib/routes/flyert/preferential.js index 45821709ccd8a3..20ead7a535b780 100644 --- a/lib/routes/flyert/preferential.js +++ b/lib/routes/flyert/preferential.js @@ -9,7 +9,7 @@ const gbk2utf8 = (s) => iconv.decode(s, 'gbk'); const host = 'https://www.flyert.com'; const target = `${host}/forum.php?mod=forumdisplay&sum=all&fid=all&catid=322`; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(target, { responseType: 'buffer', }); diff --git a/lib/routes/flyert/router.js b/lib/routes/flyert/router.js index 0feea795a01234..dcdb400fb98652 100644 --- a/lib/routes/flyert/router.js +++ b/lib/routes/flyert/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/preferential', './preferential'); router.get('/creditcard/:bank', './creditcard'); }; diff --git a/lib/routes/focustaiwan/index.js b/lib/routes/focustaiwan/index.js index 17acb258ef8450..82355f0dbbeda7 100644 --- a/lib/routes/focustaiwan/index.js +++ b/lib/routes/focustaiwan/index.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'news'; const rootUrl = 'https://focustaiwan.tw'; diff --git a/lib/routes/focustaiwan/router.js b/lib/routes/focustaiwan/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/focustaiwan/router.js +++ b/lib/routes/focustaiwan/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/followin/index.js b/lib/routes/followin/index.js index f202935cfbd7ed..2ce97cd083ce4f 100644 --- a/lib/routes/followin/index.js +++ b/lib/routes/followin/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { apiUrl, favicon, getBParam, getBuildId, getGToken, parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { categoryId = '1', lang = 'en' } = ctx.req.param(); const { limit = 20 } = ctx.req.query(); const gToken = await getGToken(cache.tryGet); diff --git a/lib/routes/followin/kol.js b/lib/routes/followin/kol.js index ee85269ef4db00..0634798a2b2957 100644 --- a/lib/routes/followin/kol.js +++ b/lib/routes/followin/kol.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { baseUrl, getBuildId, parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { kolId, lang = 'en' } = ctx.req.param(); const { limit = 10 } = ctx.req.query(); diff --git a/lib/routes/followin/news.js b/lib/routes/followin/news.js index 000f18686fccb2..886acf47b6fdc2 100644 --- a/lib/routes/followin/news.js +++ b/lib/routes/followin/news.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { baseUrl, favicon, getBuildId, parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { lang = 'en' } = ctx.req.param(); const { limit = 20 } = ctx.req.query(); diff --git a/lib/routes/followin/router.js b/lib/routes/followin/router.js index cbf54ec092e57f..c23c86f994b159 100644 --- a/lib/routes/followin/router.js +++ b/lib/routes/followin/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/kol/:kolId/:lang?', './kol'); router.get('/news/:lang?', './news'); router.get('/tag/:tagId/:lang?', './tag'); diff --git a/lib/routes/followin/tag.js b/lib/routes/followin/tag.js index 5eb5ddde121f9c..e50a512813cfbb 100644 --- a/lib/routes/followin/tag.js +++ b/lib/routes/followin/tag.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { apiUrl, baseUrl, getBParam, getBuildId, getGToken, parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { tagId, lang = 'en' } = ctx.req.param(); const { limit = 20 } = ctx.req.query(); diff --git a/lib/routes/followin/topic.js b/lib/routes/followin/topic.js index 12567547c190dc..9da2ed9de23b80 100644 --- a/lib/routes/followin/topic.js +++ b/lib/routes/followin/topic.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { baseUrl, getBuildId, parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { topicId, lang = 'en' } = ctx.req.param(); const { limit = 20 } = ctx.req.query(); diff --git a/lib/routes/foresightnews/article.js b/lib/routes/foresightnews/article.js index 72d3ab81899328..ffaad0befab26b 100644 --- a/lib/routes/foresightnews/article.js +++ b/lib/routes/foresightnews/article.js @@ -1,6 +1,6 @@ const { rootUrl, apiRootUrl, processItems, icon, image } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; const apiUrl = new URL('v1/articles', apiRootUrl).href; diff --git a/lib/routes/foresightnews/column.js b/lib/routes/foresightnews/column.js index decdb39ad063b7..d5afafba4fe7a9 100644 --- a/lib/routes/foresightnews/column.js +++ b/lib/routes/foresightnews/column.js @@ -1,6 +1,6 @@ const { rootUrl, apiRootUrl, processItems, icon, image } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/foresightnews/index.js b/lib/routes/foresightnews/index.js index c490e0d6072d36..e7eb8b6a661066 100644 --- a/lib/routes/foresightnews/index.js +++ b/lib/routes/foresightnews/index.js @@ -1,6 +1,6 @@ const { rootUrl, apiRootUrl, processItems, icon, image } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; const apiUrl = new URL(`v2/feed`, apiRootUrl).href; diff --git a/lib/routes/foresightnews/news.js b/lib/routes/foresightnews/news.js index 67ae41319ceb30..59086cafef6c65 100644 --- a/lib/routes/foresightnews/news.js +++ b/lib/routes/foresightnews/news.js @@ -1,6 +1,6 @@ const { rootUrl, apiRootUrl, processItems, icon, image } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; const apiUrl = new URL('v1/news', apiRootUrl).href; diff --git a/lib/routes/foresightnews/router.js b/lib/routes/foresightnews/router.js index 718003fa05cebb..02a3844b7d2507 100644 --- a/lib/routes/foresightnews/router.js +++ b/lib/routes/foresightnews/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/article', './article'); router.get('/column/:id', './column'); router.get('/news', './news'); diff --git a/lib/routes/foreverblog/feeds.js b/lib/routes/foreverblog/feeds.js index 0e7f7fe1d8f26e..c263617e53e0a3 100644 --- a/lib/routes/foreverblog/feeds.js +++ b/lib/routes/foreverblog/feeds.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = 'https://www.foreverblog.cn/feeds.html'; const response = await got(currentUrl); diff --git a/lib/routes/foreverblog/router.js b/lib/routes/foreverblog/router.js index 95ae29a8009dca..5e912c78ab663e 100644 --- a/lib/routes/foreverblog/router.js +++ b/lib/routes/foreverblog/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/feeds', './feeds'); }; diff --git a/lib/routes/fortnite/news.js b/lib/routes/fortnite/news.js index 1ed29a44505790..faafda4bb72672 100644 --- a/lib/routes/fortnite/news.js +++ b/lib/routes/fortnite/news.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import logger from '@/utils/logger'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const options = ctx.req .param('options') ?.split('&') diff --git a/lib/routes/fortnite/router.js b/lib/routes/fortnite/router.js index 63ecf1e472f354..42bb4e4a25f186 100644 --- a/lib/routes/fortnite/router.js +++ b/lib/routes/fortnite/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:options?', './news'); }; diff --git a/lib/routes/fortunechina/index.js b/lib/routes/fortunechina/index.js index 2c3b6b9f3fd234..9fb54e900bd269 100644 --- a/lib/routes/fortunechina/index.js +++ b/lib/routes/fortunechina/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://www.fortunechina.com'; diff --git a/lib/routes/fortunechina/router.js b/lib/routes/fortunechina/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/fortunechina/router.js +++ b/lib/routes/fortunechina/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/fosshub/index.js b/lib/routes/fosshub/index.js index bbf6c64a6d935b..98915a9fd34d8f 100644 --- a/lib/routes/fosshub/index.js +++ b/lib/routes/fosshub/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const rootUrl = 'https://www.fosshub.com'; diff --git a/lib/routes/fosshub/router.js b/lib/routes/fosshub/router.js index de87b52670c7db..c79f907ed7d0b5 100644 --- a/lib/routes/fosshub/router.js +++ b/lib/routes/fosshub/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id', './index'); }; diff --git a/lib/routes/free/router.js b/lib/routes/free/router.js index 42ffe3a854b3a5..09c585b57315bb 100644 --- a/lib/routes/free/router.js +++ b/lib/routes/free/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './rss'); }; diff --git a/lib/routes/free/rss.js b/lib/routes/free/rss.js index 70da6d197ccd01..5b5785a8ef6115 100644 --- a/lib/routes/free/rss.js +++ b/lib/routes/free/rss.js @@ -1,7 +1,7 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://free.com.tw/'; const response = await got(`${url}/wp-json/wp/v2/posts`); const list = response.data; diff --git a/lib/routes/freebuf/index.js b/lib/routes/freebuf/index.js index 54672e7ce04cbe..d95c4db2bb0b4a 100644 --- a/lib/routes/freebuf/index.js +++ b/lib/routes/freebuf/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'web' } = ctx.req.param(); const fapi = 'https://www.freebuf.com/fapi/frontend/category/list'; diff --git a/lib/routes/freebuf/router.js b/lib/routes/freebuf/router.js index 25aacbedfc134f..45e64fc93abd61 100644 --- a/lib/routes/freebuf/router.js +++ b/lib/routes/freebuf/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/articles/:type', './index'); }; diff --git a/lib/routes/freecomputerbooks/index.js b/lib/routes/freecomputerbooks/index.js index eb149473286072..2f036fefe03a08 100644 --- a/lib/routes/freecomputerbooks/index.js +++ b/lib/routes/freecomputerbooks/index.js @@ -12,7 +12,7 @@ async function cheerioLoad(url) { return load((await got(url)).data); } -module.exports = async (ctx) => { +export default async (ctx) => { const categoryId = ctx.req.param('category')?.trim(); const requestURL = categoryId ? new URL(`${categoryId}.html`, baseURL).href : baseURL; const $ = await cheerioLoad(requestURL); diff --git a/lib/routes/freecomputerbooks/router.js b/lib/routes/freecomputerbooks/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/freecomputerbooks/router.js +++ b/lib/routes/freecomputerbooks/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/freewechat/profile.js b/lib/routes/freewechat/profile.js index 4575412a99d571..415a562a357b66 100644 --- a/lib/routes/freewechat/profile.js +++ b/lib/routes/freewechat/profile.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { fixArticleContent } from '@/utils/wechat-mp'; const baseUrl = 'https://freewechat.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const url = `${baseUrl}/profile/${id}`; const { data: response } = await got(url); diff --git a/lib/routes/freewechat/router.js b/lib/routes/freewechat/router.js index 30bd3e4afff2fb..ccc3d8314c7fc1 100644 --- a/lib/routes/freewechat/router.js +++ b/lib/routes/freewechat/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/profile/:id', './profile'); }; diff --git a/lib/routes/ft/channel.js b/lib/routes/ft/channel.js index 38822241094700..29648a7b88f408 100644 --- a/lib/routes/ft/channel.js +++ b/lib/routes/ft/channel.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { ctx.set( 'data', await utils.getData({ diff --git a/lib/routes/ft/myft.js b/lib/routes/ft/myft.js index 01b9383f7e1a89..7828053289002c 100644 --- a/lib/routes/ft/myft.js +++ b/lib/routes/ft/myft.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const ProcessFeed = (content) => { // clean up the article content.find('div.o-share, aside, div.o-ads').remove(); diff --git a/lib/routes/ft/router.js b/lib/routes/ft/router.js index 9ee72111f81fd1..dc82f6e6991751 100644 --- a/lib/routes/ft/router.js +++ b/lib/routes/ft/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/myft/:key', './myft'); router.get('/:language/:channel?', './channel'); }; diff --git a/lib/routes/fuliba/latest.js b/lib/routes/fuliba/latest.js index ca0eca551cf630..8c971b2ebeb809 100644 --- a/lib/routes/fuliba/latest.js +++ b/lib/routes/fuliba/latest.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got(`https://fuliba2023.net/wp-json/wp/v2/posts`, { searchParams: { per_page: ctx.req.query('limit') ?? 100, diff --git a/lib/routes/fuliba/router.js b/lib/routes/fuliba/router.js index d9d312e16f77d1..cd57ba05cfc495 100644 --- a/lib/routes/fuliba/router.js +++ b/lib/routes/fuliba/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/latest', './latest'); }; diff --git a/lib/routes/furstar/archive.js b/lib/routes/furstar/archive.js index 2f01598b11d190..48a8b171e59d93 100644 --- a/lib/routes/furstar/archive.js +++ b/lib/routes/furstar/archive.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const base = utils.langBase(ctx.req.param('lang')); const url = `${base}/archive.php`; const res = await got.get(url, { diff --git a/lib/routes/furstar/artists.js b/lib/routes/furstar/artists.js index 74577fbf638b7f..78b25f978b6957 100644 --- a/lib/routes/furstar/artists.js +++ b/lib/routes/furstar/artists.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const base = utils.langBase(ctx.req.param('lang')); const res = await got.get(base, { https: { diff --git a/lib/routes/furstar/index.js b/lib/routes/furstar/index.js index 7c567e04c8323b..f7d1199e1081e3 100644 --- a/lib/routes/furstar/index.js +++ b/lib/routes/furstar/index.js @@ -3,7 +3,7 @@ const utils = require('./utils'); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const base = utils.langBase(ctx.req.param('lang')); const res = await got.get(base, { https: { diff --git a/lib/routes/furstar/router.js b/lib/routes/furstar/router.js index 6ebef7346da5c2..eb5dfecb724b7a 100644 --- a/lib/routes/furstar/router.js +++ b/lib/routes/furstar/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/characters/:lang?', './index'); router.get('/artists/:lang?', './artists'); router.get('/archive/:lang?', './archive'); diff --git a/lib/routes/futunn/main.js b/lib/routes/futunn/main.js index 3080a61eed32e9..dcf1d442564269 100644 --- a/lib/routes/futunn/main.js +++ b/lib/routes/futunn/main.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; const rootUrl = 'https://news.futunn.com'; diff --git a/lib/routes/futunn/router.js b/lib/routes/futunn/router.js index 1289d27024fc4c..6ad68243cdb088 100644 --- a/lib/routes/futunn/router.js +++ b/lib/routes/futunn/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/highlights', './main'); router.get('/main', './main'); router.get('/', './main'); diff --git a/lib/routes/fx-markets/channel.js b/lib/routes/fx-markets/channel.js index 0fc6fee4e2b585..8c717029973334 100644 --- a/lib/routes/fx-markets/channel.js +++ b/lib/routes/fx-markets/channel.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const link = `https://www.fx-markets.com/${channel}`; const html = (await got(link)).data; diff --git a/lib/routes/fx-markets/router.js b/lib/routes/fx-markets/router.js index 3cd5e8b551d742..89186a042c4b41 100644 --- a/lib/routes/fx-markets/router.js +++ b/lib/routes/fx-markets/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:channel', './channel'); }; diff --git a/lib/routes/fx678/kx.js b/lib/routes/fx678/kx.js index 5244842b328f4a..d0686b64fa27ad 100644 --- a/lib/routes/fx678/kx.js +++ b/lib/routes/fx678/kx.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.fx678.com/kx/'; const res = await got.get(link); const $ = load(res.data); diff --git a/lib/routes/fx678/router.js b/lib/routes/fx678/router.js index 500760904dfe63..e3680504af2ef6 100644 --- a/lib/routes/fx678/router.js +++ b/lib/routes/fx678/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/kx', './kx'); }; diff --git a/lib/routes/fxiaoke/crm.js b/lib/routes/fxiaoke/crm.js index ea7e7fbf9f312c..bd3d99c6868ea1 100644 --- a/lib/routes/fxiaoke/crm.js +++ b/lib/routes/fxiaoke/crm.js @@ -12,7 +12,7 @@ const titleMap = new Map([ ['customers', `签约喜报 - ${baseTitle}`], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const t = ctx.req.param('type'); const title = titleMap.get(t); const url = `${baseUrl}/${t}/`; diff --git a/lib/routes/fxiaoke/router.js b/lib/routes/fxiaoke/router.js index f5461602bf3c97..da5d2b272cd3de 100644 --- a/lib/routes/fxiaoke/router.js +++ b/lib/routes/fxiaoke/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/crm/:type', './crm'); }; diff --git a/lib/routes/fzmtr/announcements.js b/lib/routes/fzmtr/announcements.js index a2c68a94ec4cbc..bbf28d3ce27149 100644 --- a/lib/routes/fzmtr/announcements.js +++ b/lib/routes/fzmtr/announcements.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const domain = 'www.fzmtr.com'; const announcementsUrl = `http://${domain}/html/fzdt/tzgg/index.html`; const response = await got(announcementsUrl); diff --git a/lib/routes/fzmtr/router.js b/lib/routes/fzmtr/router.js index 398ac14fd3945a..1fbe48e555f30f 100644 --- a/lib/routes/fzmtr/router.js +++ b/lib/routes/fzmtr/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/announcements', './announcements'); }; diff --git a/lib/routes/gameapps/index.js b/lib/routes/gameapps/index.js index 2d4184fb24738c..3d3e1b4e41dc9b 100644 --- a/lib/routes/gameapps/index.js +++ b/lib/routes/gameapps/index.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.gameapps.hk'; const feed = await parser.parseURL(`${baseUrl}/rss`); diff --git a/lib/routes/gameapps/router.js b/lib/routes/gameapps/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/gameapps/router.js +++ b/lib/routes/gameapps/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/gamebase/news.js b/lib/routes/gamebase/news.js index 0ec49069eca191..3b97aedd1755ea 100644 --- a/lib/routes/gamebase/news.js +++ b/lib/routes/gamebase/news.js @@ -9,7 +9,7 @@ const types = { r18list: 'newsPornList', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'newslist'; const category = ctx.req.param('category') ?? 'all'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; diff --git a/lib/routes/gamebase/router.js b/lib/routes/gamebase/router.js index a105ef7f2047a3..c7fcbd9d9ab8f1 100644 --- a/lib/routes/gamebase/router.js +++ b/lib/routes/gamebase/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:type?/:category?', './news'); }; diff --git a/lib/routes/gamegene/news.js b/lib/routes/gamegene/news.js index 27210bb09984f7..ff2171233bae73 100644 --- a/lib/routes/gamegene/news.js +++ b/lib/routes/gamegene/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://gamegene.cn/news'; const { data: response } = await got({ method: 'get', diff --git a/lib/routes/gamegene/router.js b/lib/routes/gamegene/router.js index bd25c22a2fd87b..3c9877e17cb637 100644 --- a/lib/routes/gamegene/router.js +++ b/lib/routes/gamegene/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/gamer/gnn-index.js b/lib/routes/gamer/gnn-index.js index 869725e7b7c244..fafa2fa59b91f5 100644 --- a/lib/routes/gamer/gnn-index.js +++ b/lib/routes/gamer/gnn-index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); let url = ''; let categoryName = ''; diff --git a/lib/routes/gamer/hot.js b/lib/routes/gamer/hot.js index 1576b0490a502f..8649b60524386b 100644 --- a/lib/routes/gamer/hot.js +++ b/lib/routes/gamer/hot.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = `https://forum.gamer.com.tw/A.php?bsn=${ctx.req.param('bsn')}`; const response = await got({ url: rootUrl, diff --git a/lib/routes/gamer/router.js b/lib/routes/gamer/router.js index 394758b2750e20..60e6d43f50d0ad 100644 --- a/lib/routes/gamer/router.js +++ b/lib/routes/gamer/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/gnn/:category?', './gnn-index'); router.get('/hot/:bsn', './hot'); }; diff --git a/lib/routes/gamersecret/index.js b/lib/routes/gamersecret/index.js index 19e42ab62fbc14..c6dae62f1356b0 100644 --- a/lib/routes/gamersecret/index.js +++ b/lib/routes/gamersecret/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'latest-news'; const category = ctx.req.param('category') ?? ''; diff --git a/lib/routes/gamersecret/router.js b/lib/routes/gamersecret/router.js index c57b4b9b661e8a..8591b506201fae 100644 --- a/lib/routes/gamersecret/router.js +++ b/lib/routes/gamersecret/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?/:category?', './index'); }; diff --git a/lib/routes/gamme/category.js b/lib/routes/gamme/category.js index 7bc483d38391d2..6f2f6e6d2eb239 100644 --- a/lib/routes/gamme/category.js +++ b/lib/routes/gamme/category.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import parser from '@/utils/rss-parser'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const { domain = 'news', category } = ctx.req.param(); if (!isValidHost(domain)) { throw new Error('Invalid domain'); diff --git a/lib/routes/gamme/router.js b/lib/routes/gamme/router.js index 09adc8bd4bca15..2607cf611e7530 100644 --- a/lib/routes/gamme/router.js +++ b/lib/routes/gamme/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:domain/:category?', './category'); router.get('/:domain/tag/:tag', './tag'); }; diff --git a/lib/routes/gamme/tag.js b/lib/routes/gamme/tag.js index be8d442a6acfd9..bceca645701bef 100644 --- a/lib/routes/gamme/tag.js +++ b/lib/routes/gamme/tag.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const { domain = 'news', tag } = ctx.req.param(); if (!isValidHost(domain)) { throw new Error('Invalid domain'); diff --git a/lib/routes/gcores/category.js b/lib/routes/gcores/category.js index df2f64c09fb017..63f29ab3b3944e 100644 --- a/lib/routes/gcores/category.js +++ b/lib/routes/gcores/category.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const url = `https://www.gcores.com/${category}`; const res = await got({ diff --git a/lib/routes/gcores/collection.js b/lib/routes/gcores/collection.js index 6bd0fec71e2082..3ab27f475a7f84 100644 --- a/lib/routes/gcores/collection.js +++ b/lib/routes/gcores/collection.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; /* refer to: ./tag.js (author: @StevenREC0) */ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { // get params const collection = ctx.req.param('collection'); diff --git a/lib/routes/gcores/radio.js b/lib/routes/gcores/radio.js index 5ea86daea319a8..478f6fd4f281dd 100644 --- a/lib/routes/gcores/radio.js +++ b/lib/routes/gcores/radio.js @@ -5,7 +5,7 @@ import got from '@/utils/got'; import md5 from '@/utils/md5'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || 'all'; const limit = Number.parseInt(ctx.req.query('limit')) || 12; diff --git a/lib/routes/gcores/router.js b/lib/routes/gcores/router.js index 8476d261b20434..e06ed2e1c2c530 100644 --- a/lib/routes/gcores/router.js +++ b/lib/routes/gcores/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/category/:category', './category'); router.get('/collections/:collection', './collection'); router.get('/radios/:category?', './radio'); diff --git a/lib/routes/gcores/tag.js b/lib/routes/gcores/tag.js index 28580e6e4beb81..17730a1b84a632 100644 --- a/lib/routes/gcores/tag.js +++ b/lib/routes/gcores/tag.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const category = ctx.req.param('category'); const url = `https://www.gcores.com/categories/${tag + (category ? `?tab=${category}` : '')}`; diff --git a/lib/routes/gdsrx/index.js b/lib/routes/gdsrx/index.js index 1f7f3e3edc8697..caccbe9ff54a07 100644 --- a/lib/routes/gdsrx/index.js +++ b/lib/routes/gdsrx/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = '10' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 15; diff --git a/lib/routes/gdsrx/router.js b/lib/routes/gdsrx/router.js index 9a89c08e9369b2..6c52c5718bdda8 100644 --- a/lib/routes/gdsrx/router.js +++ b/lib/routes/gdsrx/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id?', './'); }; diff --git a/lib/routes/gdut/news.js b/lib/routes/gdut/news.js index 2f2aa21fb91e3a..d8fbf442ac08ab 100644 --- a/lib/routes/gdut/news.js +++ b/lib/routes/gdut/news.js @@ -56,7 +56,7 @@ async function getCookie() { return cookie; } -module.exports = async (ctx) => { +export default async (ctx) => { const page = '/ArticleList.aspx?category=4'; // 缓存cookie diff --git a/lib/routes/gdut/oa-news.js b/lib/routes/gdut/oa-news.js index 41ed55afcaf679..aace2d89fd64cd 100644 --- a/lib/routes/gdut/oa-news.js +++ b/lib/routes/gdut/oa-news.js @@ -71,7 +71,7 @@ function getArg(type) { ]); } -module.exports = async (ctx) => { +export default async (ctx) => { const typeParam = ctx.req.param('type') ?? 'notice'; if (typeMap[typeParam] === undefined) { throw new Error('通知类型' + typeParam + '未定义'); diff --git a/lib/routes/gdut/router.js b/lib/routes/gdut/router.js index 4742b34eaaeacf..b0b07cbb3279d8 100644 --- a/lib/routes/gdut/router.js +++ b/lib/routes/gdut/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/oa_news/:type?', './oa-news'); }; diff --git a/lib/routes/gelonghui/home.js b/lib/routes/gelonghui/home.js index c62a0024ed7001..7f5d25daba87f4 100644 --- a/lib/routes/gelonghui/home.js +++ b/lib/routes/gelonghui/home.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { tag = 'web_home_page' } = ctx.req.param(); const apiUrl = `https://www.gelonghui.com/api/channels/${tag}/articles/v8`; const { data } = await got(apiUrl); diff --git a/lib/routes/gelonghui/hot-article.js b/lib/routes/gelonghui/hot-article.js index 826a85d7ee0cae..48636bac692308 100644 --- a/lib/routes/gelonghui/hot-article.js +++ b/lib/routes/gelonghui/hot-article.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') === 'week' ? 1 : 0; const baseUrl = `https://www.gelonghui.com`; const { data: response } = await got(baseUrl); diff --git a/lib/routes/gelonghui/keyword.js b/lib/routes/gelonghui/keyword.js index 0622136e586c3f..e9700123259079 100644 --- a/lib/routes/gelonghui/keyword.js +++ b/lib/routes/gelonghui/keyword.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const currentUrl = `https://www.gelonghui.com/api/post/search/v4`; const { data } = await got(currentUrl, { diff --git a/lib/routes/gelonghui/live.js b/lib/routes/gelonghui/live.js index 3a2bf59fa7ea08..81c8bf46a25130 100644 --- a/lib/routes/gelonghui/live.js +++ b/lib/routes/gelonghui/live.js @@ -5,7 +5,7 @@ import * as path from 'node:path'; const baseUrl = 'https://www.gelonghui.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const apiUrl = `${baseUrl}/api/live-channels/all/lives/v4`; const { data: { result }, diff --git a/lib/routes/gelonghui/router.js b/lib/routes/gelonghui/router.js index f73acce6c15670..8dbdfa086c1257 100644 --- a/lib/routes/gelonghui/router.js +++ b/lib/routes/gelonghui/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/home/:tag?', './home'); router.get('/hot-article/:type?', './hot-article'); router.get('/keyword/:keyword', './keyword'); diff --git a/lib/routes/gelonghui/subject.js b/lib/routes/gelonghui/subject.js index 73b2da194ad23c..30b0e35e8a8be8 100644 --- a/lib/routes/gelonghui/subject.js +++ b/lib/routes/gelonghui/subject.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const apiUrl = `https://www.gelonghui.com/api/subjects/${id}/contents`; const pageUrl = `https://www.gelonghui.com/subject/${id}`; diff --git a/lib/routes/gelonghui/user.js b/lib/routes/gelonghui/user.js index e52d7c576bc511..299cf64c997d82 100644 --- a/lib/routes/gelonghui/user.js +++ b/lib/routes/gelonghui/user.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id: userId } = ctx.req.param(); const currentUrl = 'https://www.gelonghui.com/api/community/dynamic/my-dynamics/v2'; const { data } = await got(currentUrl, { diff --git a/lib/routes/geocaching/blogs.js b/lib/routes/geocaching/blogs.js index 60a9b00c8ca5b2..10341fe286a9ef 100644 --- a/lib/routes/geocaching/blogs.js +++ b/lib/routes/geocaching/blogs.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.geocaching.com'; const { data: response } = await got(`${baseUrl}/blog/wp-json/wp/v2/posts`, { searchParams: { diff --git a/lib/routes/geocaching/router.js b/lib/routes/geocaching/router.js index 1d9f17cdc2600f..19aa5e245f4327 100644 --- a/lib/routes/geocaching/router.js +++ b/lib/routes/geocaching/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/blogs', './blogs'); }; diff --git a/lib/routes/getdr/index.js b/lib/routes/getdr/index.js index 48f3254c5f0496..4f1ebdba8889e8 100644 --- a/lib/routes/getdr/index.js +++ b/lib/routes/getdr/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://getdr.com/最新詐騙情報'; const apiUrl = 'https://public-api.wordpress.com/rest/v1.1/sites/demogetdr.wordpress.com/posts'; diff --git a/lib/routes/getdr/router.js b/lib/routes/getdr/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/getdr/router.js +++ b/lib/routes/getdr/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/getitfree/index.js b/lib/routes/getitfree/index.js index 83184f474b2707..2ef392edc2ece1 100644 --- a/lib/routes/getitfree/index.js +++ b/lib/routes/getitfree/index.js @@ -15,7 +15,7 @@ const { parseFilterStr, } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const filter = ctx.req.param('filter'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/getitfree/router.js b/lib/routes/getitfree/router.js index 2bc6cdcd220302..294eda5f5ea768 100644 --- a/lib/routes/getitfree/router.js +++ b/lib/routes/getitfree/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:filter*', './index'); }; diff --git a/lib/routes/gettr/router.js b/lib/routes/gettr/router.js index ed709f330aa29a..a7fbaa70aa8a1e 100644 --- a/lib/routes/gettr/router.js +++ b/lib/routes/gettr/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/user/:id', './user'); }; diff --git a/lib/routes/gettr/user.js b/lib/routes/gettr/user.js index 68d015f5eb7b67..da7c972cfac048 100644 --- a/lib/routes/gettr/user.js +++ b/lib/routes/gettr/user.js @@ -9,7 +9,7 @@ const actionMap = { shares_pst: 'Shared a post: ', }; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://gettr.com'; const apiHost = 'https://api.gettr.com'; const mediaHost = 'https://media.gettr.com'; diff --git a/lib/routes/gf-cn/news.js b/lib/routes/gf-cn/news.js index d46c2005b1fd62..e20a395afced20 100644 --- a/lib/routes/gf-cn/news.js +++ b/lib/routes/gf-cn/news.js @@ -8,7 +8,7 @@ const titles = { 3: '公告', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '1'; const rootUrl = 'https://gf-cn.sunborngame.com'; diff --git a/lib/routes/gf-cn/router.js b/lib/routes/gf-cn/router.js index 07a7a2990cfb44..ec7c5eda5bf4b4 100644 --- a/lib/routes/gf-cn/router.js +++ b/lib/routes/gf-cn/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:category?', './news'); }; diff --git a/lib/routes/gihyo/group.js b/lib/routes/gihyo/group.js index 3c9185d602ae7a..deffdfb804e943 100644 --- a/lib/routes/gihyo/group.js +++ b/lib/routes/gihyo/group.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const groupId = ctx.req.param('id'); const baseUrl = 'https://gihyo.jp'; diff --git a/lib/routes/gihyo/router.js b/lib/routes/gihyo/router.js index c5249110e5d1d4..1a464b51fcabc7 100644 --- a/lib/routes/gihyo/router.js +++ b/lib/routes/gihyo/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/list/group/:id', './group'); }; diff --git a/lib/routes/gitee/repos/commits.js b/lib/routes/gitee/repos/commits.js index c7865a098aa002..5dae915dab3047 100644 --- a/lib/routes/gitee/repos/commits.js +++ b/lib/routes/gitee/repos/commits.js @@ -6,7 +6,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const { owner, repo } = ctx.req.param(); const apiUrl = `https://gitee.com/api/v5/repos/${owner}/${repo}/commits`; diff --git a/lib/routes/gitee/repos/events.js b/lib/routes/gitee/repos/events.js index 4339b0d236c0b3..6e5f5c19592ae8 100644 --- a/lib/routes/gitee/repos/events.js +++ b/lib/routes/gitee/repos/events.js @@ -6,7 +6,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const { owner, repo } = ctx.req.param(); const apiUrl = `https://gitee.com/api/v5/repos/${owner}/${repo}/events`; diff --git a/lib/routes/gitee/repos/releases.js b/lib/routes/gitee/repos/releases.js index 7a97be09c4c383..bf9123ed10bccb 100644 --- a/lib/routes/gitee/repos/releases.js +++ b/lib/routes/gitee/repos/releases.js @@ -5,7 +5,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const { owner, repo } = ctx.req.param(); const response = await got(`https://gitee.com/api/v5/repos/${owner}/${repo}/releases`, { diff --git a/lib/routes/gitee/router.js b/lib/routes/gitee/router.js index 709362d85df96a..9ab870de285b8b 100644 --- a/lib/routes/gitee/router.js +++ b/lib/routes/gitee/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/commits/:owner/:repo', './repos/commits'); router.get('/events/:owner/:repo', './repos/events'); router.get('/events/:username', './users/events'); diff --git a/lib/routes/gitee/users/events.js b/lib/routes/gitee/users/events.js index 1753f301f7f34c..0044eccb2bb30c 100644 --- a/lib/routes/gitee/users/events.js +++ b/lib/routes/gitee/users/events.js @@ -6,7 +6,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const username = ctx.req.param('username'); const apiUrl = `https://gitee.com/api/v5/users/${username}/events/public`; diff --git a/lib/routes/github/branches.js b/lib/routes/github/branches.js index 4358e423d3feca..bac3c769c1bd8a 100644 --- a/lib/routes/github/branches.js +++ b/lib/routes/github/branches.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const repo = ctx.req.param('repo'); diff --git a/lib/routes/github/comments.js b/lib/routes/github/comments.js index 37b43f2ceeee59..8fe7b2ee957331 100644 --- a/lib/routes/github/comments.js +++ b/lib/routes/github/comments.js @@ -18,7 +18,7 @@ const typeDict = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const repo = ctx.req.param('repo'); const number = ctx.req.param('number') && isNaN(Number.parseInt(ctx.req.param('number'))) ? 1 : Number.parseInt(ctx.req.param('number')); diff --git a/lib/routes/github/contributors.js b/lib/routes/github/contributors.js index 0ca65b6cdc333b..21769dd9fcf822 100644 --- a/lib/routes/github/contributors.js +++ b/lib/routes/github/contributors.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo, order, anon } = ctx.req.param(); const host = `https://github.com/${user}/${repo}`; diff --git a/lib/routes/github/file.js b/lib/routes/github/file.js index 753ed8fe98e6e4..11846cacf2d984 100644 --- a/lib/routes/github/file.js +++ b/lib/routes/github/file.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import queryString from 'query-string'; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const repo = ctx.req.param('repo'); const branch = ctx.req.param('branch'); diff --git a/lib/routes/github/follower.js b/lib/routes/github/follower.js index fefddc55ca84bd..c411f1891a4ddc 100644 --- a/lib/routes/github/follower.js +++ b/lib/routes/github/follower.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.github || !config.github.access_token) { throw new Error('GitHub follower RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/github/gist.js b/lib/routes/github/gist.js index babca852ce88fb..478aaa43e0de84 100644 --- a/lib/routes/github/gist.js +++ b/lib/routes/github/gist.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const gistId = ctx.req.param('gistId'); const headers = { Accept: 'application/vnd.github.v3+json' }; diff --git a/lib/routes/github/issue.js b/lib/routes/github/issue.js index d53d9d1825f153..5f00314e6b02ad 100644 --- a/lib/routes/github/issue.js +++ b/lib/routes/github/issue.js @@ -7,7 +7,7 @@ const md = require('markdown-it')({ import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const repo = ctx.req.param('repo'); const state = ctx.req.param('state'); diff --git a/lib/routes/github/notifications.js b/lib/routes/github/notifications.js index 5ef68c601c8077..af98c7154f0988 100644 --- a/lib/routes/github/notifications.js +++ b/lib/routes/github/notifications.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const apiUrl = 'https://api.github.com'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.github || !config.github.access_token) { throw new Error('GitHub trending RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/github/pulls.js b/lib/routes/github/pulls.js index b28fb96c4bcb08..a1acedb3686b8e 100644 --- a/lib/routes/github/pulls.js +++ b/lib/routes/github/pulls.js @@ -6,7 +6,7 @@ const md = require('markdown-it')({ }); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const repo = ctx.req.param('repo'); const state = ctx.req.param('state') ?? 'open'; diff --git a/lib/routes/github/pulse.js b/lib/routes/github/pulse.js index 4d50012b46e261..39be02d5822931 100644 --- a/lib/routes/github/pulse.js +++ b/lib/routes/github/pulse.js @@ -5,7 +5,7 @@ import md5 from '@/utils/md5'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo, period } = ctx.req.param(); const periods = ['daily', 'halfweekly', 'weekly', 'monthly']; diff --git a/lib/routes/github/repos.js b/lib/routes/github/repos.js index 96a0ca660b539f..9f96b399fffd80 100644 --- a/lib/routes/github/repos.js +++ b/lib/routes/github/repos.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import queryString from 'query-string'; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const headers = {}; diff --git a/lib/routes/github/router.js b/lib/routes/github/router.js index a3832ad4c517c2..4811c0bb2a2813 100644 --- a/lib/routes/github/router.js +++ b/lib/routes/github/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/branches/:user/:repo', './branches'); router.get('/comments/:user/:repo/:type/:number', './comments'); // deprecated router.get('/comments/:user/:repo/:number?', './comments'); diff --git a/lib/routes/github/search.js b/lib/routes/github/search.js index a3977b63137e75..21e40c99b592bf 100644 --- a/lib/routes/github/search.js +++ b/lib/routes/github/search.js @@ -4,7 +4,7 @@ const url = require('url'); const host = 'https://github.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const query = ctx.req.param('query'); let sort = ctx.req.param('sort') || 'bestmatch'; const order = ctx.req.param('order') || 'desc'; diff --git a/lib/routes/github/star.js b/lib/routes/github/star.js index e2d3cbf2af19d0..ef5b7fdce1527b 100644 --- a/lib/routes/github/star.js +++ b/lib/routes/github/star.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.github || !config.github.access_token) { throw new Error('GitHub star RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/github/starred-repos.js b/lib/routes/github/starred-repos.js index 99d9c60ea8fc13..e28cfbdee8c936 100644 --- a/lib/routes/github/starred-repos.js +++ b/lib/routes/github/starred-repos.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.github || !config.github.access_token) { throw new Error('GitHub star RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/github/topic.js b/lib/routes/github/topic.js index b2f967b3071701..d501d2453107ff 100644 --- a/lib/routes/github/topic.js +++ b/lib/routes/github/topic.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `https://github.com/topics/${ctx.req.param('name')}`; const { data, url } = await got(link, { searchParams: new URLSearchParams(ctx.req.param('qs')), diff --git a/lib/routes/github/trending.js b/lib/routes/github/trending.js index 537b5bb266a9e8..9177359d7e0f07 100644 --- a/lib/routes/github/trending.js +++ b/lib/routes/github/trending.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import { load } from 'cheerio'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.github || !config.github.access_token) { throw new Error('GitHub trending RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/github/wiki.js b/lib/routes/github/wiki.js index 846ed6f2f7fb87..1c6443ed30ef49 100644 --- a/lib/routes/github/wiki.js +++ b/lib/routes/github/wiki.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://github.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo, page } = ctx.req.param(); const url = `${baseUrl}/${user}/${repo}/wiki${page ? `/${page}` : ''}/_history`; diff --git a/lib/routes/gitpod/blog.js b/lib/routes/gitpod/blog.js index a188f68204243d..d6fbbd67dd29db 100644 --- a/lib/routes/gitpod/blog.js +++ b/lib/routes/gitpod/blog.js @@ -6,7 +6,7 @@ const { rootUrl } = require('./utils'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10; const response = await got(rootUrl + '/blog'); const $ = load(response.data); diff --git a/lib/routes/gitpod/changelog.js b/lib/routes/gitpod/changelog.js index 94ac8e04f3ec08..3122959d30715c 100644 --- a/lib/routes/gitpod/changelog.js +++ b/lib/routes/gitpod/changelog.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { rootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(rootUrl + '/changelog'); const $ = load(response.data); const items = $('div[class^=changelog-entry]') diff --git a/lib/routes/gitpod/router.js b/lib/routes/gitpod/router.js index c7151bcc4aa0e9..8e830fc8ab1d89 100644 --- a/lib/routes/gitpod/router.js +++ b/lib/routes/gitpod/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog', './blog'); router.get('/changelog', './changelog'); }; diff --git a/lib/routes/globallawreview/index.js b/lib/routes/globallawreview/index.js index b104fbd13a3bee..c67e53e4872374 100644 --- a/lib/routes/globallawreview/index.js +++ b/lib/routes/globallawreview/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; const rootUrl = 'http://www.globallawreview.org'; diff --git a/lib/routes/globallawreview/router.js b/lib/routes/globallawreview/router.js index 8860aaeafd54de..f15cf51c5b114d 100644 --- a/lib/routes/globallawreview/router.js +++ b/lib/routes/globallawreview/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './'); }; diff --git a/lib/routes/gocn/jobs.js b/lib/routes/gocn/jobs.js index 212a50f9d20f39..de7a5e2de3f670 100644 --- a/lib/routes/gocn/jobs.js +++ b/lib/routes/gocn/jobs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { renderHTML } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const api_url = 'https://gocn.vip/api/files?spaceGuid=Gd7OHl¤tPage=1&sort=1'; const base_url = 'https://gocn.vip/c/3lQ6GbD5ny/s/Gd7OHl'; const job_url = 'https://gocn.vip/c/3lQ6GbD5ny'; diff --git a/lib/routes/gocn/news.js b/lib/routes/gocn/news.js index 4b741d9e18c609..91b515a820cc7e 100644 --- a/lib/routes/gocn/news.js +++ b/lib/routes/gocn/news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { renderHTML } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const base_url = 'https://gocn.vip/c/3lQ6GbD5ny/home'; const article_url = 'https://gocn.vip/c/3lQ6GbD5ny'; const api_url = 'https://gocn.vip/api/home/page'; diff --git a/lib/routes/gocn/router.js b/lib/routes/gocn/router.js index d586df53d5b833..10d72dee51549d 100644 --- a/lib/routes/gocn/router.js +++ b/lib/routes/gocn/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './news'); router.get('/jobs', './jobs'); router.get('/news', './news'); diff --git a/lib/routes/gocn/topics.js b/lib/routes/gocn/topics.js index 71bc97a358f82e..7f5485088bd9c9 100644 --- a/lib/routes/gocn/topics.js +++ b/lib/routes/gocn/topics.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { renderHTML } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const base_url = 'https://gocn.vip/c/3lQ6GbD5ny/home'; const article_url = 'https://gocn.vip/c/3lQ6GbD5ny'; const api_url = 'https://gocn.vip/api/files?spaceGuid=Gd7BTB¤tPage=1&sort=1'; diff --git a/lib/routes/gofans/index.js b/lib/routes/gofans/index.js index 5a190b3ca9707e..0e5050f410fed6 100644 --- a/lib/routes/gofans/index.js +++ b/lib/routes/gofans/index.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { kind = '' } = ctx.req.param(); const baseUrl = 'https://gofans.cn'; diff --git a/lib/routes/gofans/router.js b/lib/routes/gofans/router.js index 71c1909bcedac9..8e975f6c44fec5 100644 --- a/lib/routes/gofans/router.js +++ b/lib/routes/gofans/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:kind?', './index'); }; diff --git a/lib/routes/gogoanimehd/recent-releases.js b/lib/routes/gogoanimehd/recent-releases.js index 222678a43f8bd2..5b8aa52b28a19d 100644 --- a/lib/routes/gogoanimehd/recent-releases.js +++ b/lib/routes/gogoanimehd/recent-releases.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://anitaku.to/home.html'; const response = await got({ diff --git a/lib/routes/gogoanimehd/router.js b/lib/routes/gogoanimehd/router.js index 2c021bbe65fc22..2a95e1d740f3ff 100644 --- a/lib/routes/gogoanimehd/router.js +++ b/lib/routes/gogoanimehd/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/recent-releases', './recent-releases'); }; diff --git a/lib/routes/google/album.js b/lib/routes/google/album.js index 5a6e93018158b5..d774277208af93 100644 --- a/lib/routes/google/album.js +++ b/lib/routes/google/album.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const url = `https://photos.app.goo.gl/${id}?_imcp=1`; diff --git a/lib/routes/google/alerts.js b/lib/routes/google/alerts.js index fbf9e17698d15c..6185459f5dc3f9 100644 --- a/lib/routes/google/alerts.js +++ b/lib/routes/google/alerts.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const { data: response, url: link } = await got('https://www.google.com/alerts/preview', { diff --git a/lib/routes/google/citations.js b/lib/routes/google/citations.js index 057c6d332ba717..d8eca8d93d1e23 100644 --- a/lib/routes/google/citations.js +++ b/lib/routes/google/citations.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const BASE_URL = `https://scholar.google.com`; const url = `https://scholar.google.com/citations?user=${id}`; diff --git a/lib/routes/google/doodles.js b/lib/routes/google/doodles.js index 7d519090823538..951aceb5681be0 100644 --- a/lib/routes/google/doodles.js +++ b/lib/routes/google/doodles.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const { language = 'zh-CN' } = ctx.req.param(); const current = new Date(); const year = current.getFullYear(); diff --git a/lib/routes/google/fonts.js b/lib/routes/google/fonts.js index f04aadebc4de47..49f51f7f43f604 100644 --- a/lib/routes/google/fonts.js +++ b/lib/routes/google/fonts.js @@ -12,7 +12,7 @@ const titleMap = { style: 'Number of styles', }; -module.exports = async (ctx) => { +export default async (ctx) => { const sort = ctx.req.param('sort') ?? 'date'; const limit = ctx.req.param('limit') ?? 25; diff --git a/lib/routes/google/news.js b/lib/routes/google/news.js index 4fb3c0559de814..0aaf602b49746e 100644 --- a/lib/routes/google/news.js +++ b/lib/routes/google/news.js @@ -7,7 +7,7 @@ import * as path from 'node:path'; const baseUrl = 'https://news.google.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const locale = ctx.req.param('locale'); diff --git a/lib/routes/google/router.js b/lib/routes/google/router.js index 9035aff54a0fe5..13ccbab2965394 100644 --- a/lib/routes/google/router.js +++ b/lib/routes/google/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/album/:id', './album'); router.get('/alerts/:keyword', './alerts'); router.get('/citations/:id', './citations'); diff --git a/lib/routes/google/scholar.js b/lib/routes/google/scholar.js index e96d44f4753f57..c0dd45fa01a1fc 100644 --- a/lib/routes/google/scholar.js +++ b/lib/routes/google/scholar.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { let params = ctx.req.param('query'); let query = params; let description = `Google Scholar Monitor Query: ${query}`; diff --git a/lib/routes/google/search.js b/lib/routes/google/search.js index 3c846e901cdd37..7770caeac499ec 100644 --- a/lib/routes/google/search.js +++ b/lib/routes/google/search.js @@ -7,7 +7,7 @@ import { config } from '@/config'; const renderDescription = (description, images) => art(path.join(__dirname, './templates/description.art'), { description, images }); -module.exports = async (ctx) => { +export default async (ctx) => { const { keyword, language } = ctx.req.param(); const searchParams = new URLSearchParams({ q: keyword, diff --git a/lib/routes/gov/anhui/kjt.js b/lib/routes/gov/anhui/kjt.js index 15d1e73826c0fc..905b31ff176898 100644 --- a/lib/routes/gov/anhui/kjt.js +++ b/lib/routes/gov/anhui/kjt.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = ctx.params[0] ?? 'kjzx/tzgg'; const rootUrl = 'http://kjt.ah.gov.cn'; diff --git a/lib/routes/gov/beijing/bjedu/gh.js b/lib/routes/gov/beijing/bjedu/gh.js index 586a3d53f4d13e..e040ff3105b7a1 100644 --- a/lib/routes/gov/beijing/bjedu/gh.js +++ b/lib/routes/gov/beijing/bjedu/gh.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://gh.bjedu.cn'; const { urlPath = 'zxtzgg' } = ctx.req.param(); diff --git a/lib/routes/gov/beijing/bphc/index.js b/lib/routes/gov/beijing/bphc/index.js index b5724daaae0a69..9398107850c18c 100644 --- a/lib/routes/gov/beijing/bphc/index.js +++ b/lib/routes/gov/beijing/bphc/index.js @@ -19,7 +19,7 @@ const mapping = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://gycpt.bphc.com.cn'; const defaultPath = 'announcement'; diff --git a/lib/routes/gov/beijing/jw/tzgg.js b/lib/routes/gov/beijing/jw/tzgg.js index 4b16791aeaf1fe..8a857f2349fe34 100644 --- a/lib/routes/gov/beijing/jw/tzgg.js +++ b/lib/routes/gov/beijing/jw/tzgg.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://jw.beijing.gov.cn'; const currentUrl = `${rootUrl}/tzgg`; diff --git a/lib/routes/gov/beijing/kw/index.js b/lib/routes/gov/beijing/kw/index.js index 07321a43ff11ca..7fa9508281819f 100644 --- a/lib/routes/gov/beijing/kw/index.js +++ b/lib/routes/gov/beijing/kw/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'http://kw.beijing.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const url = `${rootUrl}/col/${channel}/index.html`; diff --git a/lib/routes/gov/caac/cjwt.js b/lib/routes/gov/caac/cjwt.js index ce60118463f34b..913bab17379f14 100644 --- a/lib/routes/gov/caac/cjwt.js +++ b/lib/routes/gov/caac/cjwt.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/cac/index.js b/lib/routes/gov/cac/index.js index 8f5702a0641f98..db82fcdb063dc4 100644 --- a/lib/routes/gov/cac/index.js +++ b/lib/routes/gov/cac/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = ctx.params[0]; const host = 'http://www.cac.gov.cn'; const homepage = `${host}/index.htm`; diff --git a/lib/routes/gov/ccdi/index.js b/lib/routes/gov/ccdi/index.js index 64bf4812a61675..f7fc8fa78d5a32 100644 --- a/lib/routes/gov/ccdi/index.js +++ b/lib/routes/gov/ccdi/index.js @@ -1,7 +1,7 @@ import { getSubPath } from '@/utils/common-utils'; const { rootUrl, parseNewsList, parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const defaultPath = '/yaowenn/'; let pathname = getSubPath(ctx).replaceAll(/(^\/ccdi|\/$)/g, ''); diff --git a/lib/routes/gov/chinamine-safety/xw.js b/lib/routes/gov/chinamine-safety/xw.js index 269d795c97ad30..fd50957c51db41 100644 --- a/lib/routes/gov/chinamine-safety/xw.js +++ b/lib/routes/gov/chinamine-safety/xw.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const { rootUrl, processItems, fetchData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'yjglbyw' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/chinamine-safety/zfxxgk.js b/lib/routes/gov/chinamine-safety/zfxxgk.js index 46736de0c96047..1e19bff26dc99f 100644 --- a/lib/routes/gov/chinamine-safety/zfxxgk.js +++ b/lib/routes/gov/chinamine-safety/zfxxgk.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const { rootUrl, processItems, fetchData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'fdzdgknr/tzgg' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/chinatax/latest.js b/lib/routes/gov/chinatax/latest.js index 7c0512001f75c8..d3c4bbb0d40135 100644 --- a/lib/routes/gov/chinatax/latest.js +++ b/lib/routes/gov/chinatax/latest.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `http://www.chinatax.gov.cn/chinatax/n810341/n810755/index.html`; const response = await got({ diff --git a/lib/routes/gov/chongqing/gzw.js b/lib/routes/gov/chongqing/gzw.js index 6f0d828509248d..4d770d941258e8 100644 --- a/lib/routes/gov/chongqing/gzw.js +++ b/lib/routes/gov/chongqing/gzw.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'tzgg_191' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 15; diff --git a/lib/routes/gov/chongqing/rsks.js b/lib/routes/gov/chongqing/rsks.js index 46b827571fe55e..0bbb949c592694 100644 --- a/lib/routes/gov/chongqing/rsks.js +++ b/lib/routes/gov/chongqing/rsks.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const rsksUrl = 'https://rlsbj.cq.gov.cn/ywzl/rsks/tzgg_109374/'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got(rsksUrl); const $ = load(response); // 获取考试信息标题 diff --git a/lib/routes/gov/chongqing/sydwgkzp.js b/lib/routes/gov/chongqing/sydwgkzp.js index 6367846fc559f4..a09d4c017340dd 100644 --- a/lib/routes/gov/chongqing/sydwgkzp.js +++ b/lib/routes/gov/chongqing/sydwgkzp.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; // 重庆市事业单位公开招聘 const sydwgkzpUrl = 'https://rlsbj.cq.gov.cn/zwxx_182/sydw/'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got(sydwgkzpUrl); const $ = load(response); diff --git a/lib/routes/gov/cmse/fxrw.js b/lib/routes/gov/cmse/fxrw.js index d9aa738ed4f4e8..3f4b6435a6eac7 100644 --- a/lib/routes/gov/cmse/fxrw.js +++ b/lib/routes/gov/cmse/fxrw.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://www.cmse.gov.cn'; const currentUrl = `${rootUrl}/fxrw/`; diff --git a/lib/routes/gov/cmse/index.js b/lib/routes/gov/cmse/index.js index dff4caa3bab14d..1463f4b67ff08c 100644 --- a/lib/routes/gov/cmse/index.js +++ b/lib/routes/gov/cmse/index.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = getSubPath(ctx).replaceAll(/(^\/cmse|\/$)/g, ''); const rootUrl = 'http://www.cmse.gov.cn'; diff --git a/lib/routes/gov/cnnic/index.js b/lib/routes/gov/cnnic/index.js index 3c1f7dff0e034e..f3ce9f77fe48dd 100644 --- a/lib/routes/gov/cnnic/index.js +++ b/lib/routes/gov/cnnic/index.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = getSubPath(ctx).replaceAll(/^\/cnnic/g, ''); const rootUrl = 'http://www.cnnic.net.cn'; diff --git a/lib/routes/gov/csrc/auditstatus.js b/lib/routes/gov/csrc/auditstatus.js index c5df245ea10f69..60e56619c307cc 100644 --- a/lib/routes/gov/csrc/auditstatus.js +++ b/lib/routes/gov/csrc/auditstatus.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import md5 from '@/utils/md5'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://neris.csrc.gov.cn'; const { apply_id } = ctx.req.param(); const itemUrl = `${baseUrl}/alappl/home1/onlinealog`; diff --git a/lib/routes/gov/csrc/news.js b/lib/routes/gov/csrc/news.js index 1eec510be6e68b..6ae2b1869fe069 100644 --- a/lib/routes/gov/csrc/news.js +++ b/lib/routes/gov/csrc/news.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://www.csrc.gov.cn'; const { suffix = 'c100028/common_xq_list.shtml' } = ctx.req.param(); const link = `${baseUrl}/csrc/${suffix}`; diff --git a/lib/routes/gov/customs/list.js b/lib/routes/gov/customs/list.js index 26fa2884c3caf2..5eddb577876456 100644 --- a/lib/routes/gov/customs/list.js +++ b/lib/routes/gov/customs/list.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const { gchannel = 'paimai' } = ctx.req.param(); let channelName = ''; let link = ''; diff --git a/lib/routes/gov/dianbai/dianbai.js b/lib/routes/gov/dianbai/dianbai.js index 92b0a4769b952c..cdfad97231eb5a 100644 --- a/lib/routes/gov/dianbai/dianbai.js +++ b/lib/routes/gov/dianbai/dianbai.js @@ -1,6 +1,6 @@ const { gdgov } = require('../general/general'); -module.exports = async (ctx) => { +export default async (ctx) => { const info = { defaultPath: 'zwgk/zcjd/', list_element: '.news_list li a', diff --git a/lib/routes/gov/forestry/gjlckjdjt.js b/lib/routes/gov/forestry/gjlckjdjt.js index 1e3056352614d5..51da0f6d2c9f6a 100644 --- a/lib/routes/gov/forestry/gjlckjdjt.js +++ b/lib/routes/gov/forestry/gjlckjdjt.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'gjlckjdjt' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/gaozhou/gaozhou.js b/lib/routes/gov/gaozhou/gaozhou.js index a5d6349f931f66..b30d21a42c9b5d 100644 --- a/lib/routes/gov/gaozhou/gaozhou.js +++ b/lib/routes/gov/gaozhou/gaozhou.js @@ -1,6 +1,6 @@ const { gdgov } = require('../general/general'); -module.exports = async (ctx) => { +export default async (ctx) => { const info = { defaultPath: 'zcjd/', list_element: '.newslist li a', diff --git a/lib/routes/gov/general/general.js b/lib/routes/gov/general/general.js index 9513438b000684..945566e5d70a2f 100644 --- a/lib/routes/gov/general/general.js +++ b/lib/routes/gov/general/general.js @@ -14,7 +14,7 @@ import cache from '@/utils/cache'; // 使用方法 // const { gdgov } = require('../general/general'); // -// module.exports = async (ctx) => { +// export default async (ctx) => { // const info = { // pathstartat: 1, // 网站放到子目录时使用,默认为0。如 www.yunfu.gov.cn/yfsrmzf/jcxxgk/zcfg/zcjd 为一层子目录则使用 1。 // defaultPath: 'zwgk/zcjd/', // 默认路径。假设网址是 a.b.gov.cn/c/d/ 则输入 c/d/。访问 gov/b/a/ 时使用默认路径,访问 gov/b/a/c/d/ 则为指定路径。 diff --git a/lib/routes/gov/guangdong/tqyb/sncsyjxh.js b/lib/routes/gov/guangdong/tqyb/sncsyjxh.js index 84028d063b3777..e9a3c842e57c62 100644 --- a/lib/routes/gov/guangdong/tqyb/sncsyjxh.js +++ b/lib/routes/gov/guangdong/tqyb/sncsyjxh.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const rootUrl = 'http://www.tqyb.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const sncsyjxhJsUrl = `${rootUrl}/data/gzWeather/otherCityAlarm.js`; const response = await got.get(sncsyjxhJsUrl); diff --git a/lib/routes/gov/guangdong/tqyb/tfxtq.js b/lib/routes/gov/guangdong/tqyb/tfxtq.js index b8978af2ca1b2f..3cd4c900525e0c 100644 --- a/lib/routes/gov/guangdong/tqyb/tfxtq.js +++ b/lib/routes/gov/guangdong/tqyb/tfxtq.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'http://www.tqyb.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const tfxtqJsUrl = `${rootUrl}/data/gzWeather/weatherTips.js`; const response = await got.get(tfxtqJsUrl); diff --git a/lib/routes/gov/gz/index.js b/lib/routes/gov/gz/index.js index 055d807b8c6890..ce1a99fe3b1ddb 100644 --- a/lib/routes/gov/gz/index.js +++ b/lib/routes/gov/gz/index.js @@ -11,7 +11,7 @@ const urlMap = { zcjd: 'zcjd/zcjd', }; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const category = ctx.req.param('category'); const url = `${rootUrl}/${channel}/${urlMap[category]}/`; diff --git a/lib/routes/gov/hebei/czt.js b/lib/routes/gov/hebei/czt.js index 6711c5f852992d..1d5218339212ab 100644 --- a/lib/routes/gov/hebei/czt.js +++ b/lib/routes/gov/hebei/czt.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'gzdt'; const rootUrl = 'http://czt.hebei.gov.cn'; diff --git a/lib/routes/gov/huazhou/huazhou.js b/lib/routes/gov/huazhou/huazhou.js index 80f18519e56128..84c95aa92967d8 100644 --- a/lib/routes/gov/huazhou/huazhou.js +++ b/lib/routes/gov/huazhou/huazhou.js @@ -1,6 +1,6 @@ const { gdgov } = require('../general/general'); -module.exports = async (ctx) => { +export default async (ctx) => { const info = { defaultPath: 'syzl/zcjd/', list_element: '.list-content li a', diff --git a/lib/routes/gov/huizhou/zwgk/index.js b/lib/routes/gov/huizhou/zwgk/index.js index af1477f5e58601..dcad5bfc81759a 100644 --- a/lib/routes/gov/huizhou/zwgk/index.js +++ b/lib/routes/gov/huizhou/zwgk/index.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const rootURL = 'http://www.huizhou.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const cate = ctx.req.param('category') ?? 'zwyw'; const url = `${rootURL}/zwgk/hzsz/${cate}`; diff --git a/lib/routes/gov/hunan/changsha/major-email.js b/lib/routes/gov/hunan/changsha/major-email.js index 6dab58fe1ed04f..f6560f12491884 100644 --- a/lib/routes/gov/hunan/changsha/major-email.js +++ b/lib/routes/gov/hunan/changsha/major-email.js @@ -5,7 +5,7 @@ const iconv = require('iconv-lite'); import { parseDate } from '@/utils/parse-date'; const baseUrl = 'http://wlwz.changsha.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const listPage = await got('http://wlwz.changsha.gov.cn/webapp/cs2020/email/index.jsp', { responseType: 'buffer', }); diff --git a/lib/routes/gov/immiau/news.js b/lib/routes/gov/immiau/news.js index 4a51e050c9f361..c3218083818c19 100644 --- a/lib/routes/gov/immiau/news.js +++ b/lib/routes/gov/immiau/news.js @@ -18,7 +18,7 @@ const reqBodyByYear = (year) => ({ const getItemUrl = (id) => `https://immi.homeaffairs.gov.au/news-media/archive/article?itemId=${id}`; -module.exports = async (ctx) => { +export default async (ctx) => { const res = await got({ method: 'post', url, diff --git a/lib/routes/gov/jgjcndrc/index.js b/lib/routes/gov/jgjcndrc/index.js index 550650eb30beef..35513490538fff 100644 --- a/lib/routes/gov/jgjcndrc/index.js +++ b/lib/routes/gov/jgjcndrc/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = 'sytzgg' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/jinan/healthcommission/medical-exam-notice.js b/lib/routes/gov/jinan/healthcommission/medical-exam-notice.js index 83f6c7210f46a2..23d1e4ca6100c2 100644 --- a/lib/routes/gov/jinan/healthcommission/medical-exam-notice.js +++ b/lib/routes/gov/jinan/healthcommission/medical-exam-notice.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://jnmhc.jinan.gov.cn'; const res = await got('https://jnmhc.jinan.gov.cn/module/web/jpage/dataproxy.jsp', { diff --git a/lib/routes/gov/maoming/maoming.js b/lib/routes/gov/maoming/maoming.js index d494e34dd3609c..4f5c3d7552563d 100644 --- a/lib/routes/gov/maoming/maoming.js +++ b/lib/routes/gov/maoming/maoming.js @@ -1,7 +1,7 @@ import { getSubPath } from '@/utils/common-utils'; const { gdgov } = require('../general/general'); -module.exports = async (ctx) => { +export default async (ctx) => { const path = getSubPath(ctx) .split('/') .filter((item) => item !== ''); diff --git a/lib/routes/gov/maonan/maonan.js b/lib/routes/gov/maonan/maonan.js index 4e4402d50f0016..9ca30007f23637 100644 --- a/lib/routes/gov/maonan/maonan.js +++ b/lib/routes/gov/maonan/maonan.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const host = 'http://www.maonan.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { let id = ''; let name = ''; diff --git a/lib/routes/gov/mee/ywdt.js b/lib/routes/gov/mee/ywdt.js index fc38749d5d1d09..43345c1cf6ca91 100644 --- a/lib/routes/gov/mee/ywdt.js +++ b/lib/routes/gov/mee/ywdt.js @@ -14,7 +14,7 @@ const columns = { gsgg: { name: '公示公告', order: 6 }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const cate = ctx.req.param('category') ?? 'szyw'; const url = `${baseUrl}ywdt/`; const title = `${columns[cate].name} - 要闻动态 - 中华人民共和国生态环境部`; diff --git a/lib/routes/gov/mem/sgcc.js b/lib/routes/gov/mem/sgcc.js index 13fc650241c607..df51ceba528109 100644 --- a/lib/routes/gov/mem/sgcc.js +++ b/lib/routes/gov/mem/sgcc.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'sggpdbqk' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/mfa/wjdt.js b/lib/routes/gov/mfa/wjdt.js index ab9a2e3c7c0cbf..810ab8e7655db7 100644 --- a/lib/routes/gov/mfa/wjdt.js +++ b/lib/routes/gov/mfa/wjdt.js @@ -16,7 +16,7 @@ const categories = { zcjd: 'zcjd', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'gjldrhd'; const rootUrl = 'https://www.mfa.gov.cn'; diff --git a/lib/routes/gov/mgs/mgs.js b/lib/routes/gov/mgs/mgs.js index 3b538938c639e1..9e34f349761339 100644 --- a/lib/routes/gov/mgs/mgs.js +++ b/lib/routes/gov/mgs/mgs.js @@ -1,6 +1,6 @@ const { gdgov } = require('../general/general'); -module.exports = async (ctx) => { +export default async (ctx) => { const info = { defaultPath: 'zwgk/zcjd/', list_element: '.list_con li a', diff --git a/lib/routes/gov/miit/wjfb.js b/lib/routes/gov/miit/wjfb.js index aaeabb7d1e2cf2..9573977551c1e9 100644 --- a/lib/routes/gov/miit/wjfb.js +++ b/lib/routes/gov/miit/wjfb.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.miit.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const ministry = ctx.req.param('ministry'); const url = `${rootUrl}/jgsj/${ministry}/wjfb/index.html`; diff --git a/lib/routes/gov/miit/wjgs.js b/lib/routes/gov/miit/wjgs.js index 68ff003fdc6a1a..b83385934a7b4b 100644 --- a/lib/routes/gov/miit/wjgs.js +++ b/lib/routes/gov/miit/wjgs.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'https://www.miit.gov.cn'; const siteUrl = `${baseUrl}/zwgk/wjgs/index.html`; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(siteUrl); const $ = load(response.data); const buildStatic = $('script[parseType=buildstatic]'); diff --git a/lib/routes/gov/miit/yjzj.js b/lib/routes/gov/miit/yjzj.js index 80b764d04340ce..25dda0427e8c72 100644 --- a/lib/routes/gov/miit/yjzj.js +++ b/lib/routes/gov/miit/yjzj.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.miit.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${rootUrl}/gzcy/yjzj/index.html`; const cookieResponse = await got(url); diff --git a/lib/routes/gov/miit/zcjd.js b/lib/routes/gov/miit/zcjd.js index 9afe84bc192a41..a6bf1e780963e5 100644 --- a/lib/routes/gov/miit/zcjd.js +++ b/lib/routes/gov/miit/zcjd.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'https://www.miit.gov.cn'; const siteUrl = `${baseUrl}/zwgk/zcjd/index.html`; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(siteUrl); const $ = load(response.data); const buildStatic = $('script[parseType=buildstatic]'); diff --git a/lib/routes/gov/miit/zcwj.js b/lib/routes/gov/miit/zcwj.js index af1a2cc7093115..ff6060045436a1 100644 --- a/lib/routes/gov/miit/zcwj.js +++ b/lib/routes/gov/miit/zcwj.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const base_url = 'http://www.miit.gov.cn/n1146295/n1652858/'; const response = await got.get(base_url); const $ = load(response.data); diff --git a/lib/routes/gov/mmht/mmht.js b/lib/routes/gov/mmht/mmht.js index 9b2adee5285b5a..7787f2954e141a 100644 --- a/lib/routes/gov/mmht/mmht.js +++ b/lib/routes/gov/mmht/mmht.js @@ -1,6 +1,6 @@ const { gdgov } = require('../general/general'); -module.exports = async (ctx) => { +export default async (ctx) => { const info = { defaultPath: 'xwzx/zcjd/', list_element: '#main21l_main_dk > table > tbody > tr > td:nth-child(2) a', diff --git a/lib/routes/gov/moa/moa.js b/lib/routes/gov/moa/moa.js index f0a32dc859e24f..9e41408d982fd5 100644 --- a/lib/routes/gov/moa/moa.js +++ b/lib/routes/gov/moa/moa.js @@ -6,7 +6,7 @@ import { parseRelativeDate } from '@/utils/parse-date'; const hostUrl = 'http://www.moa.gov.cn/'; const hostUrlObj = new URL(hostUrl); // 用于在下面判断host -module.exports = async (ctx) => { +export default async (ctx) => { const rawSuburl = ctx.req.param('suburl'); const suburl = rawSuburl.slice(-1) === '/' ? rawSuburl : rawSuburl + '/'; diff --git a/lib/routes/gov/moa/zdscxx.js b/lib/routes/gov/moa/zdscxx.js index 85af02b49fc163..b9ddaf05ccc3d0 100644 --- a/lib/routes/gov/moa/zdscxx.js +++ b/lib/routes/gov/moa/zdscxx.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 5; diff --git a/lib/routes/gov/moe/moe.js b/lib/routes/gov/moe/moe.js index 0dc3aa1f5c1f1a..1f95a169497324 100644 --- a/lib/routes/gov/moe/moe.js +++ b/lib/routes/gov/moe/moe.js @@ -13,7 +13,7 @@ const typesIdMap = [ { type: 'edu_focus_news', id: 'eight_con2 .pchide>.TRS_Editor', name: '教育要闻' }, ]; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let id = ''; let name = ''; diff --git a/lib/routes/gov/moe/s78.js b/lib/routes/gov/moe/s78.js index e026d2d16f9415..28c76cadff58b1 100644 --- a/lib/routes/gov/moe/s78.js +++ b/lib/routes/gov/moe/s78.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.moe.gov.cn'; const column = ctx.req.param('column'); const link = `${baseUrl}/s78/${column}/tongzhi/`; diff --git a/lib/routes/gov/mof/bond.js b/lib/routes/gov/mof/bond.js index 7a7697c423fa1e..da85c494f94e58 100644 --- a/lib/routes/gov/mof/bond.js +++ b/lib/routes/gov/mof/bond.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; const domain = 'gks.mof.gov.cn'; const theme = 'guozaiguanli'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'gzfxgzdt' } = ctx.req.param(); const currentUrl = `https://${domain}/ztztz/${theme}/${category}/`; const { data: response } = await got(currentUrl); diff --git a/lib/routes/gov/mofcom/article.js b/lib/routes/gov/mofcom/article.js index da3057fb3591c6..12fca9ab878b1a 100644 --- a/lib/routes/gov/mofcom/article.js +++ b/lib/routes/gov/mofcom/article.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const host = 'http://www.mofcom.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const suffix = ctx.req.param('suffix'); const url = `http://www.mofcom.gov.cn/article/${suffix}/`; const { data: res } = await got(url); diff --git a/lib/routes/gov/moj/aac/news.js b/lib/routes/gov/moj/aac/news.js index 2ac4201896bcfb..dd3912e8ecf283 100644 --- a/lib/routes/gov/moj/aac/news.js +++ b/lib/routes/gov/moj/aac/news.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const baseUrl = 'https://www.aac.moj.gov.tw'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const url = `${baseUrl}/7204/7246/?Page=1&PageSize=40${type ? `&type=${type}` : ''}`; const response = await got(url); diff --git a/lib/routes/gov/moj/lfyjzj.js b/lib/routes/gov/moj/lfyjzj.js index f902531815c4fd..d48c93701aff8e 100644 --- a/lib/routes/gov/moj/lfyjzj.js +++ b/lib/routes/gov/moj/lfyjzj.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const DOMAIN = 'www.moj.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = `https://${DOMAIN}`; const currentUrl = `${rootUrl}/lfyjzj/lflfyjzj/index.html`; const { data: response } = await got(currentUrl); diff --git a/lib/routes/gov/mot/index.js b/lib/routes/gov/mot/index.js index d570ee12528f45..b16d653d75072d 100644 --- a/lib/routes/gov/mot/index.js +++ b/lib/routes/gov/mot/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'tongjishuju/gonglu' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/ndrc/fggz.js b/lib/routes/gov/ndrc/fggz.js index d8a464487f1489..9daacd69966bef 100644 --- a/lib/routes/gov/ndrc/fggz.js +++ b/lib/routes/gov/ndrc/fggz.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 25; diff --git a/lib/routes/gov/ndrc/xwdt.js b/lib/routes/gov/ndrc/xwdt.js index 71810f4f9ff786..9347975ffb39a0 100644 --- a/lib/routes/gov/ndrc/xwdt.js +++ b/lib/routes/gov/ndrc/xwdt.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || 'xwfb'; const rootUrl = 'https://www.ndrc.gov.cn'; diff --git a/lib/routes/gov/nea/ghs.js b/lib/routes/gov/nea/ghs.js index 025e8f42ff28d6..2aa988fa1359e9 100644 --- a/lib/routes/gov/nea/ghs.js +++ b/lib/routes/gov/nea/ghs.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 35; const rootUrl = 'https://www.nea.gov.cn'; diff --git a/lib/routes/gov/news/index.js b/lib/routes/gov/news/index.js index 67ce94625c6560..5c12983fb64ef7 100644 --- a/lib/routes/gov/news/index.js +++ b/lib/routes/gov/news/index.js @@ -5,7 +5,7 @@ import logger from '@/utils/logger'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const originDomain = 'https://www.gov.cn'; let url = ''; diff --git a/lib/routes/gov/nifdc/index.js b/lib/routes/gov/nifdc/index.js index c913a51f751eb7..38a1e283bb58c0 100644 --- a/lib/routes/gov/nifdc/index.js +++ b/lib/routes/gov/nifdc/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { path = 'bshff/ylqxbzhgl/qxggtzh' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/nmpa/generic.js b/lib/routes/gov/nmpa/generic.js index 7bbaddf2dcb112..010d54d72bf672 100644 --- a/lib/routes/gov/nmpa/generic.js +++ b/lib/routes/gov/nmpa/generic.js @@ -7,7 +7,7 @@ import { config } from '@/config'; const baseUrl = 'https://www.nmpa.gov.cn'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = ctx.params[0]; const url = `${baseUrl}/${path.endsWith('/') ? path.slice(0, -1) : path}/index.html`; const data = await cache.tryGet( diff --git a/lib/routes/gov/nopss/index.js b/lib/routes/gov/nopss/index.js index a56d401c47dc7d..4a6a0775ac6cb5 100644 --- a/lib/routes/gov/nopss/index.js +++ b/lib/routes/gov/nopss/index.js @@ -6,7 +6,7 @@ const iconv = require('iconv-lite'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = getSubPath(ctx) === '/nopss' ? '/GB/219469' : getSubPath(ctx).replace(/^\/nopss/, ''); const rootUrl = 'http://www.nopss.gov.cn'; diff --git a/lib/routes/gov/npc/index.js b/lib/routes/gov/npc/index.js index 48c1bb87ffd067..e4bfc0ec86300b 100644 --- a/lib/routes/gov/npc/index.js +++ b/lib/routes/gov/npc/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const caty = ctx.req.param('caty'); // 主页 const baseurl = `http://www.npc.gov.cn/npc/c2/${caty}/`; diff --git a/lib/routes/gov/nrta/dsj.js b/lib/routes/gov/nrta/dsj.js index 975c5ce9252fab..52893bb78e11da 100644 --- a/lib/routes/gov/nrta/dsj.js +++ b/lib/routes/gov/nrta/dsj.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const asyncPool = require('tiny-async-pool'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'note' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 15; diff --git a/lib/routes/gov/nrta/news.js b/lib/routes/gov/nrta/news.js index a62606183fb252..75a1f1e93842bd 100644 --- a/lib/routes/gov/nrta/news.js +++ b/lib/routes/gov/nrta/news.js @@ -10,7 +10,7 @@ const categories = { 114: '工作动态', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 112; const rootUrl = 'http://www.nrta.gov.cn'; diff --git a/lib/routes/gov/nsfc/index.js b/lib/routes/gov/nsfc/index.js index 5491ea066b5d9b..c2b6c7d2b208eb 100644 --- a/lib/routes/gov/nsfc/index.js +++ b/lib/routes/gov/nsfc/index.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const shortcuts = require('./shortcuts'); -module.exports = async (ctx) => { +export default async (ctx) => { let thePath = getSubPath(ctx).replace(/^\/nsfc/, ''); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/pbc/goutongjiaoliu.js b/lib/routes/gov/pbc/goutongjiaoliu.js index 3d1648409b0496..8be2c5c3fab1c5 100644 --- a/lib/routes/gov/pbc/goutongjiaoliu.js +++ b/lib/routes/gov/pbc/goutongjiaoliu.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://www.pbc.gov.cn/goutongjiaoliu/113456/113469/index.html'; const browser = await puppeteer({ stealth: true }); diff --git a/lib/routes/gov/pbc/gzlw.js b/lib/routes/gov/pbc/gzlw.js index 6a5cc29c533832..a0ca5bca635b91 100644 --- a/lib/routes/gov/pbc/gzlw.js +++ b/lib/routes/gov/pbc/gzlw.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const host = 'http://www.pbc.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${host}/redianzhuanti/118742/4122386/4122692/index.html`; const response = await got.post(url); diff --git a/lib/routes/gov/pbc/trade-announcement.js b/lib/routes/gov/pbc/trade-announcement.js index 532dd0aa5e93ba..131c032b23ceff 100644 --- a/lib/routes/gov/pbc/trade-announcement.js +++ b/lib/routes/gov/pbc/trade-announcement.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://www.pbc.gov.cn/zhengcehuobisi/125207/125213/125431/125475/index.html'; const browser = await puppeteer(); diff --git a/lib/routes/gov/pbc/zcyj.js b/lib/routes/gov/pbc/zcyj.js index 7622fe528ab60d..7aaaf931cd2eaa 100644 --- a/lib/routes/gov/pbc/zcyj.js +++ b/lib/routes/gov/pbc/zcyj.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const host = 'http://www.pbc.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${host}/redianzhuanti/118742/4122386/4122510/index.html`; const response = await got.post(url); diff --git a/lib/routes/gov/router.js b/lib/routes/gov/router.js index a945de715af15d..4b37c2a1039f0e 100644 --- a/lib/routes/gov/router.js +++ b/lib/routes/gov/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { // ministry router.get('/cac/*', './cac/index'); router.get('/caac/cjwt/:category?', './caac/cjwt'); diff --git a/lib/routes/gov/safe/business.js b/lib/routes/gov/safe/business.js index 9b527d51cb5dca..9ebce9673b7da7 100644 --- a/lib/routes/gov/safe/business.js +++ b/lib/routes/gov/safe/business.js @@ -1,6 +1,6 @@ const { processZxfkItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { site = 'beijing' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 3; diff --git a/lib/routes/gov/safe/complaint.js b/lib/routes/gov/safe/complaint.js index d466683414325b..091ebded82a4ec 100644 --- a/lib/routes/gov/safe/complaint.js +++ b/lib/routes/gov/safe/complaint.js @@ -1,6 +1,6 @@ const { processZxfkItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { site = 'beijing' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 5; diff --git a/lib/routes/gov/samr/xgzlyhd.js b/lib/routes/gov/samr/xgzlyhd.js index 319e46c47eda73..ff2ed31c255fbb 100644 --- a/lib/routes/gov/samr/xgzlyhd.js +++ b/lib/routes/gov/samr/xgzlyhd.js @@ -34,7 +34,7 @@ const getOption = async (type, name) => { return; }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category, department } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/gov/sasac/generic.js b/lib/routes/gov/sasac/generic.js index 26770f2b92e9c4..460d8a630d1cd2 100644 --- a/lib/routes/gov/sasac/generic.js +++ b/lib/routes/gov/sasac/generic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = ctx.req.param('path'); const baseUrl = 'http://www.sasac.gov.cn'; const url = `${baseUrl}/${path}/index.html`; diff --git a/lib/routes/gov/sdb/sdb.js b/lib/routes/gov/sdb/sdb.js index 6c3a962153f6ae..9cbf65051a8045 100644 --- a/lib/routes/gov/sdb/sdb.js +++ b/lib/routes/gov/sdb/sdb.js @@ -1,6 +1,6 @@ const { gdgov } = require('../general/general'); -module.exports = async (ctx) => { +export default async (ctx) => { const info = { defaultPath: 'zwgk/zcjd/', list_element: '.art-list li a', diff --git a/lib/routes/gov/shaanxi/kjt.js b/lib/routes/gov/shaanxi/kjt.js index fb8339d1fa4244..f8e0aa9d7e42c7 100644 --- a/lib/routes/gov/shaanxi/kjt.js +++ b/lib/routes/gov/shaanxi/kjt.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '221'; const rootUrl = 'https://kjt.shaanxi.gov.cn'; diff --git a/lib/routes/gov/shanghai/rsj/ksxm.js b/lib/routes/gov/shanghai/rsj/ksxm.js index 336c56fb5733e4..166c513f915f65 100644 --- a/lib/routes/gov/shanghai/rsj/ksxm.js +++ b/lib/routes/gov/shanghai/rsj/ksxm.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; const rootUrl = 'http://www.rsj.sh.gov.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${rootUrl}/ksyzc/wangz/kwaplist_300.jsp`; const response = await got({ diff --git a/lib/routes/gov/shanghai/wgj/wgj.js b/lib/routes/gov/shanghai/wgj/wgj.js index 7fd6fd8e6bcd96..8836f83c7e8898 100644 --- a/lib/routes/gov/shanghai/wgj/wgj.js +++ b/lib/routes/gov/shanghai/wgj/wgj.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://wsbs.wgj.sh.gov.cn'; const currentUrl = `${baseUrl}/shwgj_ywtb/core/web/welcome/index!toResultNotice.action`; const page = ctx.req.param('page') ?? 1; diff --git a/lib/routes/gov/shanghai/wsjkw/yqtb/index.js b/lib/routes/gov/shanghai/wsjkw/yqtb/index.js index 0027fc8cf3e1a1..9ec3a6d12a3db0 100644 --- a/lib/routes/gov/shanghai/wsjkw/yqtb/index.js +++ b/lib/routes/gov/shanghai/wsjkw/yqtb/index.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://wsjkw.sh.gov.cn/yqtb/index.html`; const res = await got.get(url); diff --git a/lib/routes/gov/shanghai/yjj/index.js b/lib/routes/gov/shanghai/yjj/index.js index 60ac0a61c0ceeb..dc36e188ba561e 100644 --- a/lib/routes/gov/shanghai/yjj/index.js +++ b/lib/routes/gov/shanghai/yjj/index.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = getSubPath(ctx) === '/shanghai/yjj' ? '/shanghai/yjj/zx-ylqx' : getSubPath(ctx); const rootUrl = 'https://yjj.sh.gov.cn'; diff --git a/lib/routes/gov/shenzhen/hrss/szksy/index.js b/lib/routes/gov/shenzhen/hrss/szksy/index.js index f07f5c7a7410ee..9c34b827966318 100644 --- a/lib/routes/gov/shenzhen/hrss/szksy/index.js +++ b/lib/routes/gov/shenzhen/hrss/szksy/index.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; const rootURL = 'http://hrss.sz.gov.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const categoryID = ctx.req.param('caty'); const page = ctx.req.param('page') ?? '1'; diff --git a/lib/routes/gov/shenzhen/xxgk/zfxxgj.js b/lib/routes/gov/shenzhen/xxgk/zfxxgj.js index 2f8ae9637abbde..52a54b992100cd 100644 --- a/lib/routes/gov/shenzhen/xxgk/zfxxgj.js +++ b/lib/routes/gov/shenzhen/xxgk/zfxxgj.js @@ -24,7 +24,7 @@ const config = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const cfg = config[ctx.req.param('caty')]; if (!cfg) { throw new Error('Bad category. See docs'); diff --git a/lib/routes/gov/shenzhen/zjj/index.js b/lib/routes/gov/shenzhen/zjj/index.js index 34201b2512a847..dd70b6e98c9526 100644 --- a/lib/routes/gov/shenzhen/zjj/index.js +++ b/lib/routes/gov/shenzhen/zjj/index.js @@ -10,7 +10,7 @@ const config = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://zjj.sz.gov.cn/xxgk/'; const cfg = config[ctx.req.param('caty')]; if (!cfg) { diff --git a/lib/routes/gov/shenzhen/zzb/index.js b/lib/routes/gov/shenzhen/zzb/index.js index 16f123dc8380c6..79ae7e7cb93c9b 100644 --- a/lib/routes/gov/shenzhen/zzb/index.js +++ b/lib/routes/gov/shenzhen/zzb/index.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; const rootURL = 'http://www.zzb.sz.gov.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const categoryID = ctx.req.param('caty'); const page = ctx.req.param('page') ?? '1'; diff --git a/lib/routes/gov/sichuan/deyang/govpublicinfo.js b/lib/routes/gov/sichuan/deyang/govpublicinfo.js index 65b58b7165021b..25ef2827d7a5c5 100644 --- a/lib/routes/gov/sichuan/deyang/govpublicinfo.js +++ b/lib/routes/gov/sichuan/deyang/govpublicinfo.js @@ -72,7 +72,7 @@ const getInfoContent = (rootUrl, item) => } }); -module.exports = async (ctx) => { +export default async (ctx) => { const countyName = ctx.req.param('countyName'); const infoType = ctx.req.param('infoType') || 'fdzdnr'; const infoBasicUrl = basicInfoDict[countyName].infoType[infoType].basicUrl; diff --git a/lib/routes/gov/sichuan/deyang/mztoday.js b/lib/routes/gov/sichuan/deyang/mztoday.js index 43b0219bc937a5..90107cb2811099 100644 --- a/lib/routes/gov/sichuan/deyang/mztoday.js +++ b/lib/routes/gov/sichuan/deyang/mztoday.js @@ -116,7 +116,7 @@ const getInfoContent = (item) => }; }); -module.exports = async (ctx) => { +export default async (ctx) => { const infoType = ctx.req.param('infoType') || 'zx'; const infoBasicUrl = `${rootUrl}${basicInfoDict[infoType].url}`; const infoUrlList = await getInfoUrlList(infoBasicUrl); diff --git a/lib/routes/gov/stats/index.js b/lib/routes/gov/stats/index.js index 55184c17329982..d4d16fc88a39e2 100644 --- a/lib/routes/gov/stats/index.js +++ b/lib/routes/gov/stats/index.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 15; const defaultPath = '/sj/zxfb/'; diff --git a/lib/routes/gov/suzhou/doc.js b/lib/routes/gov/suzhou/doc.js index bb2c3876897e76..429b008d061ed7 100644 --- a/lib/routes/gov/suzhou/doc.js +++ b/lib/routes/gov/suzhou/doc.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.suzhou.gov.cn/szxxgk/front/xxgk_right.jsp'; const { data: response } = await got(link); diff --git a/lib/routes/gov/suzhou/fg.js b/lib/routes/gov/suzhou/fg.js index 0b950611654bb6..a752c2fd0d2cc0 100644 --- a/lib/routes/gov/suzhou/fg.js +++ b/lib/routes/gov/suzhou/fg.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'szfgw/ggl/nav_list' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/gov/suzhou/news.js b/lib/routes/gov/suzhou/news.js index e392359ae50754..3dd492c3dd8cc7 100644 --- a/lib/routes/gov/suzhou/news.js +++ b/lib/routes/gov/suzhou/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.suzhou.gov.cn'; const uid = ctx.req.param('uid'); let url = ''; diff --git a/lib/routes/gov/taiyuan/rsj.js b/lib/routes/gov/taiyuan/rsj.js index a04f7243f9eb3e..6167b1ff1d096b 100644 --- a/lib/routes/gov/taiyuan/rsj.js +++ b/lib/routes/gov/taiyuan/rsj.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; const rootURL = 'http://rsj.taiyuan.gov.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const categoryID = ctx.req.param('caty'); const page = ctx.req.param('page') ?? '1'; diff --git a/lib/routes/gov/wuhan/whyw.js b/lib/routes/gov/wuhan/whyw.js index e3d544c624862a..9f1eaa82d9e6e3 100644 --- a/lib/routes/gov/wuhan/whyw.js +++ b/lib/routes/gov/wuhan/whyw.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://www.wuhan.gov.cn'; const currentUrl = `${rootUrl}/sy/whyw/`; const response = await got(currentUrl); diff --git a/lib/routes/gov/xinyi/xinyi.js b/lib/routes/gov/xinyi/xinyi.js index bbece179b16d7c..0a230aab436087 100644 --- a/lib/routes/gov/xinyi/xinyi.js +++ b/lib/routes/gov/xinyi/xinyi.js @@ -1,6 +1,6 @@ const { gdgov } = require('../general/general'); -module.exports = async (ctx) => { +export default async (ctx) => { const info = { defaultPath: 'zwgk/zcjd/', list_element: '.newsList li a', diff --git a/lib/routes/gov/xuzhou/hrss.js b/lib/routes/gov/xuzhou/hrss.js index dbac67b4ad010e..d68d23eee36f4d 100644 --- a/lib/routes/gov/xuzhou/hrss.js +++ b/lib/routes/gov/xuzhou/hrss.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'http://hrss.xz.gov.cn'; diff --git a/lib/routes/gov/zhejiang/gwy.js b/lib/routes/gov/zhejiang/gwy.js index 2a309fd499501b..b2367dec4578b7 100644 --- a/lib/routes/gov/zhejiang/gwy.js +++ b/lib/routes/gov/zhejiang/gwy.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category, column } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/gov/zhengce/govall.js b/lib/routes/gov/zhengce/govall.js index 2c0a81dbf8d77f..0ed51e36bcb61a 100644 --- a/lib/routes/gov/zhengce/govall.js +++ b/lib/routes/gov/zhengce/govall.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const advance = ctx.req.param('advance'); const link = `http://sousuo.gov.cn/list.htm`; const params = new URLSearchParams({ diff --git a/lib/routes/gov/zhengce/index.js b/lib/routes/gov/zhengce/index.js index b8e0e1a6822354..eb10991237fe53 100644 --- a/lib/routes/gov/zhengce/index.js +++ b/lib/routes/gov/zhengce/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'zuixin' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20; diff --git a/lib/routes/gov/zhengce/wenjian.js b/lib/routes/gov/zhengce/wenjian.js index 463da224e55b44..f4eecb52980c93 100644 --- a/lib/routes/gov/zhengce/wenjian.js +++ b/lib/routes/gov/zhengce/wenjian.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const pcodeJiguan = ctx.req.param('pcodeJiguan'); const link = 'http://sousuo.gov.cn/list.htm'; const res = await got(link, { diff --git a/lib/routes/gov/zhengce/zhengceku.js b/lib/routes/gov/zhengce/zhengceku.js index f67eb791b3c5be..074437185847b4 100644 --- a/lib/routes/gov/zhengce/zhengceku.js +++ b/lib/routes/gov/zhengce/zhengceku.js @@ -1,6 +1,6 @@ import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { const department = ctx.req.param('department'); const link = `http://www.gov.cn/zhengce/zhengceku/${department}/`; diff --git a/lib/routes/greasyfork/feedback.js b/lib/routes/greasyfork/feedback.js index 0bf7dc6f00c7ab..f625e936ba3013 100644 --- a/lib/routes/greasyfork/feedback.js +++ b/lib/routes/greasyfork/feedback.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const script = ctx.req.param('script'); const rootUrl = 'https://greasyfork.org'; const currentUrl = `${rootUrl}/scripts/${script}/feedback`; diff --git a/lib/routes/greasyfork/router.js b/lib/routes/greasyfork/router.js index ec2a001b212d7d..1a668754c4055c 100644 --- a/lib/routes/greasyfork/router.js +++ b/lib/routes/greasyfork/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:language/:domain?', './scripts'); router.get('/scripts/:script/feedback', './feedback'); router.get('/scripts/:script/versions', './versions'); diff --git a/lib/routes/greasyfork/scripts.js b/lib/routes/greasyfork/scripts.js index 0b3eec7722a41e..8812d0595438a4 100644 --- a/lib/routes/greasyfork/scripts.js +++ b/lib/routes/greasyfork/scripts.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') === 'all' ? 'zh-CN' : ctx.req.param('language') || 'zh-CN'; const domain = ctx.req.param('domain'); const filter_locale = ctx.req.param('language') === 'all' ? 0 : 1; diff --git a/lib/routes/greasyfork/versions.js b/lib/routes/greasyfork/versions.js index 5de40421f12fc4..52eb6df63e0302 100644 --- a/lib/routes/greasyfork/versions.js +++ b/lib/routes/greasyfork/versions.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const script = ctx.req.param('script'); const currentUrl = `https://greasyfork.org/scripts/${script}/versions`; const response = await got(currentUrl); diff --git a/lib/routes/grist/featured.js b/lib/routes/grist/featured.js index 728162f171185f..6ad5de05aafef1 100644 --- a/lib/routes/grist/featured.js +++ b/lib/routes/grist/featured.js @@ -3,7 +3,7 @@ const { getData, getList } = require('./utils'); import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://grist.org/'; const { data: response } = await got(baseUrl); const $ = load(response); diff --git a/lib/routes/grist/index.js b/lib/routes/grist/index.js index cb8d43cfff3b1c..89c6baa3e4b69d 100644 --- a/lib/routes/grist/index.js +++ b/lib/routes/grist/index.js @@ -1,6 +1,6 @@ const { getData, getList } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://grist.org'; const route = '/wp-json/wp/v2/posts?_embed'; diff --git a/lib/routes/grist/router.js b/lib/routes/grist/router.js index 9f1f20a03293b1..8335aca80fd9c2 100644 --- a/lib/routes/grist/router.js +++ b/lib/routes/grist/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/featured', './featured'); router.get('/series/:series', './series'); diff --git a/lib/routes/grist/series.js b/lib/routes/grist/series.js index a6c1598dfae32f..c3d7ab3053b58c 100644 --- a/lib/routes/grist/series.js +++ b/lib/routes/grist/series.js @@ -1,6 +1,6 @@ const { getData, getList } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://grist.org'; const searchRoute = '/wp-json/wp/v2/series?slug='; const articleRoute = '/wp-json/wp/v2/posts?series='; diff --git a/lib/routes/grist/topic.js b/lib/routes/grist/topic.js index 30200d82c3d71a..63af86b904db32 100644 --- a/lib/routes/grist/topic.js +++ b/lib/routes/grist/topic.js @@ -1,6 +1,6 @@ const { getData, getList } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://grist.org'; const searchRoute = '/wp-json/wp/v2/categories?slug='; const articleRoute = '/wp-json/wp/v2/posts?categories='; diff --git a/lib/routes/grubstreet/index.js b/lib/routes/grubstreet/index.js index d0ac8a0ec4d4a1..56999ef7d99beb 100644 --- a/lib/routes/grubstreet/index.js +++ b/lib/routes/grubstreet/index.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { 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`; diff --git a/lib/routes/grubstreet/router.js b/lib/routes/grubstreet/router.js index d7756988faf502..b84c130aa1d81f 100644 --- a/lib/routes/grubstreet/router.js +++ b/lib/routes/grubstreet/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/guancha/headline.js b/lib/routes/guancha/headline.js index 445fdccec39a83..4a71e98ca63235 100644 --- a/lib/routes/guancha/headline.js +++ b/lib/routes/guancha/headline.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.guancha.cn'; const currentUrl = `${rootUrl}/GuanChaZheTouTiao/list_1.shtml`; diff --git a/lib/routes/guancha/index.js b/lib/routes/guancha/index.js index 155fd407f4c9e6..6f282dee09b45e 100644 --- a/lib/routes/guancha/index.js +++ b/lib/routes/guancha/index.js @@ -34,7 +34,7 @@ const config = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const total = 10; const category = ctx.req.param('category') ?? 'all'; const rootUrl = 'https://www.guancha.cn'; diff --git a/lib/routes/guancha/member.js b/lib/routes/guancha/member.js index 73058ced0e45dc..c79a7189f45eef 100644 --- a/lib/routes/guancha/member.js +++ b/lib/routes/guancha/member.js @@ -9,7 +9,7 @@ const titles = { huodongs: '观学院', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'recommend'; const rootUrl = 'https://member.guancha.cn'; diff --git a/lib/routes/guancha/personalpage.js b/lib/routes/guancha/personalpage.js index e9fa34af699e05..7f20c4117b3a74 100644 --- a/lib/routes/guancha/personalpage.js +++ b/lib/routes/guancha/personalpage.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const host = 'https://user.guancha.cn'; const link = `https://app.guancha.cn/user/get-published-list?page_size=20&page_no=1&uid=${uid}`; diff --git a/lib/routes/guancha/router.js b/lib/routes/guancha/router.js index 54bed7e05e2055..d12aac9957c9a6 100644 --- a/lib/routes/guancha/router.js +++ b/lib/routes/guancha/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/headline', './headline'); router.get('/member/:category?', './member'); router.get('/personalpage/:uid', './personalpage'); diff --git a/lib/routes/guancha/topic.js b/lib/routes/guancha/topic.js index 86b7a9d85c0961..857547ef61674a 100644 --- a/lib/routes/guancha/topic.js +++ b/lib/routes/guancha/topic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '0'; const order = ctx.req.param('order') ?? '1'; diff --git a/lib/routes/guangdiu/cheaps.js b/lib/routes/guangdiu/cheaps.js index d5abc171c67e55..bcf1cf31bc5991 100644 --- a/lib/routes/guangdiu/cheaps.js +++ b/lib/routes/guangdiu/cheaps.js @@ -4,7 +4,7 @@ import { parseRelativeDate } from '@/utils/parse-date'; const host = 'https://guangdiu.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const query = ctx.req.param('query') ?? ''; const url = `${host}/cheaps.php${query ? `?${query}` : ''}`; diff --git a/lib/routes/guangdiu/index.js b/lib/routes/guangdiu/index.js index 1593fb0dfb3234..295a429d5babcc 100644 --- a/lib/routes/guangdiu/index.js +++ b/lib/routes/guangdiu/index.js @@ -5,7 +5,7 @@ import { parseRelativeDate } from '@/utils/parse-date'; const host = 'https://guangdiu.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const query = ctx.req.param('query') ?? ''; const url = query === 'c=us' ? `${host}/?c=us` : `${host}/${query ? `cate.php?${query}` : ''}`; diff --git a/lib/routes/guangdiu/rank.js b/lib/routes/guangdiu/rank.js index 98a110a022301a..55b3238abd75d1 100644 --- a/lib/routes/guangdiu/rank.js +++ b/lib/routes/guangdiu/rank.js @@ -5,7 +5,7 @@ import { parseRelativeDate } from '@/utils/parse-date'; const host = 'https://guangdiu.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${host}/rank.php`; const response = await got(url); diff --git a/lib/routes/guangdiu/router.js b/lib/routes/guangdiu/router.js index 4d79ef1c320e9c..70b0bfaed2bf61 100644 --- a/lib/routes/guangdiu/router.js +++ b/lib/routes/guangdiu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/rank', './rank'); router.get('/cheaps/:query?', './cheaps'); router.get('/search/:query?', './search'); diff --git a/lib/routes/guangdiu/search.js b/lib/routes/guangdiu/search.js index cd1fe1c2484aa4..3a8b6d1b01c7c9 100644 --- a/lib/routes/guangdiu/search.js +++ b/lib/routes/guangdiu/search.js @@ -5,7 +5,7 @@ import { parseRelativeDate } from '@/utils/parse-date'; const host = 'https://guangdiu.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const query = ctx.req.param('query') ?? ''; const url = `${host}/${query ? `search.php?${query}` : ''}`; const response = await got(url); diff --git a/lib/routes/guangzhoumetro/news.js b/lib/routes/guangzhoumetro/news.js index 17d24164d71227..637c0047f7c8f6 100644 --- a/lib/routes/guangzhoumetro/news.js +++ b/lib/routes/guangzhoumetro/news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const newsUrl = 'https://www.gzmtr.com/ygwm/xwzx/gsxw/'; const response = await got(newsUrl); const data = response.data; diff --git a/lib/routes/guangzhoumetro/router.js b/lib/routes/guangzhoumetro/router.js index bd25c22a2fd87b..3c9877e17cb637 100644 --- a/lib/routes/guangzhoumetro/router.js +++ b/lib/routes/guangzhoumetro/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/guanhai/index.js b/lib/routes/guanhai/index.js index d3913807685fd4..506ccc9aa69d1e 100644 --- a/lib/routes/guanhai/index.js +++ b/lib/routes/guanhai/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got('https://www.guanhai.com.cn'); const $ = load(response); diff --git a/lib/routes/guanhai/router.js b/lib/routes/guanhai/router.js index d7756988faf502..b84c130aa1d81f 100644 --- a/lib/routes/guanhai/router.js +++ b/lib/routes/guanhai/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/guduodata/daily.js b/lib/routes/guduodata/daily.js index 5d472bf0034e6a..731633f659108d 100644 --- a/lib/routes/guduodata/daily.js +++ b/lib/routes/guduodata/daily.js @@ -27,7 +27,7 @@ const types = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const now = dayjs().valueOf(); // yestoday const yestoday = dayjs().subtract(1, 'day').format('YYYY-MM-DD'); diff --git a/lib/routes/guduodata/router.js b/lib/routes/guduodata/router.js index c585e4fdba8283..16107c61f97e74 100644 --- a/lib/routes/guduodata/router.js +++ b/lib/routes/guduodata/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/daily', './daily'); }; diff --git a/lib/routes/gumroad/index.js b/lib/routes/gumroad/index.js index 18805135a94f4e..b95eb8df4c50df 100644 --- a/lib/routes/gumroad/index.js +++ b/lib/routes/gumroad/index.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const username = ctx.req.param('username'); const products = ctx.req.param('products'); if (!isValidHost(username)) { diff --git a/lib/routes/gumroad/router.js b/lib/routes/gumroad/router.js index 793a9ca372529e..f95a831de460e0 100644 --- a/lib/routes/gumroad/router.js +++ b/lib/routes/gumroad/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:username/:products', './index'); }; diff --git a/lib/routes/guokr/channel.js b/lib/routes/guokr/channel.js index 715ec4f85a787d..9d1ce849584d72 100644 --- a/lib/routes/guokr/channel.js +++ b/lib/routes/guokr/channel.js @@ -17,7 +17,7 @@ const channelMap = { pretty: 'beauty', }; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = channelMap[ctx.req.param('channel')] ?? ctx.req.param('channel'); const response = await got(`https://www.guokr.com/apis/minisite/article.json?retrieve_type=by_wx&channel_key=${channel}&offset=0&limit=10`); diff --git a/lib/routes/guokr/router.js b/lib/routes/guokr/router.js index eaecd668bc5d97..ff2c4cd3b2c134 100644 --- a/lib/routes/guokr/router.js +++ b/lib/routes/guokr/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/scientific', './scientific'); router.get('/:channel', './channel'); }; diff --git a/lib/routes/guokr/scientific.js b/lib/routes/guokr/scientific.js index 3cd068e457910a..c8784c505ab7a3 100644 --- a/lib/routes/guokr/scientific.js +++ b/lib/routes/guokr/scientific.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://www.guokr.com/apis/minisite/article.json?retrieve_type=by_subject&limit=20&offset=0'); const result = response.data.result; diff --git a/lib/routes/gxmzu/ai.js b/lib/routes/gxmzu/ai.js index 90bcf6f9793d1d..8f9885e9ff344b 100644 --- a/lib/routes/gxmzu/ai.js +++ b/lib/routes/gxmzu/ai.js @@ -3,7 +3,7 @@ const { getNoticeList } = require('./utils'); const url = 'https://ai.gxmzu.edu.cn/index/tzgg.htm'; const host = 'https://ai.gxmzu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const out = await getNoticeList(ctx, url, host, 'a', '.timestyle55267', { title: '.titlestyle55269', content: '#vsb_content', diff --git a/lib/routes/gxmzu/lib.js b/lib/routes/gxmzu/lib.js index fb77dea75103fa..5e299e876a5f59 100644 --- a/lib/routes/gxmzu/lib.js +++ b/lib/routes/gxmzu/lib.js @@ -13,7 +13,7 @@ const url = 'https://library.gxmzu.edu.cn/news/news_list.jsp?urltype=tree.TreeTe // 广西民大图书馆网址 const host = 'https://library.gxmzu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { // 发起Http请求,获取网页数据 const response = await got(url); diff --git a/lib/routes/gxmzu/router.js b/lib/routes/gxmzu/router.js index 9fe24b001e5786..32fd0f8cb7e472 100644 --- a/lib/routes/gxmzu/router.js +++ b/lib/routes/gxmzu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/aitzgg', './ai'); router.get('/libzxxx', './lib'); router.get('/yjszsgg', './yjs'); diff --git a/lib/routes/gxmzu/yjs.js b/lib/routes/gxmzu/yjs.js index 59d75aca41a953..467893c573fa83 100644 --- a/lib/routes/gxmzu/yjs.js +++ b/lib/routes/gxmzu/yjs.js @@ -3,7 +3,7 @@ const { getNoticeList } = require('./utils'); const url = 'https://yjs.gxmzu.edu.cn/tzgg/zsgg.htm'; const host = 'https://yjs.gxmzu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const out = await getNoticeList(ctx, url, host, 'a', '.timestyle55267', { title: '.titlestyle55269', content: '#vsb_content', diff --git a/lib/routes/gzdaily/app.js b/lib/routes/gzdaily/app.js index bec0575c602722..a376839f99f55e 100644 --- a/lib/routes/gzdaily/app.js +++ b/lib/routes/gzdaily/app.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const column = ctx.req.param('column') ?? 74; const currentUrl = `https://app.gzdaily.cn/app_if/getArticles?columnId=${column}&page=1`; diff --git a/lib/routes/gzdaily/router.js b/lib/routes/gzdaily/router.js index c208fb5cb4bfea..406aaa26eee912 100644 --- a/lib/routes/gzdaily/router.js +++ b/lib/routes/gzdaily/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/app/:column?', './app'); }; diff --git a/lib/routes/gzhu/router.js b/lib/routes/gzhu/router.js index df95531b0c6dda..870ee6756b839a 100644 --- a/lib/routes/gzhu/router.js +++ b/lib/routes/gzhu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/yjs', './yjs'); }; diff --git a/lib/routes/gzhu/yjs.js b/lib/routes/gzhu/yjs.js index 041c2381ec1ebb..39012a6afb1cf1 100644 --- a/lib/routes/gzhu/yjs.js +++ b/lib/routes/gzhu/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://yjsy.gzhu.edu.cn/zsxx/zsdt/zsdt.htm'; const response = await got(link, { https: { diff --git a/lib/routes/hackernews/index.js b/lib/routes/hackernews/index.js index 0e9dd2e6d5ca9b..46c8a633514b09 100644 --- a/lib/routes/hackernews/index.js +++ b/lib/routes/hackernews/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const section = ctx.req.param('section') ?? 'index'; const type = ctx.req.param('type') ?? 'sources'; const user = ctx.req.param('user') ?? ''; diff --git a/lib/routes/hackernews/router.js b/lib/routes/hackernews/router.js index fb129cd9cb97d0..371eaf7256c5fd 100644 --- a/lib/routes/hackernews/router.js +++ b/lib/routes/hackernews/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:section?/:type?/:user?', './index'); }; diff --git a/lib/routes/hackertalk/index.js b/lib/routes/hackertalk/index.js index 85ae4f9e6ef8f5..f3a766fe723c8c 100644 --- a/lib/routes/hackertalk/index.js +++ b/lib/routes/hackertalk/index.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt(); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ?? 25; const response = await got(`https://api.hackertalk.net/v1/posts?limit=${limit}&orderBy=time`); diff --git a/lib/routes/hackertalk/router.js b/lib/routes/hackertalk/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/hackertalk/router.js +++ b/lib/routes/hackertalk/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/hacking8/index.js b/lib/routes/hacking8/index.js index d41002da32dcb2..4cad38f5fb625c 100644 --- a/lib/routes/hacking8/index.js +++ b/lib/routes/hacking8/index.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'index'; const rootUrl = 'https://i.hacking8.com'; diff --git a/lib/routes/hacking8/router.js b/lib/routes/hacking8/router.js index 16d0a8987a0370..c5c0b0a45e5654 100644 --- a/lib/routes/hacking8/router.js +++ b/lib/routes/hacking8/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/search/:keyword?', './search'); router.get('/:category?', './index'); }; diff --git a/lib/routes/hacking8/search.js b/lib/routes/hacking8/search.js index ff38e0b5f2b29b..6c405c437c65be 100644 --- a/lib/routes/hacking8/search.js +++ b/lib/routes/hacking8/search.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword') ?? ''; const rootUrl = 'https://i.hacking8.com'; diff --git a/lib/routes/hackmd/profile.js b/lib/routes/hackmd/profile.js index 0cd899de569f1d..e1866f4d2eba88 100644 --- a/lib/routes/hackmd/profile.js +++ b/lib/routes/hackmd/profile.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = ctx.req.param('path'); const response = await got({ diff --git a/lib/routes/hackmd/router.js b/lib/routes/hackmd/router.js index 85509617d21770..8d194f317d1344 100644 --- a/lib/routes/hackmd/router.js +++ b/lib/routes/hackmd/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/profile/:path', './profile'); }; diff --git a/lib/routes/hackyournews/index.js b/lib/routes/hackyournews/index.js index 3dddb73b93ccc2..8e6cf2f506cc56 100644 --- a/lib/routes/hackyournews/index.js +++ b/lib/routes/hackyournews/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; // a customised got import { load } from 'cheerio'; // an HTML parser with a jQuery-like API import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://hackyournews.com'; const { data: response } = await got(baseUrl); const $ = load(response); diff --git a/lib/routes/hackyournews/router.js b/lib/routes/hackyournews/router.js index d7756988faf502..b84c130aa1d81f 100644 --- a/lib/routes/hackyournews/router.js +++ b/lib/routes/hackyournews/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/hafu/news.js b/lib/routes/hafu/news.js index acf4fa3b82e69e..8f7afd5a37750a 100644 --- a/lib/routes/hafu/news.js +++ b/lib/routes/hafu/news.js @@ -1,6 +1,6 @@ const parseList = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { // set default router type const type = ctx.req.param('type') ?? 'ggtz'; diff --git a/lib/routes/hafu/router.js b/lib/routes/hafu/router.js index 4880153cca019a..eb19f8f1f67ba3 100644 --- a/lib/routes/hafu/router.js +++ b/lib/routes/hafu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:type?', './news'); }; diff --git a/lib/routes/hakkatv/router.js b/lib/routes/hakkatv/router.js index 659c6e74c9f222..10f00d72d5539c 100644 --- a/lib/routes/hakkatv/router.js +++ b/lib/routes/hakkatv/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:type?', './type'); }; diff --git a/lib/routes/hakkatv/type.js b/lib/routes/hakkatv/type.js index 5586ebbd281ae4..480945028de525 100644 --- a/lib/routes/hakkatv/type.js +++ b/lib/routes/hakkatv/type.js @@ -7,7 +7,7 @@ const typeMap = ['hakka', 'political', 'medical', 'local', 'international']; const baseUrl = 'https://www.hakkatv.org.tw'; const apiUrl = 'https://api.hakkatv.org.tw'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const allData = type diff --git a/lib/routes/hameln/chapter.js b/lib/routes/hameln/chapter.js index d880cb66959119..206a92740ce6ee 100644 --- a/lib/routes/hameln/chapter.js +++ b/lib/routes/hameln/chapter.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = Number.parseInt(ctx.req.query('limit')) || 5; const link = `https://syosetu.org/novel/${id}`; diff --git a/lib/routes/hameln/router.js b/lib/routes/hameln/router.js index 898eab712bdc63..da9b4fd23547ee 100644 --- a/lib/routes/hameln/router.js +++ b/lib/routes/hameln/router.js @@ -1 +1 @@ -module.exports = (router) => router.get('/chapter/:id', './chapter.js'); +export default (router) => router.get('/chapter/:id', './chapter.js'); diff --git a/lib/routes/harvard/health/blog.js b/lib/routes/harvard/health/blog.js index f6916ff79d259f..398bea22adc71b 100644 --- a/lib/routes/harvard/health/blog.js +++ b/lib/routes/harvard/health/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.health.harvard.edu'; const currentUrl = `${rootUrl}/blog`; diff --git a/lib/routes/harvard/router.js b/lib/routes/harvard/router.js index 6ce7fb948db32b..d0c4dcbdf75be5 100644 --- a/lib/routes/harvard/router.js +++ b/lib/routes/harvard/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/health/blog', './health/blog'); }; diff --git a/lib/routes/hashnode/blog.js b/lib/routes/hashnode/blog.js index 913222f5f448c3..fb267011581b27 100644 --- a/lib/routes/hashnode/blog.js +++ b/lib/routes/hashnode/blog.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseApiUrl = 'https://api.hashnode.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const username = ctx.req.param('username'); if (!username) { return; diff --git a/lib/routes/hashnode/router.js b/lib/routes/hashnode/router.js index 697fa2c76f6cd5..529f278ed5c53b 100644 --- a/lib/routes/hashnode/router.js +++ b/lib/routes/hashnode/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog/:username', './blog'); }; diff --git a/lib/routes/hbooker/chapter.js b/lib/routes/hbooker/chapter.js index f68226bcea069b..ebe3694cbdab82 100644 --- a/lib/routes/hbooker/chapter.js +++ b/lib/routes/hbooker/chapter.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param.get('id'); const limit = Number.parseInt(ctx.req.query('limit')) || 10; diff --git a/lib/routes/hbooker/router.js b/lib/routes/hbooker/router.js index 81d0ce005f570c..bf5f0b92e5d9ed 100644 --- a/lib/routes/hbooker/router.js +++ b/lib/routes/hbooker/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/chapter/:id', require('./chapter')); }; diff --git a/lib/routes/hbr/router.js b/lib/routes/hbr/router.js index d6365133ec71a3..15a0c870dda5ea 100644 --- a/lib/routes/hbr/router.js +++ b/lib/routes/hbr/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/topic/:topic?/:type?', './topic'); }; diff --git a/lib/routes/hbr/topic.js b/lib/routes/hbr/topic.js index a5e20adbcf9084..a0d71ede8330f9 100644 --- a/lib/routes/hbr/topic.js +++ b/lib/routes/hbr/topic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const topic = ctx.req.param('topic') ?? 'leadership'; const type = ctx.req.param('type') ?? 'Latest'; diff --git a/lib/routes/hdu/cs/notice.js b/lib/routes/hdu/cs/notice.js index d8084b17e5608a..cc34ba853544bd 100644 --- a/lib/routes/hdu/cs/notice.js +++ b/lib/routes/hdu/cs/notice.js @@ -29,7 +29,7 @@ const getSingleRecord = async () => { ); }; -module.exports = async (ctx) => { +export default async (ctx) => { const items = await getSingleRecord(); const out = await Promise.all( items.map((item) => diff --git a/lib/routes/hdu/cs/pg.js b/lib/routes/hdu/cs/pg.js index c7db47711dc286..16d9de1d3db5ee 100644 --- a/lib/routes/hdu/cs/pg.js +++ b/lib/routes/hdu/cs/pg.js @@ -29,7 +29,7 @@ const getSingleRecord = async () => { ); }; -module.exports = async (ctx) => { +export default async (ctx) => { const items = await getSingleRecord(); const out = await Promise.all( items.map((item) => diff --git a/lib/routes/hdu/router.js b/lib/routes/hdu/router.js index 6708acd372462d..9f35887a3d661e 100644 --- a/lib/routes/hdu/router.js +++ b/lib/routes/hdu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { // 杭州电子科技大学 router.get('/cs', './cs/notice'); router.get('/cs/pg', './cs/pg'); diff --git a/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.js b/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.js index ee34d6c6d06d4b..aef886a39c765b 100644 --- a/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.js +++ b/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.js @@ -8,7 +8,7 @@ import * as path from 'node:path'; const baseUrl = 'https://web.cmc.hebtv.com/cms/rmt0336/19/19js/st/ds/nmpd/nbszxd/index.shtml'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 40; const apiRootUrl = 'http://api.cmc.hebtv.com'; diff --git a/lib/routes/hebtv/router.js b/lib/routes/hebtv/router.js index 16ef8a4174feda..505874853c2ee5 100644 --- a/lib/routes/hebtv/router.js +++ b/lib/routes/hebtv/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/nbszxd', './nong-bo-shi-zai-xing-dong.js'); }; diff --git a/lib/routes/hellobtc/information.js b/lib/routes/hellobtc/information.js index eabc3ae84b01aa..18ca8ee30ca541 100644 --- a/lib/routes/hellobtc/information.js +++ b/lib/routes/hellobtc/information.js @@ -16,7 +16,7 @@ const titleMap = { application: '应用', }; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel') ?? 'latest'; const url = rootUrl; diff --git a/lib/routes/hellobtc/kepu.js b/lib/routes/hellobtc/kepu.js index ae64e0dc40a107..740294fa706d3b 100644 --- a/lib/routes/hellobtc/kepu.js +++ b/lib/routes/hellobtc/kepu.js @@ -28,7 +28,7 @@ const titleMap = { public_blockchain: '公链', }; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel') ?? 'latest'; const url = `${rootUrl}/kepu.html`; diff --git a/lib/routes/hellobtc/news.js b/lib/routes/hellobtc/news.js index 12487956e2c48f..afb57d801b3d67 100644 --- a/lib/routes/hellobtc/news.js +++ b/lib/routes/hellobtc/news.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; const rootUrl = 'https://www.hellobtc.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${rootUrl}/news`; const response = await got(url); diff --git a/lib/routes/hellobtc/router.js b/lib/routes/hellobtc/router.js index c9d47e66b89892..147645105e05c1 100644 --- a/lib/routes/hellobtc/router.js +++ b/lib/routes/hellobtc/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/information/:channel?', './information'); router.get('/news', './news'); router.get('/kepu/:channel?', './kepu'); diff --git a/lib/routes/hellogithub/index.js b/lib/routes/hellogithub/index.js index b3ec47a767f0cc..7ca26c3e7520fa 100644 --- a/lib/routes/hellogithub/index.js +++ b/lib/routes/hellogithub/index.js @@ -10,7 +10,7 @@ const sorts = { last: '最近', }; -module.exports = async (ctx) => { +export default async (ctx) => { const sort = ctx.req.param('sort') ?? 'hot'; const id = ctx.req.param('id') ?? ''; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; diff --git a/lib/routes/hellogithub/report.js b/lib/routes/hellogithub/report.js index 384b0c3f2eb4ff..552c58d03b6ca7 100644 --- a/lib/routes/hellogithub/report.js +++ b/lib/routes/hellogithub/report.js @@ -9,7 +9,7 @@ const types = { 'db-engines': '数据库', }; -module.exports = async (ctx) => { +export default async (ctx) => { let type = ctx.req.param('type') ?? 'tiobe'; type = type === 'webserver' ? 'netcraft' : type === 'db' ? 'db-engines' : type; diff --git a/lib/routes/hellogithub/router.js b/lib/routes/hellogithub/router.js index 084d7594ed91a5..551c7dc337fd00 100644 --- a/lib/routes/hellogithub/router.js +++ b/lib/routes/hellogithub/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/article/:sort?/:id?', './index'); router.get('/month', './volume'); router.get('/ranking/:type?', './report'); diff --git a/lib/routes/hellogithub/volume.js b/lib/routes/hellogithub/volume.js index 7dca462a420873..1423f009aeb411 100644 --- a/lib/routes/hellogithub/volume.js +++ b/lib/routes/hellogithub/volume.js @@ -10,7 +10,7 @@ art.defaults.imports.render = function (string) { return md.render(string); }; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://hellogithub.com'; const apiUrl = 'https://api.hellogithub.com/v1/periodical/'; diff --git a/lib/routes/hex-rays/index.js b/lib/routes/hex-rays/index.js index ed3511ea895b4c..f284b2b136b66f 100644 --- a/lib/routes/hex-rays/index.js +++ b/lib/routes/hex-rays/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.hex-rays.com/blog/'; const response = await got.get(link); const $ = load(response.data); diff --git a/lib/routes/hex-rays/router.js b/lib/routes/hex-rays/router.js index 510e8e1e6cf542..c037330e2d74a9 100644 --- a/lib/routes/hex-rays/router.js +++ b/lib/routes/hex-rays/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './index'); }; diff --git a/lib/routes/hicairo/router.js b/lib/routes/hicairo/router.js index 42ffe3a854b3a5..09c585b57315bb 100644 --- a/lib/routes/hicairo/router.js +++ b/lib/routes/hicairo/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './rss'); }; diff --git a/lib/routes/hicairo/rss.js b/lib/routes/hicairo/rss.js index a466855ee22f34..1a2917f1fe16bc 100644 --- a/lib/routes/hicairo/rss.js +++ b/lib/routes/hicairo/rss.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = 'https://www.hicairo.com'; const response = await got(`${currentUrl}/feed.php`); const $ = load(response.data, { xmlMode: true }); diff --git a/lib/routes/hinatazaka46/blog.js b/lib/routes/hinatazaka46/blog.js index daf809d8f99989..90bc5a0d315ec7 100644 --- a/lib/routes/hinatazaka46/blog.js +++ b/lib/routes/hinatazaka46/blog.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.hinatazaka46.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'all'; const page = ctx.req.param('page') ?? '0'; diff --git a/lib/routes/hinatazaka46/news.js b/lib/routes/hinatazaka46/news.js index 7fefe09fffcf2a..cef9ff0a594a3d 100644 --- a/lib/routes/hinatazaka46/news.js +++ b/lib/routes/hinatazaka46/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.hinatazaka46.com'; const currentUrl = `${rootUrl}/s/official/news/list`; diff --git a/lib/routes/hinatazaka46/router.js b/lib/routes/hinatazaka46/router.js index e2b9230a058d9b..d1333d6c2b0fa8 100644 --- a/lib/routes/hinatazaka46/router.js +++ b/lib/routes/hinatazaka46/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); router.get('/blog/:id?/:page?', './blog'); }; diff --git a/lib/routes/hit/hitgs.js b/lib/routes/hit/hitgs.js index 9a5e50440bea51..0edb34c9a44980 100644 --- a/lib/routes/hit/hitgs.js +++ b/lib/routes/hit/hitgs.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://hitgs.hit.edu.cn'; const response = await got(host + '/tzgg/list.htm', { diff --git a/lib/routes/hit/jwc.js b/lib/routes/hit/jwc.js index 0ce46472992fe2..502fe48bd8ad95 100644 --- a/lib/routes/hit/jwc.js +++ b/lib/routes/hit/jwc.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://jwc.hit.edu.cn'; const type = (filename) => filename.split('.').pop(); -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(`${baseUrl}/2591/list.htm`); const { data } = response; diff --git a/lib/routes/hit/router.js b/lib/routes/hit/router.js index 32acfe388b884b..1dc2175c55ada8 100644 --- a/lib/routes/hit/router.js +++ b/lib/routes/hit/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { // 哈尔滨工业大学 router.get('/hitgs', './hitgs'); router.get('/jwc', './jwc'); diff --git a/lib/routes/hit/today.js b/lib/routes/hit/today.js index 41c0066a60fa03..9cc40b9165e2e6 100644 --- a/lib/routes/hit/today.js +++ b/lib/routes/hit/today.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://today.hit.edu.cn'; const category = ctx.req.param('category'); diff --git a/lib/routes/hitsz/article.js b/lib/routes/hitsz/article.js index d56aff4af70cd8..e6faaac0e94937 100644 --- a/lib/routes/hitsz/article.js +++ b/lib/routes/hitsz/article.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://www.hitsz.edu.cn'; const category = ctx.req.param('category') ?? 'id-77'; const link = `${host}/article/${category}.html`; diff --git a/lib/routes/hitsz/router.js b/lib/routes/hitsz/router.js index 40cd90bf27d34f..dfe811d4081396 100644 --- a/lib/routes/hitsz/router.js +++ b/lib/routes/hitsz/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/article/:category?', './article'); }; diff --git a/lib/routes/hitwh/router.js b/lib/routes/hitwh/router.js index 06faf7830376e0..c582a661cd6d4b 100644 --- a/lib/routes/hitwh/router.js +++ b/lib/routes/hitwh/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/today', './today'); }; diff --git a/lib/routes/hitwh/today.js b/lib/routes/hitwh/today.js index d6cc8783376d62..80359b3c50444d 100644 --- a/lib/routes/hitwh/today.js +++ b/lib/routes/hitwh/today.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'https://today.hitwh.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(`${baseUrl}/1024/list.htm`, { https: { rejectUnauthorized: false, diff --git a/lib/routes/hizu/index.js b/lib/routes/hizu/index.js index 3c44ae776cffde..41031b807843ea 100644 --- a/lib/routes/hizu/index.js +++ b/lib/routes/hizu/index.js @@ -30,7 +30,7 @@ const titles = { '607d37ade4b05c59ac2f3d40': '高新', }; -module.exports = async (ctx) => { +export default async (ctx) => { const column = ctx.req.param('column') ?? '5dd92265e4b0bf88dd8c1175'; const rootUrl = 'https://www.hizh.cn'; diff --git a/lib/routes/hizu/router.js b/lib/routes/hizu/router.js index 804c880e27d6ba..699c5cf13f17ff 100644 --- a/lib/routes/hizu/router.js +++ b/lib/routes/hizu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:column?', './index'); }; diff --git a/lib/routes/hk01/channel.js b/lib/routes/hk01/channel.js index d856b1e13f9ff7..e999ead023a063 100644 --- a/lib/routes/hk01/channel.js +++ b/lib/routes/hk01/channel.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { rootUrl, apiRootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '1'; const currentUrl = `${rootUrl}/channel/${id}`; diff --git a/lib/routes/hk01/hot.js b/lib/routes/hk01/hot.js index 9e926f48f66001..526ddaab803a56 100644 --- a/lib/routes/hk01/hot.js +++ b/lib/routes/hk01/hot.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { rootUrl, apiRootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/hot`; const apiUrl = `${apiRootUrl}/v2/feed/hot`; diff --git a/lib/routes/hk01/issue.js b/lib/routes/hk01/issue.js index 2bd1e3432552ed..e4fde5765b00fd 100644 --- a/lib/routes/hk01/issue.js +++ b/lib/routes/hk01/issue.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { rootUrl, apiRootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '649'; const currentUrl = `${rootUrl}/issue/${id}`; diff --git a/lib/routes/hk01/latest.js b/lib/routes/hk01/latest.js index ce9d74f9721bb3..65c42403081986 100644 --- a/lib/routes/hk01/latest.js +++ b/lib/routes/hk01/latest.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { rootUrl, apiRootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/latest`; const apiUrl = `${apiRootUrl}/v2/page/latest`; diff --git a/lib/routes/hk01/router.js b/lib/routes/hk01/router.js index 69bec07708b89a..17bf1a2ca5d20d 100644 --- a/lib/routes/hk01/router.js +++ b/lib/routes/hk01/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/channel/:id?', './channel'); router.get('/hot', './hot'); router.get('/issue/:id?', './issue'); diff --git a/lib/routes/hk01/tag.js b/lib/routes/hk01/tag.js index 6dc7ee38afb04f..a5668853c571e0 100644 --- a/lib/routes/hk01/tag.js +++ b/lib/routes/hk01/tag.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { rootUrl, apiRootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '1'; const currentUrl = `${rootUrl}/tag/${id}`; diff --git a/lib/routes/hk01/zone.js b/lib/routes/hk01/zone.js index aa45929315c958..60cb9043e4fd78 100644 --- a/lib/routes/hk01/zone.js +++ b/lib/routes/hk01/zone.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { rootUrl, apiRootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '1'; const currentUrl = `${rootUrl}/zone/${id}`; diff --git a/lib/routes/hkej/index.js b/lib/routes/hkej/index.js index 5a35944fb330cd..c2231b6e85cd39 100644 --- a/lib/routes/hkej/index.js +++ b/lib/routes/hkej/index.js @@ -54,7 +54,7 @@ const categories = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'index'; const cat = categories[category]; const baseUrl = 'https://www2.hkej.com'; diff --git a/lib/routes/hkej/router.js b/lib/routes/hkej/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/hkej/router.js +++ b/lib/routes/hkej/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/hkepc/index.js b/lib/routes/hkepc/index.js index 94f61bc63ef84b..66d77548bbaaf9 100644 --- a/lib/routes/hkepc/index.js +++ b/lib/routes/hkepc/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { baseUrl, categoryMap } = require('./data'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const { data: response } = await got(categoryMap[category].url, { diff --git a/lib/routes/hkepc/router.js b/lib/routes/hkepc/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/hkepc/router.js +++ b/lib/routes/hkepc/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/hket/index.js b/lib/routes/hket/index.js index 233cb60e0bddf5..8a82e481ef19db 100644 --- a/lib/routes/hket/index.js +++ b/lib/routes/hket/index.js @@ -21,7 +21,7 @@ const urlMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'sran001' } = ctx.req.param(); const baseUrl = urlMap[category.substring(0, 4)].baseUrl; diff --git a/lib/routes/hket/router.js b/lib/routes/hket/router.js index 5db50869af4b34..0bcd82a5c2aa19 100644 --- a/lib/routes/hket/router.js +++ b/lib/routes/hket/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/hkjunkcall/index.js b/lib/routes/hkjunkcall/index.js index b4b88193172049..8be8dc20c39a59 100644 --- a/lib/routes/hkjunkcall/index.js +++ b/lib/routes/hkjunkcall/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://hkjunkcall.com'; const currentUrl = `${rootUrl}/cdpushdash.asp`; diff --git a/lib/routes/hkjunkcall/router.js b/lib/routes/hkjunkcall/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/hkjunkcall/router.js +++ b/lib/routes/hkjunkcall/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/hljucm/router.js b/lib/routes/hljucm/router.js index 0004c6a7555a39..87c68a3d61621f 100644 --- a/lib/routes/hljucm/router.js +++ b/lib/routes/hljucm/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/yjsy/:category?', './yjsy'); }; diff --git a/lib/routes/hljucm/yjsy.js b/lib/routes/hljucm/yjsy.js index 1b162780687a48..f040859ef00ddf 100644 --- a/lib/routes/hljucm/yjsy.js +++ b/lib/routes/hljucm/yjsy.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'xwdt'; const rootUrl = 'https://yjsy.hljucm.net'; diff --git a/lib/routes/hnrb/index.js b/lib/routes/hnrb/index.js index cf7a8b1508f4e6..fe345f00d865bf 100644 --- a/lib/routes/hnrb/index.js +++ b/lib/routes/hnrb/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://hnrb.voc.com.cn'; diff --git a/lib/routes/hnrb/router.js b/lib/routes/hnrb/router.js index c34676efd9b9eb..28cef7111ec14a 100644 --- a/lib/routes/hnrb/router.js +++ b/lib/routes/hnrb/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id?', './index'); }; diff --git a/lib/routes/hnu/careers.js b/lib/routes/hnu/careers.js index 2c3a83533bf071..d6bbd217cbf9ec 100644 --- a/lib/routes/hnu/careers.js +++ b/lib/routes/hnu/careers.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://scc.hnu.edu.cn/'; // 校园招聘的路由为/module/getcareers,但该页面默认仅加载整体框架,具体的招聘信息在页面加载完成后再交易获取。 // 具体的交易可以通过f12,网络栏进行查看,项目中仅保留了必须携带的参数。 diff --git a/lib/routes/hnu/router.js b/lib/routes/hnu/router.js index b26a3bd3e25c09..c56679031f8bb8 100644 --- a/lib/routes/hnu/router.js +++ b/lib/routes/hnu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/careers', './careers'); }; diff --git a/lib/routes/hongkong/chp.js b/lib/routes/hongkong/chp.js index 549acc531d6d4d..c291c0fae2cd2d 100644 --- a/lib/routes/hongkong/chp.js +++ b/lib/routes/hongkong/chp.js @@ -36,7 +36,7 @@ const titles = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const languageCodes = { en: 'en', zh_cn: 'sc', diff --git a/lib/routes/hongkong/dh.js b/lib/routes/hongkong/dh.js index cabc7fdb179733..f7dcc2e8a6a754 100644 --- a/lib/routes/hongkong/dh.js +++ b/lib/routes/hongkong/dh.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? 'tc_chi'; const rootUrl = 'https://www.dh.gov.hk'; diff --git a/lib/routes/hongkong/router.js b/lib/routes/hongkong/router.js index b1ec4059f378bf..73f5ab695fd5ba 100644 --- a/lib/routes/hongkong/router.js +++ b/lib/routes/hongkong/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/dh/:language?', './dh'); router.get('/chp/:category?/:language?', './chp'); }; diff --git a/lib/routes/hostmonit/cloudflareyes.js b/lib/routes/hostmonit/cloudflareyes.js index e3e252ff0212d5..9aba97983c0186 100644 --- a/lib/routes/hostmonit/cloudflareyes.js +++ b/lib/routes/hostmonit/cloudflareyes.js @@ -11,7 +11,7 @@ const lines = { CT: '中国电信', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'v4' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/hostmonit/cloudflareyesv6.js b/lib/routes/hostmonit/cloudflareyesv6.js index 39e31885db6fa7..dbb60c0794f76a 100644 --- a/lib/routes/hostmonit/cloudflareyesv6.js +++ b/lib/routes/hostmonit/cloudflareyesv6.js @@ -1,3 +1,3 @@ -module.exports = (ctx) => { +export default (ctx) => { ctx.redirect('/hostmonit/cloudflareyes/v6'); }; diff --git a/lib/routes/hostmonit/router.js b/lib/routes/hostmonit/router.js index c0c6188b4e3be8..8a5140e03a4207 100644 --- a/lib/routes/hostmonit/router.js +++ b/lib/routes/hostmonit/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/cloudflareyes/:type?', './cloudflareyes'); router.get('/cloudflareyesv6', './cloudflareyesv6'); }; diff --git a/lib/routes/hotukdeals/hottest.js b/lib/routes/hotukdeals/hottest.js index bdd848e1d552f1..759b9f20fc7c95 100644 --- a/lib/routes/hotukdeals/hottest.js +++ b/lib/routes/hotukdeals/hottest.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { JSDOM } = require('jsdom'); -module.exports = async (ctx) => { +export default async (ctx) => { const data = await got.get(`https://www.hotukdeals.com/`, { headers: { Referer: `https://www.hotukdeals.com/`, diff --git a/lib/routes/hotukdeals/index.js b/lib/routes/hotukdeals/index.js index 5efac271806de4..49a5b2d1ce055d 100644 --- a/lib/routes/hotukdeals/index.js +++ b/lib/routes/hotukdeals/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { let type = ctx.req.param('type'); if (type === 'highlights') { type = ''; diff --git a/lib/routes/hotukdeals/router.js b/lib/routes/hotukdeals/router.js index 90bf4d8edd393c..271cee69a4f0aa 100644 --- a/lib/routes/hotukdeals/router.js +++ b/lib/routes/hotukdeals/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/hottest', './hottest'); router.get('/:type', './index'); }; diff --git a/lib/routes/houxu/events.js b/lib/routes/houxu/events.js index 8bb3a9abd8eb24..900a0bcebebf96 100644 --- a/lib/routes/houxu/events.js +++ b/lib/routes/houxu/events.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://houxu.app'; const apiUrl = `${rootUrl}/api/1/events?limit=${ctx.req.query('limit') ?? 50}`; const currentUrl = `${rootUrl}/events`; diff --git a/lib/routes/houxu/index.js b/lib/routes/houxu/index.js index b943aeba3d6015..8a39e5e9f8d6af 100644 --- a/lib/routes/houxu/index.js +++ b/lib/routes/houxu/index.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://houxu.app'; const apiUrl = `${rootUrl}/api/1/records/index?limit=${ctx.req.query('limit') ?? 50}`; diff --git a/lib/routes/houxu/lives.js b/lib/routes/houxu/lives.js index 328a7dd9985d00..1e6a3427332ac7 100644 --- a/lib/routes/houxu/lives.js +++ b/lib/routes/houxu/lives.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://houxu.app'; diff --git a/lib/routes/houxu/memory.js b/lib/routes/houxu/memory.js index 59667588e7d51d..f168af11e0cabd 100644 --- a/lib/routes/houxu/memory.js +++ b/lib/routes/houxu/memory.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://houxu.app'; const apiUrl = `${rootUrl}/api/1/lives/updated?limit=${ctx.req.query('limit') ?? 50}`; const currentUrl = `${rootUrl}/memory`; diff --git a/lib/routes/houxu/router.js b/lib/routes/houxu/router.js index 226f796677075e..a336aeab9120de 100644 --- a/lib/routes/houxu/router.js +++ b/lib/routes/houxu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/events', './events'); router.get('/featured', './index'); router.get('/index', './index'); diff --git a/lib/routes/howtoforge/router.js b/lib/routes/howtoforge/router.js index 42ffe3a854b3a5..09c585b57315bb 100644 --- a/lib/routes/howtoforge/router.js +++ b/lib/routes/howtoforge/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './rss'); }; diff --git a/lib/routes/howtoforge/rss.js b/lib/routes/howtoforge/rss.js index 25d25d5340b732..7709dee7558d91 100644 --- a/lib/routes/howtoforge/rss.js +++ b/lib/routes/howtoforge/rss.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = 'https://www.howtoforge.com'; const response = await got(`${currentUrl}/feed.rss`); const $ = load(response.data, { xmlMode: true }); diff --git a/lib/routes/hoyolab/news.js b/lib/routes/hoyolab/news.js index 41934c19a12725..84c84a3ba85b81 100644 --- a/lib/routes/hoyolab/news.js +++ b/lib/routes/hoyolab/news.js @@ -70,7 +70,7 @@ const getPostContent = (list, { language }) => }) ); -module.exports = async (ctx) => { +export default async (ctx) => { try { const { type, gids, language } = ctx.req.param(); const params = { diff --git a/lib/routes/hoyolab/router.js b/lib/routes/hoyolab/router.js index 863d21ec4aaa68..ee898d27733089 100644 --- a/lib/routes/hoyolab/router.js +++ b/lib/routes/hoyolab/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:language/:gids/:type', './news'); }; diff --git a/lib/routes/hpoi/banner-item.js b/lib/routes/hpoi/banner-item.js index 8eb61c29861c19..b753e6a30bd412 100644 --- a/lib/routes/hpoi/banner-item.js +++ b/lib/routes/hpoi/banner-item.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.hpoi.net/bannerItem/list?categoryId=0&bannerItemType=0&subType=0&page=1'; const response = await got({ method: 'get', diff --git a/lib/routes/hpoi/info.js b/lib/routes/hpoi/info.js index 867e11312dea45..3dfb592f7070a5 100644 --- a/lib/routes/hpoi/info.js +++ b/lib/routes/hpoi/info.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'all' } = ctx.req.param(); const baseUrl = 'https://www.hpoi.net'; const reqUrl = `${baseUrl}/user/home/ajax`; diff --git a/lib/routes/hpoi/router.js b/lib/routes/hpoi/router.js index ed3c3c9c8844a7..4db58d80afdcd3 100644 --- a/lib/routes/hpoi/router.js +++ b/lib/routes/hpoi/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/info/:type?', './info'); router.get('/items/all/:order?', './all'); router.get('/items/character/:id/:order?', './character'); diff --git a/lib/routes/hpoi/user.js b/lib/routes/hpoi/user.js index a6ad74370caa30..536283a73ed25c 100644 --- a/lib/routes/hpoi/user.js +++ b/lib/routes/hpoi/user.js @@ -11,7 +11,7 @@ const titleMap = { resell: '有过', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { user_id, caty } = ctx.req.param(); const url = `${root_url}/user/${user_id}/hobby?order=actionDate&view=2&favState=${caty}`; diff --git a/lib/routes/hrbeu/gx/card.js b/lib/routes/hrbeu/gx/card.js index a89f180a3a17db..0b9c8b4dacb7ac 100644 --- a/lib/routes/hrbeu/gx/card.js +++ b/lib/routes/hrbeu/gx/card.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const rootUrl = 'http://news.hrbeu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const column = ctx.req.param('column'); const id = ctx.req.param('id') || ''; const toUrl = id === '' ? `${rootUrl}/${column}.htm` : `${rootUrl}/${column}/${id}.htm`; diff --git a/lib/routes/hrbeu/gx/list.js b/lib/routes/hrbeu/gx/list.js index 8b0cdd556cd6f3..1e6c4835a8ba55 100644 --- a/lib/routes/hrbeu/gx/list.js +++ b/lib/routes/hrbeu/gx/list.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const rootUrl = 'http://news.hrbeu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const column = ctx.req.param('column'); const id = ctx.req.param('id') || ''; const toUrl = id === '' ? `${rootUrl}/${column}.htm` : `${rootUrl}/${column}/${id}.htm`; diff --git a/lib/routes/hrbeu/job/bigemploy.js b/lib/routes/hrbeu/job/bigemploy.js index b4bf2a84a8baac..777369c51c19e2 100644 --- a/lib/routes/hrbeu/job/bigemploy.js +++ b/lib/routes/hrbeu/job/bigemploy.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('http://job.hrbeu.edu.cn/HrbeuJY/web'); const $ = load(response.data); diff --git a/lib/routes/hrbeu/job/calendar.js b/lib/routes/hrbeu/job/calendar.js index 0da7551973fb10..1327a051db5527 100644 --- a/lib/routes/hrbeu/job/calendar.js +++ b/lib/routes/hrbeu/job/calendar.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const rootUrl = 'http://job.hrbeu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const date = new Date(); const year = date.getFullYear(); const month = date.getMonth() + 1; diff --git a/lib/routes/hrbeu/job/list.js b/lib/routes/hrbeu/job/list.js index 343cd4e06a0728..a0a65bb67ea0dc 100644 --- a/lib/routes/hrbeu/job/list.js +++ b/lib/routes/hrbeu/job/list.js @@ -16,7 +16,7 @@ const idMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got(idMap[id].url, { diff --git a/lib/routes/hrbeu/router.js b/lib/routes/hrbeu/router.js index 4fbc912f1c99cc..cacd891bcba687 100644 --- a/lib/routes/hrbeu/router.js +++ b/lib/routes/hrbeu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/job/bigemploy', './job/bigemploy'); router.get('/job/calendar', './job/calendar'); router.get('/job/list/:id', './job/list'); diff --git a/lib/routes/hrbeu/uae/news.js b/lib/routes/hrbeu/uae/news.js index abbe8fc2ae6d11..3df7c8db552d2e 100644 --- a/lib/routes/hrbeu/uae/news.js +++ b/lib/routes/hrbeu/uae/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { finishArticleItem } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id').replaceAll('-', '/'); const host = 'http://uae.hrbeu.edu.cn'; const url = `${host}/${id}.htm`; diff --git a/lib/routes/hrbeu/ugs/news.js b/lib/routes/hrbeu/ugs/news.js index d0c7113a02f105..34101689856388 100644 --- a/lib/routes/hrbeu/ugs/news.js +++ b/lib/routes/hrbeu/ugs/news.js @@ -53,7 +53,7 @@ const authorMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const author = ctx.req.param('author') || 'gztz'; const category = ctx.req.param('category') || 'all'; const link = baseUrl + authorMap[author][category] + '/list.htm'; diff --git a/lib/routes/hrbeu/yjsy/list.js b/lib/routes/hrbeu/yjsy/list.js index b33bf28410ea5e..bfdab7f0acc819 100644 --- a/lib/routes/hrbeu/yjsy/list.js +++ b/lib/routes/hrbeu/yjsy/list.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const rootUrl = 'http://yjsy.hrbeu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got(`${rootUrl}/${id}/list.htm`, { diff --git a/lib/routes/hrbust/jwzx.js b/lib/routes/hrbust/jwzx.js index 8b2c58be9343db..dbac12cf461b5f 100644 --- a/lib/routes/hrbust/jwzx.js +++ b/lib/routes/hrbust/jwzx.js @@ -17,7 +17,7 @@ const typeMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const page = ctx.req.param('page') || '12'; const base = utils.columnIdBase(ctx.req.param('type')) + '&pagingNumberPer=' + page; const res = await got(base); diff --git a/lib/routes/hrbust/router.js b/lib/routes/hrbust/router.js index 348c0f2747591e..19a640295bc164 100644 --- a/lib/routes/hrbust/router.js +++ b/lib/routes/hrbust/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/jwzx/:type?/:page?', './jwzx'); }; diff --git a/lib/routes/huanqiu/index.js b/lib/routes/huanqiu/index.js index 4b3455a9e2a181..17c5ee70f5e266 100644 --- a/lib/routes/huanqiu/index.js +++ b/lib/routes/huanqiu/index.js @@ -15,7 +15,7 @@ function getKeysRecursive(dic, key, attr, array) { return array; } -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'china'; if (!isValidHost(category)) { throw new Error('Invalid category'); diff --git a/lib/routes/huanqiu/router.js b/lib/routes/huanqiu/router.js index dac2198d0b1f01..25b207caa20ba5 100644 --- a/lib/routes/huanqiu/router.js +++ b/lib/routes/huanqiu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:category?', './index'); }; diff --git a/lib/routes/huggingface/blog-zh.js b/lib/routes/huggingface/blog-zh.js index 1ebce09f9197bb..3a770fef7f358a 100644 --- a/lib/routes/huggingface/blog-zh.js +++ b/lib/routes/huggingface/blog-zh.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { body: response } = await got('https://huggingface.co/blog/zh'); const $ = load(response); diff --git a/lib/routes/huggingface/daily-papers.js b/lib/routes/huggingface/daily-papers.js index aeb0ffd0ed34ac..200d6d2255de4a 100644 --- a/lib/routes/huggingface/daily-papers.js +++ b/lib/routes/huggingface/daily-papers.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { body: response } = await got('https://huggingface.co/papers'); const $ = load(response); const papers = $('main > div[data-target="DailyPapers"]').data('props'); diff --git a/lib/routes/huggingface/router.js b/lib/routes/huggingface/router.js index 76cd9984829a19..f74a19089c9ce9 100644 --- a/lib/routes/huggingface/router.js +++ b/lib/routes/huggingface/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog-zh', './blog-zh'); router.get('/daily-papers', './daily-papers'); }; diff --git a/lib/routes/hunanpea/router.js b/lib/routes/hunanpea/router.js index f1f7d69e85f38a..8014590b9c5c6f 100644 --- a/lib/routes/hunanpea/router.js +++ b/lib/routes/hunanpea/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/rsks/:guid', './rsks'); }; diff --git a/lib/routes/hunanpea/rsks.js b/lib/routes/hunanpea/rsks.js index c41fcefe5bd983..a7ee231d0af989 100644 --- a/lib/routes/hunanpea/rsks.js +++ b/lib/routes/hunanpea/rsks.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://rsks.hunanpea.com'; const guid = ctx.req.param('guid'); const link = `${baseUrl}/Category/${guid}/ArticlesByCategory.do?PageIndex=1`; diff --git a/lib/routes/hunau/gfxy/index.js b/lib/routes/hunau/gfxy/index.js index 75b6dc945c94d9..0933eb59d934b6 100644 --- a/lib/routes/hunau/gfxy/index.js +++ b/lib/routes/hunau/gfxy/index.js @@ -1,6 +1,6 @@ const getContent = require('../utils/common'); -module.exports = async (ctx) => { +export default async (ctx) => { await getContent(ctx, { baseHost: 'https://gfxy.hunau.edu.cn', baseCategory: 'tzgg', // 默认:通知公告 diff --git a/lib/routes/hunau/ied.js b/lib/routes/hunau/ied.js index 02be7436363ba5..9803a4b6fe2195 100644 --- a/lib/routes/hunau/ied.js +++ b/lib/routes/hunau/ied.js @@ -1,6 +1,6 @@ const getContent = require('./utils/common'); -module.exports = async (ctx) => { +export default async (ctx) => { await getContent(ctx, { baseHost: 'https://ied.hunau.edu.cn', baseCategory: 'ggtz', // 默认:公告通知 diff --git a/lib/routes/hunau/jwc.js b/lib/routes/hunau/jwc.js index c3e23585f6a07c..3b1a5762541aa6 100644 --- a/lib/routes/hunau/jwc.js +++ b/lib/routes/hunau/jwc.js @@ -1,6 +1,6 @@ const getContent = require('./utils/common'); -module.exports = async (ctx) => { +export default async (ctx) => { await getContent(ctx, { baseHost: 'https://jwc.hunau.edu.cn', baseCategory: 'tzgg', // 默认:通知公告 diff --git a/lib/routes/hunau/router.js b/lib/routes/hunau/router.js index 8bbc76d1c55e28..c84e6802334f3b 100644 --- a/lib/routes/hunau/router.js +++ b/lib/routes/hunau/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/gfxy/:category?/:page?', './gfxy'); router.get('/ied/:type?/:category?/:page?', './ied'); router.get('/jwc/:category?/:page?', './jwc'); diff --git a/lib/routes/hunau/xky/index.js b/lib/routes/hunau/xky/index.js index d894546312aced..27b14da1533aae 100644 --- a/lib/routes/hunau/xky/index.js +++ b/lib/routes/hunau/xky/index.js @@ -1,6 +1,6 @@ const getContent = require('../utils/common'); -module.exports = async (ctx) => { +export default async (ctx) => { await getContent(ctx, { baseHost: 'https://xky.hunau.edu.cn', baseCategory: 'tzgg_8472', // 默认:通知公告 diff --git a/lib/routes/huoxian/router.js b/lib/routes/huoxian/router.js index 14597a162cab60..b7a7b66771a732 100644 --- a/lib/routes/huoxian/router.js +++ b/lib/routes/huoxian/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/zone', './zone'); }; diff --git a/lib/routes/huoxian/zone.js b/lib/routes/huoxian/zone.js index d0c301ffc113e6..5e7501a7906ed0 100644 --- a/lib/routes/huoxian/zone.js +++ b/lib/routes/huoxian/zone.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got('https://zone.huoxian.cn/api/discussions?sort=-createdAt'); const items = data.data.map((item) => ({ title: item.attributes.title, diff --git a/lib/routes/hupu/all.js b/lib/routes/hupu/all.js index 12956688190a0a..5f7ba7ef261ce1 100644 --- a/lib/routes/hupu/all.js +++ b/lib/routes/hupu/all.js @@ -6,7 +6,7 @@ import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'topic-daily'; const rootUrl = 'https://bbs.hupu.com'; diff --git a/lib/routes/hupu/bbs.js b/lib/routes/hupu/bbs.js index 2027e34b835073..180bdbb504bef0 100644 --- a/lib/routes/hupu/bbs.js +++ b/lib/routes/hupu/bbs.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '34'; const order = ctx.req.param('order') ?? '1'; diff --git a/lib/routes/hupu/index.js b/lib/routes/hupu/index.js index 1b904f2d8ef484..f2ce8a3cb8062b 100644 --- a/lib/routes/hupu/index.js +++ b/lib/routes/hupu/index.js @@ -19,7 +19,7 @@ const categories = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'soccer'; const rootUrl = 'https://m.hupu.com'; diff --git a/lib/routes/hupu/router.js b/lib/routes/hupu/router.js index 58021143b450b3..ac8e403fd7a854 100644 --- a/lib/routes/hupu/router.js +++ b/lib/routes/hupu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/all/:id?', './all'); router.get('/bbs/:id?/:order?', './bbs'); router.get('/bxj/:id?/:order?', './bbs'); diff --git a/lib/routes/hust/aia/news.js b/lib/routes/hust/aia/news.js index 00121e8fc8ad0e..10996518ca6d42 100755 --- a/lib/routes/hust/aia/news.js +++ b/lib/routes/hust/aia/news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://aia.hust.edu.cn/xyxw.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/hust/aia/notice.js b/lib/routes/hust/aia/notice.js index 912376a3642101..c4e3d96d4b1ad0 100755 --- a/lib/routes/hust/aia/notice.js +++ b/lib/routes/hust/aia/notice.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const baseUrl = 'https://aia.hust.edu.cn'; const link = `${baseUrl}/tzgg${type ? `/${type}` : ''}.htm`; diff --git a/lib/routes/hust/router.js b/lib/routes/hust/router.js index e7f706fe90e96e..5aa03896ff3ee1 100644 --- a/lib/routes/hust/router.js +++ b/lib/routes/hust/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/aia/news', './aia/news'); router.get('/aia/notice/:type?', './aia/notice'); router.get('/auto/news', './aia/news'); diff --git a/lib/routes/hust/yjs.js b/lib/routes/hust/yjs.js index 1c9fa39ce30d83..f3e071cfb608a4 100644 --- a/lib/routes/hust/yjs.js +++ b/lib/routes/hust/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://gszs.hust.edu.cn/zsxx/ggtz.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/huxiu/brief-column.js b/lib/routes/huxiu/brief-column.js index e34f8c26b1289b..f8e28ea921b217 100644 --- a/lib/routes/huxiu/brief-column.js +++ b/lib/routes/huxiu/brief-column.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { apiBriefRootUrl, processItems, fetchBriefColumnData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20; diff --git a/lib/routes/huxiu/channel.js b/lib/routes/huxiu/channel.js index f51b2123bc12cc..914878698059ab 100644 --- a/lib/routes/huxiu/channel.js +++ b/lib/routes/huxiu/channel.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { rootUrl, apiArticleRootUrl, processItems, fetchData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20; diff --git a/lib/routes/huxiu/club.js b/lib/routes/huxiu/club.js index 328171653a0106..dd0ae4889cd2d8 100644 --- a/lib/routes/huxiu/club.js +++ b/lib/routes/huxiu/club.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { apiBriefRootUrl, processItems, fetchClubData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20; diff --git a/lib/routes/huxiu/collection.js b/lib/routes/huxiu/collection.js index b6f67064c07528..3d1b53982136a6 100644 --- a/lib/routes/huxiu/collection.js +++ b/lib/routes/huxiu/collection.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { rootUrl, apiArticleRootUrl, processItems, fetchData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/huxiu/member.js b/lib/routes/huxiu/member.js index 509b3bee6b371f..b433771d176293 100644 --- a/lib/routes/huxiu/member.js +++ b/lib/routes/huxiu/member.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { rootUrl, apiMemberRootUrl, processItems, fetchData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, type = 'article' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/huxiu/moment.js b/lib/routes/huxiu/moment.js index 720de968c49c43..6326877ff940f5 100644 --- a/lib/routes/huxiu/moment.js +++ b/lib/routes/huxiu/moment.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { rootUrl, apiMomentRootUrl, processItems, fetchData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20; const apiUrl = new URL('web-v2/moment/feed', apiMomentRootUrl).href; diff --git a/lib/routes/huxiu/router.js b/lib/routes/huxiu/router.js index d1000769d935e3..b655315bffe317 100644 --- a/lib/routes/huxiu/router.js +++ b/lib/routes/huxiu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/article', './channel'); router.get('/author/:id/:type?', './member'); router.get('/briefcolumn/:id', './brief-column'); diff --git a/lib/routes/huxiu/search.js b/lib/routes/huxiu/search.js index 80d443044374f5..280e3844245917 100644 --- a/lib/routes/huxiu/search.js +++ b/lib/routes/huxiu/search.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { rootUrl, apiSearchRootUrl, generateSignature, processItems, fetchData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20; diff --git a/lib/routes/huxiu/tag.js b/lib/routes/huxiu/tag.js index 67101c42140e1c..a8e1c3f61f60dc 100644 --- a/lib/routes/huxiu/tag.js +++ b/lib/routes/huxiu/tag.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { rootUrl, processItems, fetchData } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/ianspriggs/index.js b/lib/routes/ianspriggs/index.js index 7162b570c01770..7f562e2136a30c 100644 --- a/lib/routes/ianspriggs/index.js +++ b/lib/routes/ianspriggs/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'portraits' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/ianspriggs/router.js b/lib/routes/ianspriggs/router.js index b610024188e52a..74ed533fca356e 100644 --- a/lib/routes/ianspriggs/router.js +++ b/lib/routes/ianspriggs/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './'); }; diff --git a/lib/routes/icac/news.js b/lib/routes/icac/news.js index 2995f05322ee94..8b3e367790f7f6 100644 --- a/lib/routes/icac/news.js +++ b/lib/routes/icac/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const BASE_WITH_LANG = utils.langBase(ctx.req.param('lang')); const res = await got.get(`${BASE_WITH_LANG}/press/index.html`); const $ = load(res.data); diff --git a/lib/routes/icac/router.js b/lib/routes/icac/router.js index 7aa8cbf99829de..d203e3a2515be7 100644 --- a/lib/routes/icac/router.js +++ b/lib/routes/icac/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:lang?', './news'); }; diff --git a/lib/routes/icbc/router.js b/lib/routes/icbc/router.js index de958e2e6cb021..11abba62a3f623 100644 --- a/lib/routes/icbc/router.js +++ b/lib/routes/icbc/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/whpj/:format?', './whpj'); }; diff --git a/lib/routes/icbc/whpj.js b/lib/routes/icbc/whpj.js index e1361a799b7949..69d65707a26487 100644 --- a/lib/routes/icbc/whpj.js +++ b/lib/routes/icbc/whpj.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { // yes, insecure // their openssl version isn't safe anyway (https://stackoverflow.com/questions/75763525/curl-35-error0a000152ssl-routinesunsafe-legacy-renegotiation-disabled) const { data } = await got('http://papi.icbc.com.cn/exchanges/ns/getLatest'); diff --git a/lib/routes/idolypride/news.js b/lib/routes/idolypride/news.js index eb868e8f71d93d..ff6325cf268f74 100644 --- a/lib/routes/idolypride/news.js +++ b/lib/routes/idolypride/news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://idolypride.jp/wp-json/wp/v2/news', diff --git a/lib/routes/idolypride/router.js b/lib/routes/idolypride/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/idolypride/router.js +++ b/lib/routes/idolypride/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/ieee-security/router.js b/lib/routes/ieee-security/router.js index ef86430f7769e0..6c66d4f1eff631 100644 --- a/lib/routes/ieee-security/router.js +++ b/lib/routes/ieee-security/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/security-privacy', './sp'); }; diff --git a/lib/routes/ieee-security/sp.js b/lib/routes/ieee-security/sp.js index 75448fd441bacf..388bd54460bf31 100644 --- a/lib/routes/ieee-security/sp.js +++ b/lib/routes/ieee-security/sp.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const url = 'https://www.ieee-security.org/'; // https://www.ieee-security.org/TC/SP2023/program-papers.html -module.exports = async (ctx) => { +export default async (ctx) => { const last = new Date().getFullYear() + 1; const urlList = Array.from({ length: last - 2020 }, (_, v) => `${url}TC/SP${v + 2020}/program-papers.html`); const responses = await got.all(urlList.map((url) => got(url))); diff --git a/lib/routes/ieee/earlyaccess.js b/lib/routes/ieee/earlyaccess.js index 498a19d9ded743..99aad48d168803 100644 --- a/lib/routes/ieee/earlyaccess.js +++ b/lib/routes/ieee/earlyaccess.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); -module.exports = async (ctx) => { +export default async (ctx) => { const isnumber = ctx.req.param('journal'); const sortType = ctx.req.param('sortType') ?? 'vol-only-seq'; const host = 'https://ieeexplore.ieee.org'; diff --git a/lib/routes/ieee/journal.js b/lib/routes/ieee/journal.js index 914a8bd29b0518..f0c4fae9b77e39 100644 --- a/lib/routes/ieee/journal.js +++ b/lib/routes/ieee/journal.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); -module.exports = async (ctx) => { +export default async (ctx) => { const punumber = ctx.req.param('journal'); const sortType = ctx.req.param('sortType') ?? 'vol-only-seq'; const host = 'https://ieeexplore.ieee.org'; diff --git a/lib/routes/ieee/recent.js b/lib/routes/ieee/recent.js index be56843c1d1f8d..8e12fa41b59552 100644 --- a/lib/routes/ieee/recent.js +++ b/lib/routes/ieee/recent.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); -module.exports = async (ctx) => { +export default async (ctx) => { const punumber = ctx.req.param('journal'); const sortType = ctx.req.param('sortType') ?? 'vol-only-seq'; const host = 'https://ieeexplore.ieee.org'; diff --git a/lib/routes/ieee/router.js b/lib/routes/ieee/router.js index 7f3e4b9550e48a..df7b9bfee9d8d3 100644 --- a/lib/routes/ieee/router.js +++ b/lib/routes/ieee/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/:journal/latest/vol/:sortType?', './journal'); // deprecated router.get('/:journal/latest/date/:sortType?', './recent'); // deprecated router.get('/journal/:journal/earlyaccess/:sortType?', './earlyaccess'); diff --git a/lib/routes/ielts/index.js b/lib/routes/ielts/index.js index 0b134468f94c15..6ccb03b763d02c 100644 --- a/lib/routes/ielts/index.js +++ b/lib/routes/ielts/index.js @@ -7,7 +7,7 @@ const targetUrl = 'https://ielts.neea.cn/allnews?locale=zh_CN'; import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const html = await cache.tryGet( targetUrl, async () => { diff --git a/lib/routes/ielts/router.js b/lib/routes/ielts/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/ielts/router.js +++ b/lib/routes/ielts/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/ifeng/feng.js b/lib/routes/ifeng/feng.js index 8e652a20f354f2..3b711e32aea6aa 100644 --- a/lib/routes/ifeng/feng.js +++ b/lib/routes/ifeng/feng.js @@ -5,7 +5,7 @@ const { extractDoc, renderVideo } = require('./utils'); import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id, type } = ctx.req.param(); const { data: userResponse } = await got(`https://ishare.ifeng.com/mediaShare/home/${id}/media`, { headers: { diff --git a/lib/routes/ifeng/news.js b/lib/routes/ifeng/news.js index 005e54c7c278cf..278d52cf38fc6d 100644 --- a/lib/routes/ifeng/news.js +++ b/lib/routes/ifeng/news.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; const rootUrl = 'https://news.ifeng.com'; diff --git a/lib/routes/ifeng/router.js b/lib/routes/ifeng/router.js index e4fcfeadb8e650..cd224994e71e38 100644 --- a/lib/routes/ifeng/router.js +++ b/lib/routes/ifeng/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/feng/:id/:type', './feng'); router.get('/news/*', './news'); }; diff --git a/lib/routes/ifi-audio/download.js b/lib/routes/ifi-audio/download.js index 26069db728899a..a62a3f5e1a7ac4 100644 --- a/lib/routes/ifi-audio/download.js +++ b/lib/routes/ifi-audio/download.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const host = 'https://ifi-audio.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { val, id } = ctx.req.param(); const url = host + '/wp-admin/admin-ajax.php'; diff --git a/lib/routes/ifi-audio/router.js b/lib/routes/ifi-audio/router.js index a1e6e41487292d..c17992cb88a0f1 100644 --- a/lib/routes/ifi-audio/router.js +++ b/lib/routes/ifi-audio/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/download/:val/:id', './download'); }; diff --git a/lib/routes/iguoguo/index.js b/lib/routes/iguoguo/index.js index 24324eaaf98eb0..ce10d89ade9ea2 100644 --- a/lib/routes/iguoguo/index.js +++ b/lib/routes/iguoguo/index.js @@ -22,7 +22,7 @@ const getComments = (a, node) => { } }; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = rootUrl.concat('/html5'); const response = await got({ method: 'get', diff --git a/lib/routes/iguoguo/router.js b/lib/routes/iguoguo/router.js index 0276165aabd73e..b955ceb8943084 100644 --- a/lib/routes/iguoguo/router.js +++ b/lib/routes/iguoguo/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/html5', './index'); }; diff --git a/lib/routes/iiilab/index.js b/lib/routes/iiilab/index.js index 9e732de795773b..9ea0a4522328ea 100644 --- a/lib/routes/iiilab/index.js +++ b/lib/routes/iiilab/index.js @@ -1,7 +1,7 @@ import buildData from '@/utils/common-config'; const baseUrl = 'https://www.iiilab.com/'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = baseUrl; ctx.set( 'data', diff --git a/lib/routes/iiilab/router.js b/lib/routes/iiilab/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/iiilab/router.js +++ b/lib/routes/iiilab/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/ikea/cn/family-offers.js b/lib/routes/ikea/cn/family-offers.js index 0b9d1469741c99..b9634b1a96f541 100644 --- a/lib/routes/ikea/cn/family-offers.js +++ b/lib/routes/ikea/cn/family-offers.js @@ -32,7 +32,7 @@ const productRequest = async (productIds) => { return response.data; }; -module.exports = async (ctx) => { +export default async (ctx) => { const familyPriceProductIds = []; const productRequests = []; diff --git a/lib/routes/ikea/cn/low-price.js b/lib/routes/ikea/cn/low-price.js index db5a944cdbb10a..890c7d05d816ad 100644 --- a/lib/routes/ikea/cn/low-price.js +++ b/lib/routes/ikea/cn/low-price.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { generateRequestHeaders, generateProductItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ url: 'https://srv.app.ikea.cn/content/recommendation/v2/product-group/products', headers: generateRequestHeaders(), diff --git a/lib/routes/ikea/cn/new.js b/lib/routes/ikea/cn/new.js index 467f8ea3eba3ad..9b74856290bbfd 100644 --- a/lib/routes/ikea/cn/new.js +++ b/lib/routes/ikea/cn/new.js @@ -13,7 +13,7 @@ const request = ({ moreToken = '' }) => json: {}, }); -module.exports = async (ctx) => { +export default async (ctx) => { const allProductSummaries = []; const loadMoreRequest = async ({ moreToken }) => { diff --git a/lib/routes/ikea/gb/new.js b/lib/routes/ikea/gb/new.js index 40599d8c13321e..5a5a375f610e2b 100644 --- a/lib/routes/ikea/gb/new.js +++ b/lib/routes/ikea/gb/new.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.ikea.com/gb/en/new/new-products/'; const { diff --git a/lib/routes/ikea/gb/offer.js b/lib/routes/ikea/gb/offer.js index 7ffda32d415933..6d5100e5cf1cab 100644 --- a/lib/routes/ikea/gb/offer.js +++ b/lib/routes/ikea/gb/offer.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.ikea.com/gb/en/offers/'; const response = await got(link); diff --git a/lib/routes/ikea/router.js b/lib/routes/ikea/router.js index a07e87de548621..7fddc4a21fb13a 100644 --- a/lib/routes/ikea/router.js +++ b/lib/routes/ikea/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/cn/family_offers', './cn/family-offers'); router.get('/cn/low_price', './cn/low-price'); router.get('/cn/new', './cn/new'); diff --git a/lib/routes/imagemagick/changelog.js b/lib/routes/imagemagick/changelog.js index 863a60317ee615..e2d4264bab1ce5 100644 --- a/lib/routes/imagemagick/changelog.js +++ b/lib/routes/imagemagick/changelog.js @@ -5,7 +5,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://imagemagick.org'; const currentUrl = `${rootUrl}/script/download.php`; const logUrl = 'https://github.com/ImageMagick/Website/blob/main/ChangeLog.md'; diff --git a/lib/routes/imagemagick/router.js b/lib/routes/imagemagick/router.js index d64ff962870d8a..697b95cbdea2b4 100644 --- a/lib/routes/imagemagick/router.js +++ b/lib/routes/imagemagick/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/changelog', './changelog'); }; diff --git a/lib/routes/imiker/jinghua.js b/lib/routes/imiker/jinghua.js index 6ca55578611033..4951f8a8098bf6 100644 --- a/lib/routes/imiker/jinghua.js +++ b/lib/routes/imiker/jinghua.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; const rootUrl = 'https://ask.imiker.com'; diff --git a/lib/routes/imiker/router.js b/lib/routes/imiker/router.js index f6fc62813796e2..e0393787aa17d3 100644 --- a/lib/routes/imiker/router.js +++ b/lib/routes/imiker/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/ask/jinghua', './jinghua'); }; diff --git a/lib/routes/indiansinkuwait/latest.js b/lib/routes/indiansinkuwait/latest.js index 787a77c58dd244..55a2d8b8086a0b 100644 --- a/lib/routes/indiansinkuwait/latest.js +++ b/lib/routes/indiansinkuwait/latest.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.indiansinkuwait.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got(`${baseUrl}/latest-news`); const $ = load(response); diff --git a/lib/routes/indiansinkuwait/router.js b/lib/routes/indiansinkuwait/router.js index d9d312e16f77d1..cd57ba05cfc495 100644 --- a/lib/routes/indiansinkuwait/router.js +++ b/lib/routes/indiansinkuwait/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/latest', './latest'); }; diff --git a/lib/routes/indienova/article.js b/lib/routes/indienova/article.js index 3a2886d51616ad..1d64bf79bfac62 100644 --- a/lib/routes/indienova/article.js +++ b/lib/routes/indienova/article.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let link = 'https://indienova.com/indie-game-news/'; if (type === 'development') { diff --git a/lib/routes/indienova/column.js b/lib/routes/indienova/column.js index da0c805a7a424e..09d72d4e633946 100644 --- a/lib/routes/indienova/column.js +++ b/lib/routes/indienova/column.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl, parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const columnId = ctx.req.param('columnId'); const { data: response, url: link } = await got(`${baseUrl}/column/${columnId}`); diff --git a/lib/routes/indienova/gamedb.js b/lib/routes/indienova/gamedb.js index ad6ea6748a2e78..2d3745039ef163 100644 --- a/lib/routes/indienova/gamedb.js +++ b/lib/routes/indienova/gamedb.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const { platform = 'all' } = ctx.req.param(); const baseUrl = 'https://indienova.com'; diff --git a/lib/routes/indienova/router.js b/lib/routes/indienova/router.js index d7e9110a42bf8e..388de398bcce98 100644 --- a/lib/routes/indienova/router.js +++ b/lib/routes/indienova/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/column/:columnId', './column'); router.get('/gamedb/recent', './gamedb'); router.get('/usergames', './usergames'); diff --git a/lib/routes/indienova/usergames.js b/lib/routes/indienova/usergames.js index 8a72edb9fac2b0..b794ee51d5fca5 100644 --- a/lib/routes/indienova/usergames.js +++ b/lib/routes/indienova/usergames.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://indienova.com'; const { data: response, url: link } = await got(`${baseUrl}/usergames`); diff --git a/lib/routes/inewsweek/index.js b/lib/routes/inewsweek/index.js index d38e76c483ed65..8f32f718aa2ded 100644 --- a/lib/routes/inewsweek/index.js +++ b/lib/routes/inewsweek/index.js @@ -7,7 +7,7 @@ const iconv = require('iconv-lite'); const rootUrl = 'http://news.inewsweek.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const url = `${rootUrl}/${channel}`; const response = await got(url, { diff --git a/lib/routes/inewsweek/router.js b/lib/routes/inewsweek/router.js index 9a393dde67d815..2a73869aae89b4 100644 --- a/lib/routes/inewsweek/router.js +++ b/lib/routes/inewsweek/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:channel', './index'); }; diff --git a/lib/routes/infoq/recommend.js b/lib/routes/infoq/recommend.js index f568f88fd1f3f1..1d79036a3ab4c9 100644 --- a/lib/routes/infoq/recommend.js +++ b/lib/routes/infoq/recommend.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const apiUrl = 'https://www.infoq.cn/public/v1/my/recommond'; const pageUrl = 'https://www.infoq.cn'; diff --git a/lib/routes/infoq/router.js b/lib/routes/infoq/router.js index 69bd6d2f752129..aeb257dc6e1b34 100644 --- a/lib/routes/infoq/router.js +++ b/lib/routes/infoq/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/recommend', './recommend'); router.get('/topic/:id', './topic'); }; diff --git a/lib/routes/infoq/topic.js b/lib/routes/infoq/topic.js index 086a1ff25dbe54..72955ecfe442a0 100644 --- a/lib/routes/infoq/topic.js +++ b/lib/routes/infoq/topic.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const paramId = ctx.req.param('id'); const apiUrl = 'https://www.infoq.cn/public/v1/article/getList'; const infoUrl = 'https://www.infoq.cn/public/v1/topic/getInfo'; diff --git a/lib/routes/informs/index.js b/lib/routes/informs/index.js index 4994a02721f0a3..52f48352955d46 100644 --- a/lib/routes/informs/index.js +++ b/lib/routes/informs/index.js @@ -8,7 +8,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://pubsonline.informs.org'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'orsc'; const cateUrl = `${rootUrl}/toc/${category}/0/0`; diff --git a/lib/routes/informs/router.js b/lib/routes/informs/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/informs/router.js +++ b/lib/routes/informs/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/inoreader/index.js b/lib/routes/inoreader/index.js index c931f9a941d282..3967b5136ebf71 100644 --- a/lib/routes/inoreader/index.js +++ b/lib/routes/inoreader/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = 'html'; const user = ctx.req.param('user'); const tag = ctx.req.param('tag'); diff --git a/lib/routes/inoreader/router.js b/lib/routes/inoreader/router.js index c772bba02ade1a..ab15edb6d20cc8 100644 --- a/lib/routes/inoreader/router.js +++ b/lib/routes/inoreader/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/html_clip/:user/:tag', './index'); router.get('/rss/:user/:tag', './rss'); }; diff --git a/lib/routes/inoreader/rss.js b/lib/routes/inoreader/rss.js index 0e35b11943d4e3..a945b34e9dc6ff 100644 --- a/lib/routes/inoreader/rss.js +++ b/lib/routes/inoreader/rss.js @@ -1,7 +1,7 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const tag = ctx.req.param('tag'); const rootUrl = 'https://www.inoreader.com/stream'; diff --git a/lib/routes/instagram/private-api/index.js b/lib/routes/instagram/private-api/index.js index 84b72e35b79d0f..a43bc2f5513958 100644 --- a/lib/routes/instagram/private-api/index.js +++ b/lib/routes/instagram/private-api/index.js @@ -54,7 +54,7 @@ async function loadContent(category, nameOrId, tryGet) { }; } -module.exports = async (ctx) => { +export default async (ctx) => { // https://github.com/dilame/instagram-private-api#feeds // const availableCategories = ["accountFollowers", "accountFollowing", "news", // "discover", "pendingFriendships", "blockedUsers", "directInbox", "directPending", diff --git a/lib/routes/instagram/router.js b/lib/routes/instagram/router.js index 602471cddfb027..8d52ec0093b8f4 100644 --- a/lib/routes/instagram/router.js +++ b/lib/routes/instagram/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category/:key', './private-api/index'); router.get('/2/:category/:key', './web-api/index'); }; diff --git a/lib/routes/instagram/web-api/index.js b/lib/routes/instagram/web-api/index.js index 05bc02d8933b8e..ca3f669d7d270d 100644 --- a/lib/routes/instagram/web-api/index.js +++ b/lib/routes/instagram/web-api/index.js @@ -4,7 +4,7 @@ import { config } from '@/config'; const { renderItems } = require('../common-utils'); const { baseUrl, COOKIE_URL, checkLogin, getUserInfo, getUserFeedItems, getTagsFeedItems, getLoggedOutTagsFeedItems, renderGuestItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { // if (!config.instagram || !config.instagram.cookie) { // throw Error('Instagram RSS is disabled due to the lack of relevant config'); // } diff --git a/lib/routes/instructables/projects.js b/lib/routes/instructables/projects.js index 7bcd1bfcaf4bb3..36b811c725bfee 100644 --- a/lib/routes/instructables/projects.js +++ b/lib/routes/instructables/projects.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'all'; const siteDomain = 'www.instructables.com'; diff --git a/lib/routes/instructables/router.js b/lib/routes/instructables/router.js index c0b52cc9e4a024..bfb67f4af8b62d 100644 --- a/lib/routes/instructables/router.js +++ b/lib/routes/instructables/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/projects/:category?', './projects'); }; diff --git a/lib/routes/iqilu/program.js b/lib/routes/iqilu/program.js index 99210833cf801e..d76c1d18c3fa57 100644 --- a/lib/routes/iqilu/program.js +++ b/lib/routes/iqilu/program.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'sdws/sdxwlb' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/iqilu/router.js b/lib/routes/iqilu/router.js index f9ff01f01fcd24..d990c6707e13dd 100644 --- a/lib/routes/iqilu/router.js +++ b/lib/routes/iqilu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/v/:category*', './program'); }; diff --git a/lib/routes/iqiyi/album.js b/lib/routes/iqiyi/album.js index b3428a9bd6cd3d..55afd85684fbfe 100644 --- a/lib/routes/iqiyi/album.js +++ b/lib/routes/iqiyi/album.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { data: response } = await got(`https://www.iq.com/album/${id}`); diff --git a/lib/routes/iqiyi/router.js b/lib/routes/iqiyi/router.js index 924e4499fe79c7..eee0f746ef9d17 100644 --- a/lib/routes/iqiyi/router.js +++ b/lib/routes/iqiyi/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/album/:id', './album'); router.get('/user/video/:uid', './video'); }; diff --git a/lib/routes/iqiyi/video.js b/lib/routes/iqiyi/video.js index 73445484d956c6..eaed7032aed669 100644 --- a/lib/routes/iqiyi/video.js +++ b/lib/routes/iqiyi/video.js @@ -7,7 +7,7 @@ import puppeteer from '@/utils/puppeteer'; // /iqiyi/user/video/:uid // http://localhost:1200/iqiyi/user/video/2289191062 -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const link = `https://www.iqiyi.com/u/${uid}/videos`; diff --git a/lib/routes/iqnew/latest.js b/lib/routes/iqnew/latest.js index 43384b2a0e86fc..9d8677fa1bd460 100644 --- a/lib/routes/iqnew/latest.js +++ b/lib/routes/iqnew/latest.js @@ -5,7 +5,7 @@ const iconv = require('iconv-lite'); import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.iqnew.com'; const url = rootUrl + '/post/new_100/'; const response = await got({ diff --git a/lib/routes/iqnew/router.js b/lib/routes/iqnew/router.js index d9d312e16f77d1..cd57ba05cfc495 100644 --- a/lib/routes/iqnew/router.js +++ b/lib/routes/iqnew/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/latest', './latest'); }; diff --git a/lib/routes/iresearch/report.js b/lib/routes/iresearch/report.js index de03d5e6269aa2..7293e1b6af2948 100644 --- a/lib/routes/iresearch/report.js +++ b/lib/routes/iresearch/report.js @@ -28,7 +28,7 @@ function processReport(item) { return description; } -module.exports = async (ctx) => { +export default async (ctx) => { const limit = isNaN(Number.parseInt(ctx.req.query('limit'))) ? 20 : Number.parseInt(ctx.req.query('limit')); const apiUrl = `https://www.iresearch.com.cn/api/products/GetReportList?fee=0&date=&lastId=&pageSize=${limit}`; const pageUrl = 'https://www.iresearch.com.cn/m/report.shtml'; diff --git a/lib/routes/iresearch/router.js b/lib/routes/iresearch/router.js index 4d8ca88b012aa6..d094047d32de4f 100644 --- a/lib/routes/iresearch/router.js +++ b/lib/routes/iresearch/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/report', './report'); router.get('/weekly/:category?', './weekly'); }; diff --git a/lib/routes/iresearch/weekly.js b/lib/routes/iresearch/weekly.js index 8e4c2d151e1c35..eea2a1e713027d 100644 --- a/lib/routes/iresearch/weekly.js +++ b/lib/routes/iresearch/weekly.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://www.iresearch.com.cn'; diff --git a/lib/routes/issuehunt/funded.js b/lib/routes/issuehunt/funded.js index a3c07644d2ca9f..44771e9f69def7 100644 --- a/lib/routes/issuehunt/funded.js +++ b/lib/routes/issuehunt/funded.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const MarkdownIt = require('markdown-it'); -module.exports = async (ctx) => { +export default async (ctx) => { const { username, repo } = ctx.req.param(); const response = await got(`https://issuehunt.io/apis/pages/repos/show?repositoryOwnerName=${username}&repositoryName=${repo}`); diff --git a/lib/routes/issuehunt/router.js b/lib/routes/issuehunt/router.js index 1ba0ab1cd2b6ce..ced85d7aaf74ee 100644 --- a/lib/routes/issuehunt/router.js +++ b/lib/routes/issuehunt/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/funded/:username/:repo', './funded'); }; diff --git a/lib/routes/itch/devlog.js b/lib/routes/itch/devlog.js index fe588c567549e9..7f3a139426d950 100644 --- a/lib/routes/itch/devlog.js +++ b/lib/routes/itch/devlog.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user') ?? ''; const id = ctx.req.param('id') ?? ''; if (!isValidHost(user)) { diff --git a/lib/routes/itch/index.js b/lib/routes/itch/index.js index df89ff1e721be6..554f9312ce8bc8 100644 --- a/lib/routes/itch/index.js +++ b/lib/routes/itch/index.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://itch.io'; const currentUrl = `${rootUrl}${getSubPath(ctx)}`; diff --git a/lib/routes/itch/posts.js b/lib/routes/itch/posts.js index 33d043323ab15a..a1eb78ac287dba 100644 --- a/lib/routes/itch/posts.js +++ b/lib/routes/itch/posts.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const topic = ctx.req.param('topic'); const id = ctx.req.param('id'); diff --git a/lib/routes/itch/router.js b/lib/routes/itch/router.js index 2fb5aa865a036b..24de8cf602dd1c 100644 --- a/lib/routes/itch/router.js +++ b/lib/routes/itch/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/devlog/:user/:id', './devlog'); router.get('/posts/:topic/:id', './posts'); router.get('*', './index'); diff --git a/lib/routes/ithome/index.js b/lib/routes/ithome/index.js index 7085099a7f0881..9ee728e52eb726 100644 --- a/lib/routes/ithome/index.js +++ b/lib/routes/ithome/index.js @@ -34,7 +34,7 @@ const config = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const cfg = config[ctx.req.param('caty')]; if (!cfg) { throw new Error('Bad category. See https://docs.rsshub.app/routes/new-media#it-zhi-jia'); diff --git a/lib/routes/ithome/ranking.js b/lib/routes/ithome/ranking.js index 010da5c286927f..25c9c2e9a2b02f 100644 --- a/lib/routes/ithome/ranking.js +++ b/lib/routes/ithome/ranking.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const option = ctx.req.param('type'); const response = await got({ diff --git a/lib/routes/ithome/router.js b/lib/routes/ithome/router.js index f0e50e36b28618..23d00f49ec9b31 100644 --- a/lib/routes/ithome/router.js +++ b/lib/routes/ithome/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/ranking/:type', './ranking'); router.get('/tag/:name', './tag'); router.get('/tw/feeds/:category', './tw/feeds'); diff --git a/lib/routes/ithome/tag.js b/lib/routes/ithome/tag.js index 38105b5037135b..de6203069ea079 100644 --- a/lib/routes/ithome/tag.js +++ b/lib/routes/ithome/tag.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.ithome.com/'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const url = `${rootUrl}tag/${name}`; diff --git a/lib/routes/ithome/tw/feeds.js b/lib/routes/ithome/tw/feeds.js index 859b11bd430f2b..fae8f19feb57e6 100644 --- a/lib/routes/ithome/tw/feeds.js +++ b/lib/routes/ithome/tw/feeds.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.ithome.com.tw'; const currentUrl = `${baseUrl}/${ctx.req.param('category')}/feeds`; const response = await got(currentUrl); diff --git a/lib/routes/ithome/zt.js b/lib/routes/ithome/zt.js index e730a4338237f7..e74caaace64005 100644 --- a/lib/routes/ithome/zt.js +++ b/lib/routes/ithome/zt.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://www.ithome.com'; diff --git a/lib/routes/iwara/index.js b/lib/routes/iwara/index.js index 214d9915960561..9495645f72ed98 100644 --- a/lib/routes/iwara/index.js +++ b/lib/routes/iwara/index.js @@ -35,7 +35,7 @@ const parseThumbnail = (type, item) => { return ''; }; -module.exports = async (ctx) => { +export default async (ctx) => { const username = ctx.req.param('username'); const id = await cache.tryGet(`${apiRootUrl}/profile/${username}`, async () => (await got(`${apiRootUrl}/profile/${username}`)).data.user.id); const type = ctx.req.param('type') ?? 'video'; diff --git a/lib/routes/iwara/router.js b/lib/routes/iwara/router.js index 5864ba990881d5..993f10b5d67510 100644 --- a/lib/routes/iwara/router.js +++ b/lib/routes/iwara/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/users/:username?/:type?', './index'); router.get('/subscriptions', './subscriptions'); }; diff --git a/lib/routes/iwara/subscriptions.js b/lib/routes/iwara/subscriptions.js index cf93ad55b79b8c..38a01318c71b3e 100644 --- a/lib/routes/iwara/subscriptions.js +++ b/lib/routes/iwara/subscriptions.js @@ -8,7 +8,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.iwara || !config.iwara.username || !config.iwara.password) { throw new Error('Iwara subscription RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/ixigua/router.js b/lib/routes/ixigua/router.js index 1787a9d524a397..2e9264acb1b0a2 100644 --- a/lib/routes/ixigua/router.js +++ b/lib/routes/ixigua/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/user/video/:uid/:disableEmbed?', './user-video'); }; diff --git a/lib/routes/ixigua/user-video.js b/lib/routes/ixigua/user-video.js index 35a6c5d36f548b..049b7e943b5eeb 100644 --- a/lib/routes/ixigua/user-video.js +++ b/lib/routes/ixigua/user-video.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'https://www.ixigua.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const disableEmbed = ctx.req.param('disableEmbed'); const url = `${host}/home/${uid}/?wid_try=1`; diff --git a/lib/routes/jandan/index.js b/lib/routes/jandan/index.js index 0e6a6b7ac4fe30..4cc0fd443bc508 100644 --- a/lib/routes/jandan/index.js +++ b/lib/routes/jandan/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import parser from '@/utils/rss-parser'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://i.jandan.net'; const feed = await parser.parseURL(`${rootUrl}/feed/`); const items = await Promise.all( diff --git a/lib/routes/jandan/router.js b/lib/routes/jandan/router.js index 7f4ba29851aefa..b4779feafa6482 100644 --- a/lib/routes/jandan/router.js +++ b/lib/routes/jandan/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category', './section'); router.get('/', './index'); }; diff --git a/lib/routes/jandan/section.js b/lib/routes/jandan/section.js index 09374d834ca921..7e8803ba6bd556 100644 --- a/lib/routes/jandan/section.js +++ b/lib/routes/jandan/section.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'top'; const rootUrl = 'http://i.jandan.net'; diff --git a/lib/routes/japanpost/router.js b/lib/routes/japanpost/router.js index ff8832e952d923..fb3536651196f4 100644 --- a/lib/routes/japanpost/router.js +++ b/lib/routes/japanpost/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/track/:reqCode/:locale?', './track'); }; diff --git a/lib/routes/japanpost/track.js b/lib/routes/japanpost/track.js index c7874d3032216f..0624a076f14ba6 100644 --- a/lib/routes/japanpost/track.js +++ b/lib/routes/japanpost/track.js @@ -7,7 +7,7 @@ const utils = require('./utils'); let baseTitle = '日本郵便'; const baseUrl = 'https://trackings.post.japanpost.jp/services/srv/search/direct?'; -module.exports = async (ctx) => { +export default async (ctx) => { const reqCode = ctx.req.param('reqCode'); const reqReqCode = 'reqCodeNo1=' + reqCode; diff --git a/lib/routes/javbus/index.js b/lib/routes/javbus/index.js index bb615ead602d15..310cd5b9def255 100644 --- a/lib/routes/javbus/index.js +++ b/lib/routes/javbus/index.js @@ -14,7 +14,7 @@ const toSize = (raw) => { const allowDomain = new Set(['javbus.com', 'javbus.org', 'javsee.icu', 'javsee.one']); -module.exports = async (ctx) => { +export default async (ctx) => { const isWestern = /^\/western/.test(getSubPath(ctx)); const domain = ctx.req.query('domain') ?? 'javbus.com'; const westernDomain = ctx.req.query('western_domain') ?? 'javbus.org'; diff --git a/lib/routes/javbus/router.js b/lib/routes/javbus/router.js index f54c509e0ca884..6f45ba54b7681a 100644 --- a/lib/routes/javbus/router.js +++ b/lib/routes/javbus/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/javdb/actors.js b/lib/routes/javdb/actors.js index 766340e99cd115..240999c4068e3a 100644 --- a/lib/routes/javdb/actors.js +++ b/lib/routes/javdb/actors.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const filter = ctx.req.param('filter') ?? ''; diff --git a/lib/routes/javdb/index.js b/lib/routes/javdb/index.js index 7f38440e0b7d63..8dbb49c65d4040 100644 --- a/lib/routes/javdb/index.js +++ b/lib/routes/javdb/index.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'censored'; const sort = ctx.req.param('sort') ?? '2'; const filter = ctx.req.param('filter') ?? '1'; diff --git a/lib/routes/javdb/lists.js b/lib/routes/javdb/lists.js index ac0ad463832dcc..454f9c7c6a9152 100644 --- a/lib/routes/javdb/lists.js +++ b/lib/routes/javdb/lists.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const filter = ctx.req.param('filter') ?? ''; const sort = ctx.req.param('sort') ?? '0'; diff --git a/lib/routes/javdb/makers.js b/lib/routes/javdb/makers.js index 43285a0424c0da..70e56cdac00245 100644 --- a/lib/routes/javdb/makers.js +++ b/lib/routes/javdb/makers.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const filter = ctx.req.param('filter') ?? ''; diff --git a/lib/routes/javdb/rankings.js b/lib/routes/javdb/rankings.js index 105f33a68c0f6b..295d44a0c5eb27 100644 --- a/lib/routes/javdb/rankings.js +++ b/lib/routes/javdb/rankings.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'censored'; const time = ctx.req.param('time') ?? 'daily'; diff --git a/lib/routes/javdb/router.js b/lib/routes/javdb/router.js index 5ea30b99be3e05..88b4fc1b3c357d 100644 --- a/lib/routes/javdb/router.js +++ b/lib/routes/javdb/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/actors/:id/:filter?', './actors'); router.get('/home/:category?/:sort?/:filter?', './index'); router.get('/lists/:id/:filter?/:sort?', './lists'); diff --git a/lib/routes/javdb/search.js b/lib/routes/javdb/search.js index 3821585a5720c7..9ce1cdeed5ef01 100644 --- a/lib/routes/javdb/search.js +++ b/lib/routes/javdb/search.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const filter = ctx.req.param('filter') ?? ''; const keyword = ctx.req.param('keyword') ?? ''; const sort = ctx.req.param('sort') ?? '0'; diff --git a/lib/routes/javdb/series.js b/lib/routes/javdb/series.js index 768598ae29f5ab..f00c5a571dc670 100644 --- a/lib/routes/javdb/series.js +++ b/lib/routes/javdb/series.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const filter = ctx.req.param('filter') ?? ''; diff --git a/lib/routes/javdb/tags.js b/lib/routes/javdb/tags.js index 03f7dc9595ce30..a4c75e439b8553 100644 --- a/lib/routes/javdb/tags.js +++ b/lib/routes/javdb/tags.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'censored'; const query = ctx.req.param('query') ?? ''; diff --git a/lib/routes/javlibrary/bestrated.js b/lib/routes/javlibrary/bestrated.js index 32a30eb2e9f1e4..8c385682625064 100644 --- a/lib/routes/javlibrary/bestrated.js +++ b/lib/routes/javlibrary/bestrated.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultMode, defaultLanguage, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const mode = ctx.req.param('mode') ?? defaultMode; const language = ctx.req.param('language') ?? defaultLanguage; const currentUrl = `${rootUrl}/${language}/vl_bestrated.php?list&mode=${mode}`; diff --git a/lib/routes/javlibrary/bestreviews.js b/lib/routes/javlibrary/bestreviews.js index 8d94e46e38b45b..12883c472150bc 100644 --- a/lib/routes/javlibrary/bestreviews.js +++ b/lib/routes/javlibrary/bestreviews.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultMode, defaultLanguage, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const mode = ctx.req.param('mode') ?? defaultMode; const language = ctx.req.param('language') ?? defaultLanguage; const currentUrl = `${rootUrl}/${language}/tl_bestreviews.php?list&mode=${mode}`; diff --git a/lib/routes/javlibrary/genre.js b/lib/routes/javlibrary/genre.js index 986b27368fe3ca..d1c6844dfe82e3 100644 --- a/lib/routes/javlibrary/genre.js +++ b/lib/routes/javlibrary/genre.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultMode, defaultGenre, defaultLanguage, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const mode = ctx.req.param('mode') ?? defaultMode; const genre = ctx.req.param('genre') ?? defaultGenre; const language = ctx.req.param('language') ?? defaultLanguage; diff --git a/lib/routes/javlibrary/maker.js b/lib/routes/javlibrary/maker.js index ad9cda1caae8e8..371949514d748b 100644 --- a/lib/routes/javlibrary/maker.js +++ b/lib/routes/javlibrary/maker.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultMode, defaultLanguage, defaultMaker, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const mode = ctx.req.param('mode') ?? defaultMode; const maker = ctx.req.param('maker') ?? defaultMaker; const language = ctx.req.param('language') ?? defaultLanguage; diff --git a/lib/routes/javlibrary/mostwanted.js b/lib/routes/javlibrary/mostwanted.js index fa7acfdd29974d..999fb13dd1effd 100644 --- a/lib/routes/javlibrary/mostwanted.js +++ b/lib/routes/javlibrary/mostwanted.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultMode, defaultLanguage, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const mode = ctx.req.param('mode') ?? defaultMode; const language = ctx.req.param('language') ?? defaultLanguage; const currentUrl = `${rootUrl}/${language}/vl_mostwanted.php?list&mode=${mode}`; diff --git a/lib/routes/javlibrary/newentries.js b/lib/routes/javlibrary/newentries.js index 1c10f0359f9339..bf91ba9d7af608 100644 --- a/lib/routes/javlibrary/newentries.js +++ b/lib/routes/javlibrary/newentries.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultLanguage, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? defaultLanguage; const currentUrl = `${rootUrl}/${language}/vl_newentries.php?list`; diff --git a/lib/routes/javlibrary/newrelease.js b/lib/routes/javlibrary/newrelease.js index 403a01718240e8..d968098c3c2e63 100644 --- a/lib/routes/javlibrary/newrelease.js +++ b/lib/routes/javlibrary/newrelease.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultMode, defaultLanguage, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const mode = ctx.req.param('mode') ?? defaultMode; const language = ctx.req.param('language') ?? defaultLanguage; const currentUrl = `${rootUrl}/${language}/vl_newrelease.php?list&mode=${mode}`; diff --git a/lib/routes/javlibrary/router.js b/lib/routes/javlibrary/router.js index cc5cfa4b7d76fc..ad229909c9c215 100644 --- a/lib/routes/javlibrary/router.js +++ b/lib/routes/javlibrary/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/users/:id/:type/:language?', './user'); router.get('/videos/bestrated/:language?/:mode?', './bestrated'); router.get('/videos/genre/:genre?/:language?/:mode?', './genre'); diff --git a/lib/routes/javlibrary/star.js b/lib/routes/javlibrary/star.js index f326f3aa6f66dd..da57053991eb77 100644 --- a/lib/routes/javlibrary/star.js +++ b/lib/routes/javlibrary/star.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultMode, defaultLanguage, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const mode = ctx.req.param('mode') ?? defaultMode; const language = ctx.req.param('language') ?? defaultLanguage; diff --git a/lib/routes/javlibrary/update.js b/lib/routes/javlibrary/update.js index 4794c732351ee7..296e1908df5cf3 100644 --- a/lib/routes/javlibrary/update.js +++ b/lib/routes/javlibrary/update.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultLanguage, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? defaultLanguage; const currentUrl = `${rootUrl}/${language}/vl_update.php?list`; diff --git a/lib/routes/javlibrary/user.js b/lib/routes/javlibrary/user.js index cea772666c7ab2..85514cc7ca56f3 100644 --- a/lib/routes/javlibrary/user.js +++ b/lib/routes/javlibrary/user.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { defaultLanguage, rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const type = ctx.req.param('type'); const language = ctx.req.param('language') ?? defaultLanguage; diff --git a/lib/routes/jd/price.js b/lib/routes/jd/price.js index 72c245939acb1e..a71ae8b54ec98a 100644 --- a/lib/routes/jd/price.js +++ b/lib/routes/jd/price.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://item.jd.com'; diff --git a/lib/routes/jd/router.js b/lib/routes/jd/router.js index 1353c16bf4c57d..0e9d6f8aba0b6d 100644 --- a/lib/routes/jd/router.js +++ b/lib/routes/jd/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/price/:id', './price'); }; diff --git a/lib/routes/jewishmuseum/exhibitions.js b/lib/routes/jewishmuseum/exhibitions.js index f0db73acec283d..57c059f1ece1d6 100644 --- a/lib/routes/jewishmuseum/exhibitions.js +++ b/lib/routes/jewishmuseum/exhibitions.js @@ -1,6 +1,6 @@ import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://thejewishmuseum.org/exhibitions'; ctx.set( diff --git a/lib/routes/jewishmuseum/router.js b/lib/routes/jewishmuseum/router.js index 3a5dd943c689cb..5876eb54144613 100644 --- a/lib/routes/jewishmuseum/router.js +++ b/lib/routes/jewishmuseum/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/exhibitions', './exhibitions'); }; diff --git a/lib/routes/jianshu/collection.js b/lib/routes/jianshu/collection.js index fd3198d29583b2..d54a4959d887f6 100644 --- a/lib/routes/jianshu/collection.js +++ b/lib/routes/jianshu/collection.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got({ diff --git a/lib/routes/jianshu/home.js b/lib/routes/jianshu/home.js index a8b088bcee5373..f50ec4559d5a98 100644 --- a/lib/routes/jianshu/home.js +++ b/lib/routes/jianshu/home.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://www.jianshu.com', diff --git a/lib/routes/jianshu/router.js b/lib/routes/jianshu/router.js index a43044463bbdf9..87d84957ee2480 100644 --- a/lib/routes/jianshu/router.js +++ b/lib/routes/jianshu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/collection/:id', './collection'); router.get('/home', './home'); router.get('/user/:id', './user'); diff --git a/lib/routes/jianshu/user.js b/lib/routes/jianshu/user.js index d106f70c697933..833ea3a0099de1 100644 --- a/lib/routes/jianshu/user.js +++ b/lib/routes/jianshu/user.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got({ diff --git a/lib/routes/jiaoliudao/index.js b/lib/routes/jiaoliudao/index.js index f26663990fec45..27b9702547240a 100644 --- a/lib/routes/jiaoliudao/index.js +++ b/lib/routes/jiaoliudao/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.jiaoliudao.com'; const { data } = await got(`${baseUrl}/wp-json/wp/v2/posts`, { searchParams: { diff --git a/lib/routes/jiaoliudao/router.js b/lib/routes/jiaoliudao/router.js index d7756988faf502..b84c130aa1d81f 100644 --- a/lib/routes/jiaoliudao/router.js +++ b/lib/routes/jiaoliudao/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/jiemian/list.js b/lib/routes/jiemian/list.js index 7de9f745ad4787..2643565da7b2a1 100644 --- a/lib/routes/jiemian/list.js +++ b/lib/routes/jiemian/list.js @@ -1,4 +1,4 @@ -module.exports = (ctx) => { +export default (ctx) => { const id = ctx.req.param('id'); const redirectTo = `/jiemian${id ? `/lists/${id}` : ''}`; diff --git a/lib/routes/jiemian/lists.js b/lib/routes/jiemian/lists.js index 5f1d502c4d8d69..fabfac1a63c950 100644 --- a/lib/routes/jiemian/lists.js +++ b/lib/routes/jiemian/lists.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/jiemian/router.js b/lib/routes/jiemian/router.js index a5fac5501f8e7a..5a448fbbb963c1 100644 --- a/lib/routes/jiemian/router.js +++ b/lib/routes/jiemian/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/list/:id', './list'); router.get('/:category*', './lists'); }; diff --git a/lib/routes/jike/router.js b/lib/routes/jike/router.js index dd8838380c2e7c..dcbfc63aea9923 100644 --- a/lib/routes/jike/router.js +++ b/lib/routes/jike/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/topic/text/:id', './topic-text'); router.get('/topic/:id/:showUid?', './topic'); router.get('/user/:id', './user'); diff --git a/lib/routes/jike/topic-text.js b/lib/routes/jike/topic-text.js index 91523f45f8ee77..f04cac51a1e170 100644 --- a/lib/routes/jike/topic-text.js +++ b/lib/routes/jike/topic-text.js @@ -1,7 +1,7 @@ const dayjs = require('dayjs'); const { constructTopicEntry } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const topicUrl = `https://m.okjike.com/topics/${id}`; diff --git a/lib/routes/jike/topic.js b/lib/routes/jike/topic.js index d8e1d604c6fc35..4c56d1f11fbcad 100644 --- a/lib/routes/jike/topic.js +++ b/lib/routes/jike/topic.js @@ -7,7 +7,7 @@ const { constructTopicEntry } = require('./utils'); const urlRegex = /(https?:\/\/[^\s"'<>]+)/g; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const topicUrl = `https://m.okjike.com/topics/${id}`; diff --git a/lib/routes/jike/user.js b/lib/routes/jike/user.js index 4e3e6a852426a6..4021c58cd4c53f 100644 --- a/lib/routes/jike/user.js +++ b/lib/routes/jike/user.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got({ diff --git a/lib/routes/jin10/index.js b/lib/routes/jin10/index.js index dc277d8744ccc1..8993a9198175ae 100644 --- a/lib/routes/jin10/index.js +++ b/lib/routes/jin10/index.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const { important = false } = ctx.req.param(); const data = await cache.tryGet( 'jin10:index', diff --git a/lib/routes/jin10/router.js b/lib/routes/jin10/router.js index bd34163d24191c..ab0046c3aaedeb 100644 --- a/lib/routes/jin10/router.js +++ b/lib/routes/jin10/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/:important?', './index'); router.get('/topic/:id', './topic'); }; diff --git a/lib/routes/jin10/topic.js b/lib/routes/jin10/topic.js index 416552604a52e8..423de440953dae 100644 --- a/lib/routes/jin10/topic.js +++ b/lib/routes/jin10/topic.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const data = await cache.tryGet( `jin10:topic:${id}`, diff --git a/lib/routes/jinse/catalogue.js b/lib/routes/jinse/catalogue.js index 8815778e7faa19..ce0c0d8d1ded62 100644 --- a/lib/routes/jinse/catalogue.js +++ b/lib/routes/jinse/catalogue.js @@ -18,7 +18,7 @@ const categories = { capitalmarket: '研报', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'zhengce' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/jinse/lives.js b/lib/routes/jinse/lives.js index 5dd0a36fb4d77e..b16bca015a7144 100644 --- a/lib/routes/jinse/lives.js +++ b/lib/routes/jinse/lives.js @@ -13,7 +13,7 @@ const categories = { 5: '项目', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '0' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 100; diff --git a/lib/routes/jinse/router.js b/lib/routes/jinse/router.js index 4407067cc22ddb..761be76b28e031 100644 --- a/lib/routes/jinse/router.js +++ b/lib/routes/jinse/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/lives/:category?', './lives'); router.get('/timeline/:category?', './timeline'); router.get('/:category?', './catalogue'); diff --git a/lib/routes/jinse/timeline.js b/lib/routes/jinse/timeline.js index 2510d8a0d9a2ae..cbd16607713326 100644 --- a/lib/routes/jinse/timeline.js +++ b/lib/routes/jinse/timeline.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '头条' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/jisilu/index.js b/lib/routes/jisilu/index.js index d61b28d203c84d..6504c45b1f8a4b 100644 --- a/lib/routes/jisilu/index.js +++ b/lib/routes/jisilu/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const sort = ctx.req.param('sort') ?? ''; const day = ctx.req.param('day') ?? ''; diff --git a/lib/routes/jisilu/router.js b/lib/routes/jisilu/router.js index b7f41033b52076..03a8d21eb47b9f 100644 --- a/lib/routes/jisilu/router.js +++ b/lib/routes/jisilu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?/:sort?/:day?', './index'); }; diff --git a/lib/routes/jjwxc/author.js b/lib/routes/jjwxc/author.js index d2246041b73618..9dfb05f32eb075 100644 --- a/lib/routes/jjwxc/author.js +++ b/lib/routes/jjwxc/author.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://www.jjwxc.net'; diff --git a/lib/routes/jjwxc/book.js b/lib/routes/jjwxc/book.js index 993b6040da4649..6e32dfdd07841b 100644 --- a/lib/routes/jjwxc/book.js +++ b/lib/routes/jjwxc/book.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 100; diff --git a/lib/routes/jjwxc/router.js b/lib/routes/jjwxc/router.js index 9cb27418d00a08..c9c9f4f7c3266b 100644 --- a/lib/routes/jjwxc/router.js +++ b/lib/routes/jjwxc/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/author/:id?', './author'); router.get('/book/:id?', './book'); }; diff --git a/lib/routes/jornada/index.js b/lib/routes/jornada/index.js index 6d85e714fccfd1..0d8d6697dce94b 100644 --- a/lib/routes/jornada/index.js +++ b/lib/routes/jornada/index.js @@ -23,7 +23,7 @@ const getDateForToday = () => { return today; }; -module.exports = async (ctx) => { +export default async (ctx) => { const date = ctx.req.param('date') === 'today' || ctx.req.param('date') === undefined ? getDateForToday() : ctx.req.param('date'); const category = ctx.req.param('category'); const url = `${rootUrl}/jsonstorage/articles_${date}_.json`; diff --git a/lib/routes/jornada/router.js b/lib/routes/jornada/router.js index 2aa0026b506142..a528645a7c020d 100644 --- a/lib/routes/jornada/router.js +++ b/lib/routes/jornada/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:date?/:category?', './index'); }; diff --git a/lib/routes/jou/home.js b/lib/routes/jou/home.js index 950d6cf1b998e6..7c3f12b7d49244 100644 --- a/lib/routes/jou/home.js +++ b/lib/routes/jou/home.js @@ -3,7 +3,7 @@ const { getItems } = require('./utils'); const url = 'https://www.jou.edu.cn/index/tzgg.htm'; const host = 'https://www.jou.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const out = await getItems(ctx, url, host, 'winstyle106390', 'timestyle106390', 'titlestyle106402', 'timestyle106402'); // 生成RSS源 diff --git a/lib/routes/jou/router.js b/lib/routes/jou/router.js index 0d0cee6a637d64..1c1f4a67e1aa51 100644 --- a/lib/routes/jou/router.js +++ b/lib/routes/jou/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { // 江苏海洋大学通知公告 router.get('/tzgg', './home'); // 江苏海洋大学研招网通知公告 diff --git a/lib/routes/jou/yz.js b/lib/routes/jou/yz.js index 944c0ba37a94cf..20adad212e03bd 100644 --- a/lib/routes/jou/yz.js +++ b/lib/routes/jou/yz.js @@ -3,7 +3,7 @@ const { getItems } = require('./utils'); const url = 'https://yz.jou.edu.cn/index/zxgg.htm'; const host = 'https://yz.jou.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const out = await getItems(ctx, url, host, 'winstyle207638', 'timestyle207638', 'titlestyle207543', 'timestyle207543'); // 生成RSS源 diff --git a/lib/routes/jseea/news.js b/lib/routes/jseea/news.js index b2405a95397449..c66f035b04308a 100644 --- a/lib/routes/jseea/news.js +++ b/lib/routes/jseea/news.js @@ -22,7 +22,7 @@ async function loadContent(link) { return description; } -module.exports = async (ctx) => { +export default async (ctx) => { // 默认 正常规定 然后获取列表页面 const type = ctx.req.param('type') ?? 'zkyw'; const listPageUrl = `${baseUrl}/webfile/news/${type}/`; diff --git a/lib/routes/jseea/router.js b/lib/routes/jseea/router.js index 27850a08c58532..eb19f8f1f67ba3 100644 --- a/lib/routes/jseea/router.js +++ b/lib/routes/jseea/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:type?', './news'); }; diff --git a/lib/routes/jsu/cxzx.js b/lib/routes/jsu/cxzx.js index 3419ec3b0de42e..73b49a7915914c 100644 --- a/lib/routes/jsu/cxzx.js +++ b/lib/routes/jsu/cxzx.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析 import { parseDate } from '@/utils/parse-date'; const { getPageItemAndDate } = require('./utils/index'); -module.exports = async (ctx) => { +export default async (ctx) => { // 在此处编写您的逻辑 const { types = 'xkjs' } = ctx.req.param(); const baseUrl = 'https://cxzx.jsu.edu.cn/'; diff --git a/lib/routes/jsu/jwc.js b/lib/routes/jsu/jwc.js index 98b9d289d342ea..111e0a14ebe018 100644 --- a/lib/routes/jsu/jwc.js +++ b/lib/routes/jsu/jwc.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析 import { parseDate } from '@/utils/parse-date'; const { getPageItemAndDate } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://jwc.jsu.edu.cn/'; const { types = 'jwtz' } = ctx.req.param(); const selectors = { diff --git a/lib/routes/jsu/math.js b/lib/routes/jsu/math.js index 95c136bb0fbc91..3cff70d5d62f11 100644 --- a/lib/routes/jsu/math.js +++ b/lib/routes/jsu/math.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析 import { parseDate } from '@/utils/parse-date'; const { getPageItemAndDate } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://stxy.jsu.edu.cn/'; const response = await got({ diff --git a/lib/routes/jsu/rjxy.js b/lib/routes/jsu/rjxy.js index 73d18a4618440e..29f50165e5620b 100644 --- a/lib/routes/jsu/rjxy.js +++ b/lib/routes/jsu/rjxy.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析 import { parseDate } from '@/utils/parse-date'; const { getPageItemAndDate } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://rjxy.jsu.edu.cn/'; const response = await got({ diff --git a/lib/routes/jsu/router.js b/lib/routes/jsu/router.js index 3dfaca70dec24f..3eef70e5597425 100644 --- a/lib/routes/jsu/router.js +++ b/lib/routes/jsu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { // 创新中心 router.get('/cxzx/:types?', './cxzx'); router.get('/jwc/:types?', './jwc'); diff --git a/lib/routes/jsu/universityindex.js b/lib/routes/jsu/universityindex.js index 5efc66214f9e16..1aeaf0ba3ffed9 100644 --- a/lib/routes/jsu/universityindex.js +++ b/lib/routes/jsu/universityindex.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析 import { parseDate } from '@/utils/parse-date'; const { getPageItemAndDate } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.jsu.edu.cn/'; const response = await got({ diff --git a/lib/routes/juejin/books.js b/lib/routes/juejin/books.js index ba8a42e6ae593d..681d54aeb01825 100644 --- a/lib/routes/juejin/books.js +++ b/lib/routes/juejin/books.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'post', url: 'https://api.juejin.cn/booklet_api/v1/booklet/listbycategory', diff --git a/lib/routes/juejin/category.js b/lib/routes/juejin/category.js index aab2685355ed92..5888f89f2990e1 100644 --- a/lib/routes/juejin/category.js +++ b/lib/routes/juejin/category.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const idResponse = await got({ diff --git a/lib/routes/juejin/collection.js b/lib/routes/juejin/collection.js index c7465979743d62..0998400cda8a1d 100644 --- a/lib/routes/juejin/collection.js +++ b/lib/routes/juejin/collection.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const collectionId = ctx.req.param('collectionId'); const collectPage = await got({ diff --git a/lib/routes/juejin/column.js b/lib/routes/juejin/column.js index 8c6bcf4caab36f..0ee4e42023894b 100644 --- a/lib/routes/juejin/column.js +++ b/lib/routes/juejin/column.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const detail = await got({ method: 'get', diff --git a/lib/routes/juejin/favorites.js b/lib/routes/juejin/favorites.js index 3c820d23364e34..59ff81f8bbde9e 100644 --- a/lib/routes/juejin/favorites.js +++ b/lib/routes/juejin/favorites.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const userId = ctx.req.param('userId'); const response = await got({ method: 'get', diff --git a/lib/routes/juejin/pins.js b/lib/routes/juejin/pins.js index b216c24f6a5520..24adcc55a87736 100644 --- a/lib/routes/juejin/pins.js +++ b/lib/routes/juejin/pins.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'recommend'; const title = { recommend: '推荐', diff --git a/lib/routes/juejin/posts.js b/lib/routes/juejin/posts.js index c24f41f3b6bbcf..21b5cdb80fd8b6 100644 --- a/lib/routes/juejin/posts.js +++ b/lib/routes/juejin/posts.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got({ diff --git a/lib/routes/juejin/router.js b/lib/routes/juejin/router.js index 0d4dc45207c982..b89752c3665e16 100644 --- a/lib/routes/juejin/router.js +++ b/lib/routes/juejin/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/books', './books'); router.get('/category/:category', './category'); router.get('/collection/:collectionId', './collection'); diff --git a/lib/routes/juejin/tag.js b/lib/routes/juejin/tag.js index 19a93b31c5b6a1..54b52e52f6249e 100644 --- a/lib/routes/juejin/tag.js +++ b/lib/routes/juejin/tag.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const idResponse = await got({ diff --git a/lib/routes/juejin/trending.js b/lib/routes/juejin/trending.js index 186e2329cd7ca2..4bfa1f771d60fb 100644 --- a/lib/routes/juejin/trending.js +++ b/lib/routes/juejin/trending.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category, type } = ctx.req.param(); let id = ''; diff --git a/lib/routes/jump/discount.js b/lib/routes/jump/discount.js index 0db406f5cf0ace..930ca90f0b9257 100644 --- a/lib/routes/jump/discount.js +++ b/lib/routes/jump/discount.js @@ -93,7 +93,7 @@ const getAllPageDiscountItem = async (countries, platform, termsId, totalNum) => // }; // }; -module.exports = async (ctx) => { +export default async (ctx) => { const platform = ctx.req.param('platform'); const filter = ctx.req.param('filter') || 'all'; const countries = ctx.req.param('countries') || ''; diff --git a/lib/routes/jump/router.js b/lib/routes/jump/router.js index 9079e85699e684..86776bc11c5d4a 100644 --- a/lib/routes/jump/router.js +++ b/lib/routes/jump/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/discount/:platform/:filter?/:countries?', './discount.js'); }; diff --git a/lib/routes/kamen-rider-official/news.js b/lib/routes/kamen-rider-official/news.js index 137c5849877231..9b57beb2e13bd8 100644 --- a/lib/routes/kamen-rider-official/news.js +++ b/lib/routes/kamen-rider-official/news.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/kamen-rider-official/router.js b/lib/routes/kamen-rider-official/router.js index 94e58c83a4832c..ec7c5eda5bf4b4 100644 --- a/lib/routes/kamen-rider-official/router.js +++ b/lib/routes/kamen-rider-official/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:category?', './news'); }; diff --git a/lib/routes/kantarworldpanel/index.js b/lib/routes/kantarworldpanel/index.js index 04719df4a1ceb4..4cb5d270d9cbad 100644 --- a/lib/routes/kantarworldpanel/index.js +++ b/lib/routes/kantarworldpanel/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { region = 'cn-en', category = 'news' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/kantarworldpanel/router.js b/lib/routes/kantarworldpanel/router.js index 2730e59e57860e..4ab9c9bb814cb2 100644 --- a/lib/routes/kantarworldpanel/router.js +++ b/lib/routes/kantarworldpanel/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:region?/:category*', './'); }; diff --git a/lib/routes/kbs/news.js b/lib/routes/kbs/news.js index cfb6ef68a6a715..18e7046bb17a83 100644 --- a/lib/routes/kbs/news.js +++ b/lib/routes/kbs/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'all'; const language = ctx.req.param('language') ?? 'e'; diff --git a/lib/routes/kbs/router.js b/lib/routes/kbs/router.js index fd52b670ee475c..0f6175ef60ec28 100644 --- a/lib/routes/kbs/router.js +++ b/lib/routes/kbs/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:category?/:language?', './news'); router.get('/today/:language?', './today'); }; diff --git a/lib/routes/kbs/today.js b/lib/routes/kbs/today.js index f2abb29bf83e4e..8cefbbf66b8dde 100644 --- a/lib/routes/kbs/today.js +++ b/lib/routes/kbs/today.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? 'e'; const rootUrl = 'http://world.kbs.co.kr'; diff --git a/lib/routes/kcna/news.js b/lib/routes/kcna/news.js index 94990ccf416e1e..09ccc44f4e0915 100644 --- a/lib/routes/kcna/news.js +++ b/lib/routes/kcna/news.js @@ -7,7 +7,7 @@ const { parseJucheDate, fixDesc, fetchPhoto, fetchVideo } = require('./utils'); import * as path from 'node:path'; const sanitizeHtml = require('sanitize-html'); -module.exports = async (ctx) => { +export default async (ctx) => { const { lang, category = '1ee9bdb7186944f765208f34ecfb5407' } = ctx.req.param(); const rootUrl = 'http://www.kcna.kp'; diff --git a/lib/routes/kcna/router.js b/lib/routes/kcna/router.js index a5490e1c006bfc..0011c4977a28b2 100644 --- a/lib/routes/kcna/router.js +++ b/lib/routes/kcna/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:lang/:category?', './news'); }; diff --git a/lib/routes/ke/results.js b/lib/routes/ke/results.js index 4a28b64608c2e7..aa03eed967f29a 100644 --- a/lib/routes/ke/results.js +++ b/lib/routes/ke/results.js @@ -1,7 +1,7 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'post', url: 'https://research.ke.com/apis/consumer-access/index/contents/page', diff --git a/lib/routes/ke/router.js b/lib/routes/ke/router.js index c856a1aec75374..aeccb06f572d18 100644 --- a/lib/routes/ke/router.js +++ b/lib/routes/ke/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/researchResults', './results'); }; diff --git a/lib/routes/keep/router.js b/lib/routes/keep/router.js index b437231e22f083..a7fbaa70aa8a1e 100644 --- a/lib/routes/keep/router.js +++ b/lib/routes/keep/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/user/:id', './user'); }; diff --git a/lib/routes/keep/user.js b/lib/routes/keep/user.js index d632608ee726d3..9debc62709b30f 100644 --- a/lib/routes/keep/user.js +++ b/lib/routes/keep/user.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got({ diff --git a/lib/routes/keepass/news.js b/lib/routes/keepass/news.js index ae4869f5cdd1f1..04060dd3e3d180 100644 --- a/lib/routes/keepass/news.js +++ b/lib/routes/keepass/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://keepass.info/news/news_all.html'; const { data: response } = await got(baseUrl); const $ = load(response); diff --git a/lib/routes/keepass/router.js b/lib/routes/keepass/router.js index ecb9465f8cb02b..d8c52182fe7af5 100644 --- a/lib/routes/keepass/router.js +++ b/lib/routes/keepass/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './news'); }; diff --git a/lib/routes/kemono/index.js b/lib/routes/kemono/index.js index 7986d1495c6ddf..042bfa05216498 100644 --- a/lib/routes/kemono/index.js +++ b/lib/routes/kemono/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25; const source = ctx.req.param('source') ?? ''; const id = ctx.req.param('id'); diff --git a/lib/routes/kemono/router.js b/lib/routes/kemono/router.js index 092ba654d8e880..c25af847db57a8 100644 --- a/lib/routes/kemono/router.js +++ b/lib/routes/kemono/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:source?/:id?', './index'); }; diff --git a/lib/routes/kepu/live.js b/lib/routes/kepu/live.js index 8abdc7337abcb5..ce0d14036d3645 100644 --- a/lib/routes/kepu/live.js +++ b/lib/routes/kepu/live.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; const rootUrl = 'https://live.kepu.net.cn'; diff --git a/lib/routes/kepu/router.js b/lib/routes/kepu/router.js index a43119c2f076b8..fd57823ac315fd 100644 --- a/lib/routes/kepu/router.js +++ b/lib/routes/kepu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/live', './live'); }; diff --git a/lib/routes/keylol/index.js b/lib/routes/keylol/index.js index 463e70a231d215..fb2c5df685649f 100644 --- a/lib/routes/keylol/index.js +++ b/lib/routes/keylol/index.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { let thePath = getSubPath(ctx).replace(/^\//, ''); if (/^f\d+-\d+/.test(thePath)) { diff --git a/lib/routes/keylol/router.js b/lib/routes/keylol/router.js index 6ea9e73a121a87..3e16705b558ae0 100644 --- a/lib/routes/keylol/router.js +++ b/lib/routes/keylol/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './'); }; diff --git a/lib/routes/kimlaw/router.js b/lib/routes/kimlaw/router.js index 84b33331092a99..bf1711a7b793fe 100644 --- a/lib/routes/kimlaw/router.js +++ b/lib/routes/kimlaw/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/thesis', './thesis'); }; diff --git a/lib/routes/kimlaw/thesis.js b/lib/routes/kimlaw/thesis.js index 3f6061550c61ac..41a44461889e60 100644 --- a/lib/routes/kimlaw/thesis.js +++ b/lib/routes/kimlaw/thesis.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'https://www.kimlaw.or.kr'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `${baseUrl}/67`; const { data: response } = await got(link); diff --git a/lib/routes/konghq/blog-posts.js b/lib/routes/konghq/blog-posts.js index 6f2156b5ebb619..12847871e36fb5 100644 --- a/lib/routes/konghq/blog-posts.js +++ b/lib/routes/konghq/blog-posts.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; const BASE_URL = 'https://konghq.com'; const BLOG_POSTS_URL = `${BASE_URL}/blog`; -module.exports = async (ctx) => { +export default async (ctx) => { // Always get the posts on the first page. const url = `${BLOG_POSTS_URL}/page/1`; diff --git a/lib/routes/konghq/router.js b/lib/routes/konghq/router.js index e0e8623f1a0084..d7585fccfaeda3 100644 --- a/lib/routes/konghq/router.js +++ b/lib/routes/konghq/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog-posts', './blog-posts'); }; diff --git a/lib/routes/kuaidi100/index.js b/lib/routes/kuaidi100/index.js index 3c06812cf7ac38..ff8ff1bd4a54e7 100644 --- a/lib/routes/kuaidi100/index.js +++ b/lib/routes/kuaidi100/index.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { // number is shorthand for company // id is ticket number // phone for shunfeng :) diff --git a/lib/routes/kuaidi100/router.js b/lib/routes/kuaidi100/router.js index e42d177a43d702..dd197da45d44dc 100644 --- a/lib/routes/kuaidi100/router.js +++ b/lib/routes/kuaidi100/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/company', './supported-company'); router.get('/track/:number/:id/:phone?', './index'); }; diff --git a/lib/routes/kuaidi100/supported-company.js b/lib/routes/kuaidi100/supported-company.js index c739377c9bc77d..f96dce2a0c7329 100644 --- a/lib/routes/kuaidi100/supported-company.js +++ b/lib/routes/kuaidi100/supported-company.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const ls = await utils.company(); ctx.set('data', { title: `快递100 快递列表`, diff --git a/lib/routes/kunchengblog/essay.js b/lib/routes/kunchengblog/essay.js index 42f2034569d4d3..7994940cabe8cb 100644 --- a/lib/routes/kunchengblog/essay.js +++ b/lib/routes/kunchengblog/essay.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { SourceMapConsumer } = require('source-map'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 100; const rootUrl = 'https://www.kunchengblog.com'; diff --git a/lib/routes/kunchengblog/router.js b/lib/routes/kunchengblog/router.js index b390edcae9c985..15dc929d78130d 100644 --- a/lib/routes/kunchengblog/router.js +++ b/lib/routes/kunchengblog/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/essay', './essay'); }; diff --git a/lib/routes/kuwaitlocal/index.js b/lib/routes/kuwaitlocal/index.js index 06e6f6c8d7640f..52c662253923c3 100644 --- a/lib/routes/kuwaitlocal/index.js +++ b/lib/routes/kuwaitlocal/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://kuwaitlocal.com'; const { category = 'latest' } = ctx.req.param(); const url = `${baseUrl}/news/${category === 'latest' ? category : `categories/${category}`}`; diff --git a/lib/routes/kuwaitlocal/router.js b/lib/routes/kuwaitlocal/router.js index 5db50869af4b34..0bcd82a5c2aa19 100644 --- a/lib/routes/kuwaitlocal/router.js +++ b/lib/routes/kuwaitlocal/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/kyodonews/index.js b/lib/routes/kyodonews/index.js index d075ffa398f32e..1b921cbe69ce11 100644 --- a/lib/routes/kyodonews/index.js +++ b/lib/routes/kyodonews/index.js @@ -8,7 +8,7 @@ import * as path from 'node:path'; const resolveRelativeLink = (link, baseUrl) => (link.startsWith('http') ? link : `${baseUrl}${link}`); -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? 'china'; const keyword = ctx.req.param('keyword') === 'RSS' ? 'rss' : ctx.req.param('keyword') ?? ''; diff --git a/lib/routes/kyodonews/router.js b/lib/routes/kyodonews/router.js index 7d8737f25cb03a..43245151b1bc9a 100644 --- a/lib/routes/kyodonews/router.js +++ b/lib/routes/kyodonews/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:language?/:keyword?', './index'); }; diff --git a/lib/routes/laimanhua/index.js b/lib/routes/laimanhua/index.js index bdd9e9b8212a2b..1200aa0751852f 100644 --- a/lib/routes/laimanhua/index.js +++ b/lib/routes/laimanhua/index.js @@ -3,7 +3,7 @@ const iconv = require('iconv-lite'); import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const baseUrl = `https://www.laimanhua8.com`; const link = `${baseUrl}/kanmanhua/${id}/`; diff --git a/lib/routes/laimanhua/router.js b/lib/routes/laimanhua/router.js index 4d3b1e694acf5f..c79f907ed7d0b5 100644 --- a/lib/routes/laimanhua/router.js +++ b/lib/routes/laimanhua/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id', './index'); }; diff --git a/lib/routes/lala/router.js b/lib/routes/lala/router.js index 42ffe3a854b3a5..09c585b57315bb 100644 --- a/lib/routes/lala/router.js +++ b/lib/routes/lala/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './rss'); }; diff --git a/lib/routes/lala/rss.js b/lib/routes/lala/rss.js index 3f0c63123a2946..666788273fe81f 100644 --- a/lib/routes/lala/rss.js +++ b/lib/routes/lala/rss.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = 'https://lala.im'; const response = await got(`${currentUrl}/feed`); const $ = load(response.data, { xmlMode: true }); diff --git a/lib/routes/lang/room.js b/lib/routes/lang/room.js index 9683e0ee2b2b88..7531e70e81fe16 100644 --- a/lib/routes/lang/room.js +++ b/lib/routes/lang/room.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const url = `https://www.lang.live/room/${id}`; diff --git a/lib/routes/lang/router.js b/lib/routes/lang/router.js index 3eac4ca2bbe115..c6e4965a3ccc4b 100644 --- a/lib/routes/lang/router.js +++ b/lib/routes/lang/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/live/room/:id', './room'); }; diff --git a/lib/routes/lanqiao/author.js b/lib/routes/lanqiao/author.js index 9a19610ce2aeb6..565482ed44ed0d 100644 --- a/lib/routes/lanqiao/author.js +++ b/lib/routes/lanqiao/author.js @@ -16,7 +16,7 @@ async function getUserName(uid) { return response.data.name; } -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const userName = await getUserName(uid); // 发起 HTTP GET 请求 diff --git a/lib/routes/lanqiao/courses.js b/lib/routes/lanqiao/courses.js index 5e097ebe788093..565d1138b3893b 100644 --- a/lib/routes/lanqiao/courses.js +++ b/lib/routes/lanqiao/courses.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const utils = require('./utils'); const MarkdownIt = require('markdown-it'); -module.exports = async (ctx) => { +export default async (ctx) => { const sort = ctx.req.param('sort'); const tag = ctx.req.param('tag'); // 发起 HTTP GET 请求 diff --git a/lib/routes/lanqiao/questions.js b/lib/routes/lanqiao/questions.js index 3225cec17ee1cf..5962287aa4b37d 100644 --- a/lib/routes/lanqiao/questions.js +++ b/lib/routes/lanqiao/questions.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const MarkdownIt = require('markdown-it'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); // 发起 HTTP GET 请求 const response = await got({ diff --git a/lib/routes/lanqiao/router.js b/lib/routes/lanqiao/router.js index 5420ccf217d685..a08dfd324d21af 100644 --- a/lib/routes/lanqiao/router.js +++ b/lib/routes/lanqiao/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/author/:uid', './author'); router.get('/courses/:sort/:tag', './courses'); router.get('/questions/:id', './questions'); diff --git a/lib/routes/laohu8/personal.js b/lib/routes/laohu8/personal.js index 7a11a616c3f601..f0d6f1d4d4c20f 100644 --- a/lib/routes/laohu8/personal.js +++ b/lib/routes/laohu8/personal.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.laohu8.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const url = `${rootUrl}/personal/${id}`; diff --git a/lib/routes/laohu8/router.js b/lib/routes/laohu8/router.js index cd97eb99c0027d..a575ad3c90db25 100644 --- a/lib/routes/laohu8/router.js +++ b/lib/routes/laohu8/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/personal/:id', './personal'); }; diff --git a/lib/routes/latepost/index.js b/lib/routes/latepost/index.js index 89055b0f3d73e8..47652a6b5dc03a 100644 --- a/lib/routes/latepost/index.js +++ b/lib/routes/latepost/index.js @@ -21,7 +21,7 @@ const arrayToDictionary = (arr) => ]) ); -module.exports = async (ctx) => { +export default async (ctx) => { const proma = ctx.req.param('proma'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 5; diff --git a/lib/routes/latepost/router.js b/lib/routes/latepost/router.js index e532ed03af12eb..997113cbf95c4d 100644 --- a/lib/routes/latepost/router.js +++ b/lib/routes/latepost/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:proma?', './'); }; diff --git a/lib/routes/layoffs/index.js b/lib/routes/layoffs/index.js index b0821f4c77f32f..d23fc937b0f528 100644 --- a/lib/routes/layoffs/index.js +++ b/lib/routes/layoffs/index.js @@ -37,7 +37,7 @@ const getMappings = function (obj) { return [mapping, reverseMapping]; }; -module.exports = async (ctx) => { +export default async (ctx) => { const headers = { 'x-airtable-application-id': 'app1PaujS9zxVGUZ4', 'x-airtable-inter-service-client': 'webClient', diff --git a/lib/routes/layoffs/router.js b/lib/routes/layoffs/router.js index 24002efbf934ac..33075c5d607b32 100644 --- a/lib/routes/layoffs/router.js +++ b/lib/routes/layoffs/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index.js'); }; diff --git a/lib/routes/learnblockchain/posts.js b/lib/routes/learnblockchain/posts.js index 52bece7da2443c..f5d96684060a1e 100644 --- a/lib/routes/learnblockchain/posts.js +++ b/lib/routes/learnblockchain/posts.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const cid = ctx.req.param('cid') || 'all'; const sort = ctx.req.param('sort'); diff --git a/lib/routes/learnblockchain/router.js b/lib/routes/learnblockchain/router.js index d37c1d1867a361..23a701b1b007a4 100644 --- a/lib/routes/learnblockchain/router.js +++ b/lib/routes/learnblockchain/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/posts/:cid/:sort?', './posts'); }; diff --git a/lib/routes/learnku/router.js b/lib/routes/learnku/router.js index 19c7b19aed57ed..db106b1d86a134 100644 --- a/lib/routes/learnku/router.js +++ b/lib/routes/learnku/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:community/:category?', './topic.js'); }; diff --git a/lib/routes/learnku/topic.js b/lib/routes/learnku/topic.js index a37828a8fe16bf..4f183c22069eb2 100644 --- a/lib/routes/learnku/topic.js +++ b/lib/routes/learnku/topic.js @@ -5,7 +5,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const community = ctx.req.param('community'); const category = ctx.req.param('category') || ''; diff --git a/lib/routes/leetcode/articles.js b/lib/routes/leetcode/articles.js index 768343786eee10..2ec1e36340fd98 100644 --- a/lib/routes/leetcode/articles.js +++ b/lib/routes/leetcode/articles.js @@ -10,7 +10,7 @@ const md = require('markdown-it')({ const host = 'https://leetcode.com'; const gqlEndpoint = `${host}/graphql`; -module.exports = async (ctx) => { +export default async (ctx) => { const link = new URL('/articles/', host).href; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/leetcode/dailyquestion-cn.js b/lib/routes/leetcode/dailyquestion-cn.js index 37e81bb65fa4db..66d6fee63a0a50 100644 --- a/lib/routes/leetcode/dailyquestion-cn.js +++ b/lib/routes/leetcode/dailyquestion-cn.js @@ -4,7 +4,7 @@ import * as path from 'node:path'; const host = 'https://leetcode.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const question = { date: '', link: '', diff --git a/lib/routes/leetcode/dailyquestion-en.js b/lib/routes/leetcode/dailyquestion-en.js index 3c4e86572ab081..481c24fce16c5e 100644 --- a/lib/routes/leetcode/dailyquestion-en.js +++ b/lib/routes/leetcode/dailyquestion-en.js @@ -4,7 +4,7 @@ import * as path from 'node:path'; const host = 'https://leetcode.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const question = { date: '', link: '', diff --git a/lib/routes/leetcode/dailyquestion-solution-cn.js b/lib/routes/leetcode/dailyquestion-solution-cn.js index 67e1636026a2eb..d98a0835ed0eee 100644 --- a/lib/routes/leetcode/dailyquestion-solution-cn.js +++ b/lib/routes/leetcode/dailyquestion-solution-cn.js @@ -5,7 +5,7 @@ const md = require('markdown-it')({ }); import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseurl = `https://leetcode.cn`; const url = `${baseurl}/graphql/`; const headers = { diff --git a/lib/routes/leetcode/dailyquestion-solution-en.js b/lib/routes/leetcode/dailyquestion-solution-en.js index 206f3ee0b1fc55..0ef0ee66b4bc59 100644 --- a/lib/routes/leetcode/dailyquestion-solution-en.js +++ b/lib/routes/leetcode/dailyquestion-solution-en.js @@ -6,7 +6,7 @@ const md = require('markdown-it')({ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseurl = `https://leetcode.com`; const url = `${baseurl}/graphql/`; const headers = { diff --git a/lib/routes/leetcode/router.js b/lib/routes/leetcode/router.js index fee6a1170ded87..58af9bba48c980 100644 --- a/lib/routes/leetcode/router.js +++ b/lib/routes/leetcode/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/articles', './articles'); router.get('/dailyquestion/cn', './dailyquestion-cn'); router.get('/dailyquestion/en', './dailyquestion-en'); diff --git a/lib/routes/leiphone/index.js b/lib/routes/leiphone/index.js index 7a93b6c6374b71..69d8012bdd517d 100644 --- a/lib/routes/leiphone/index.js +++ b/lib/routes/leiphone/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const todo = ctx.req.param('do') ?? ''; const keyword = ctx.req.param('keyword') ?? ''; const rootUrl = 'https://www.leiphone.com'; diff --git a/lib/routes/leiphone/newsflash.js b/lib/routes/leiphone/newsflash.js index e406c6fe5b499d..1b72b24f279f6f 100644 --- a/lib/routes/leiphone/newsflash.js +++ b/lib/routes/leiphone/newsflash.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const utils = require('./utils'); // import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.leiphone.com/site/YejieKuaixun'; const res = await got.get(url); const article = (res.data || {}).article || []; diff --git a/lib/routes/leiphone/router.js b/lib/routes/leiphone/router.js index 64bb016fe76cce..3dfcd3020982e1 100644 --- a/lib/routes/leiphone/router.js +++ b/lib/routes/leiphone/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/newsflash', './newsflash'); router.get('/:do?/:keyword?', './index'); }; diff --git a/lib/routes/lemmy/index.js b/lib/routes/lemmy/index.js index ace037211bd673..433c7db7743460 100644 --- a/lib/routes/lemmy/index.js +++ b/lib/routes/lemmy/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const md = require('markdown-it')({ html: true }); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const sort = ctx.req.param('sort') ?? 'Active'; const community = ctx.req.param('community'); const communitySlices = community.split('@'); diff --git a/lib/routes/lemmy/router.js b/lib/routes/lemmy/router.js index 36453e66bb18b9..1f76acda19e980 100644 --- a/lib/routes/lemmy/router.js +++ b/lib/routes/lemmy/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:community/:sort?', './index'); }; diff --git a/lib/routes/lfsyd/home.js b/lib/routes/lfsyd/home.js index 5cc9d102b96339..b6b96e52698c46 100644 --- a/lib/routes/lfsyd/home.js +++ b/lib/routes/lfsyd/home.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { ProcessForm, ProcessFeed } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.iyingdi.com'; const url = 'https://api.iyingdi.com/mweb/feed/recommend-content-list'; const form = { diff --git a/lib/routes/lfsyd/old-home.js b/lib/routes/lfsyd/old-home.js index 5387f1e0b2bf31..8ae7869b6d9db9 100644 --- a/lib/routes/lfsyd/old-home.js +++ b/lib/routes/lfsyd/old-home.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { ProcessFeed } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ?? 10; const rootUrl = 'https://www.iyingdi.com'; const url = `${rootUrl}/feed/list/user/v3?feedIdUp=0&feedIdDown=0&hotfeed=1&system=web`; diff --git a/lib/routes/lfsyd/router.js b/lib/routes/lfsyd/router.js index 2f51ac5130522d..c438ca00af9e36 100644 --- a/lib/routes/lfsyd/router.js +++ b/lib/routes/lfsyd/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/home', './home'); router.get('/old_home', './old-home'); router.get('/user/:id?', './user'); diff --git a/lib/routes/lfsyd/tag.js b/lib/routes/lfsyd/tag.js index 437cd7e84474e4..76041c6f4fc63e 100644 --- a/lib/routes/lfsyd/tag.js +++ b/lib/routes/lfsyd/tag.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { ProcessForm, ProcessFeed } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const tagId = ctx.req.param('tagId'); const tagList = { 17: '炉石传说', diff --git a/lib/routes/lfsyd/user.js b/lib/routes/lfsyd/user.js index b9ab9aa9e61588..29b35614174fec 100644 --- a/lib/routes/lfsyd/user.js +++ b/lib/routes/lfsyd/user.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { ProcessForm, ProcessFeed } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://www.iyingdi.com'; const listUrl = 'https://api.iyingdi.com/web/user/event-list'; diff --git a/lib/routes/lifeweek/channel.js b/lib/routes/lifeweek/channel.js index 327e96625cd7e3..fa5ef5d51ed6cd 100644 --- a/lib/routes/lifeweek/channel.js +++ b/lib/routes/lifeweek/channel.js @@ -6,7 +6,7 @@ const rootApiUrl = 'https://www.lifeweek.com.cn/api/userWebFollow/getFollowTagCo const rootUrl = 'https://www.lifeweek.com.cn/column'; const articleRootUrl = 'https://www.lifeweek.com.cn/article'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('id'); const url = `${rootApiUrl}=${channel}`; const { data } = await got(url); diff --git a/lib/routes/lifeweek/router.js b/lib/routes/lifeweek/router.js index 63da1a2315c260..0c0d9006d8e293 100644 --- a/lib/routes/lifeweek/router.js +++ b/lib/routes/lifeweek/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/channel/:id', './channel'); router.get('/tag/:id', './tag'); }; diff --git a/lib/routes/lifeweek/tag.js b/lib/routes/lifeweek/tag.js index 4d45c464a84553..f0cd8acbe4f23d 100644 --- a/lib/routes/lifeweek/tag.js +++ b/lib/routes/lifeweek/tag.js @@ -5,7 +5,7 @@ const rootApiUrl = 'https://www.lifeweek.com.cn/api/userWebFollow/getFollowTagCo const rootUrl = 'https://www.lifeweek.com.cn/articleList'; const articleRootUrl = 'https://www.lifeweek.com.cn/article'; -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('id'); const url = `${rootApiUrl}=${tag}`; const { data } = await got(url); diff --git a/lib/routes/lightnovel/light-novel.js b/lib/routes/lightnovel/light-novel.js index 7a32d7ce0f3542..978671fe056d42 100644 --- a/lib/routes/lightnovel/light-novel.js +++ b/lib/routes/lightnovel/light-novel.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.lightnovel.us'; const { type, keywords, security_key = config.lightnovel.cookie } = ctx.req.param(); const { data: response } = await got({ diff --git a/lib/routes/lightnovel/router.js b/lib/routes/lightnovel/router.js index f50d05f773e861..a8d94b9777cfed 100644 --- a/lib/routes/lightnovel/router.js +++ b/lib/routes/lightnovel/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:keywords/:security_key?', './light-novel'); }; diff --git a/lib/routes/line/publisher.js b/lib/routes/line/publisher.js index 284459c77a7984..2eb1dc9d4c810e 100644 --- a/lib/routes/line/publisher.js +++ b/lib/routes/line/publisher.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { baseUrl, parseList, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { edition, id } = ctx.req.param(); const { data: publisherInfo } = await got(`${baseUrl}/webapi/portal/page/setting`, { diff --git a/lib/routes/line/router.js b/lib/routes/line/router.js index 0eb02ba2d14db9..dd852d9fca9d19 100644 --- a/lib/routes/line/router.js +++ b/lib/routes/line/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/today/:edition?/:tab?', './today'); router.get('/today/:edition/publisher/:id', './publisher'); }; diff --git a/lib/routes/line/today.js b/lib/routes/line/today.js index 3f32db02c214bf..0daea2e8cdeb89 100644 --- a/lib/routes/line/today.js +++ b/lib/routes/line/today.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { baseUrl: rootUrl, parseList, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const edition = ctx.req.param('edition') || 'tw'; const tab = ctx.req.param('tab') || 'top'; diff --git a/lib/routes/linkedin/cn/index.js b/lib/routes/linkedin/cn/index.js index 077797fca72b29..c48620bee4d48f 100644 --- a/lib/routes/linkedin/cn/index.js +++ b/lib/routes/linkedin/cn/index.js @@ -2,7 +2,7 @@ const { parseSearchHit, parseJobPosting } = require('./utils'); const siteUrl = 'https://www.linkedin.cn/incareer/jobs/search'; -module.exports = async (ctx) => { +export default async (ctx) => { const { title, jobs } = await parseSearchHit(ctx); const items = await Promise.all(jobs.map((job) => parseJobPosting(ctx, job))); ctx.set('data', { diff --git a/lib/routes/linkedin/jobs.js b/lib/routes/linkedin/jobs.js index cf1594052b060a..ff5b32ca61752b 100644 --- a/lib/routes/linkedin/jobs.js +++ b/lib/routes/linkedin/jobs.js @@ -5,7 +5,7 @@ const { parseJobSearch, KEYWORDS_QUERY_KEY, JOB_TYPES, JOB_TYPES_QUERY_KEY, EXP_ const BASE_URL = 'https://www.linkedin.com/'; const JOB_SEARCH_PATH = '/jobs-guest/jobs/api/seeMoreJobPostings/search'; -module.exports = async (ctx) => { +export default async (ctx) => { const jobTypesParam = parseParamsToSearchParams(ctx.req.param('job_types'), JOB_TYPES); const expLevelsParam = parseParamsToSearchParams(ctx.req.param('exp_levels'), EXP_LEVELS); diff --git a/lib/routes/linkedin/router.js b/lib/routes/linkedin/router.js index cf6250930e05df..861239182a3f65 100644 --- a/lib/routes/linkedin/router.js +++ b/lib/routes/linkedin/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/cn/jobs/:keywords?', './cn/index.js'); router.get('/jobs/:job_types/:exp_levels/:keywords?', './jobs.js'); }; diff --git a/lib/routes/linkresearcher/index.js b/lib/routes/linkresearcher/index.js index 88730bf2429a27..607e372d2d4568 100644 --- a/lib/routes/linkresearcher/index.js +++ b/lib/routes/linkresearcher/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const baseURL = 'https://www.linkresearcher.com'; -module.exports = async (ctx) => { +export default async (ctx) => { // parse params const params = ctx.req.param('params'); const query = qs.parse(params); diff --git a/lib/routes/linkresearcher/router.js b/lib/routes/linkresearcher/router.js index fddc7d1b6c7350..735385dc21fa66 100644 --- a/lib/routes/linkresearcher/router.js +++ b/lib/routes/linkresearcher/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:params', './index'); }; diff --git a/lib/routes/linovelib/novel.js b/lib/routes/linovelib/novel.js index a3b3eba39b1a21..b5eefcbcc88ec5 100644 --- a/lib/routes/linovelib/novel.js +++ b/lib/routes/linovelib/novel.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(`https://www.linovelib.com/novel/${ctx.req.param('id')}/catalog`); const $ = load(response.data); diff --git a/lib/routes/linovelib/router.js b/lib/routes/linovelib/router.js index 24d814aa346df7..d688f0aca3fc28 100644 --- a/lib/routes/linovelib/router.js +++ b/lib/routes/linovelib/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/novel/:id', './novel'); }; diff --git a/lib/routes/liquipedia/cs-matches.js b/lib/routes/liquipedia/cs-matches.js index ba8b16c5a07067..aecebc81e7b715 100644 --- a/lib/routes/liquipedia/cs-matches.js +++ b/lib/routes/liquipedia/cs-matches.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const team = ctx.req.param('team'); const rootUrl = 'https://liquipedia.net'; diff --git a/lib/routes/liquipedia/dota2-matches.js b/lib/routes/liquipedia/dota2-matches.js index 37d5a09c26829b..5638a797969625 100644 --- a/lib/routes/liquipedia/dota2-matches.js +++ b/lib/routes/liquipedia/dota2-matches.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const team = ctx.req.param('id'); const url = `https://liquipedia.net/dota2/${team}`; const response = await got({ diff --git a/lib/routes/liquipedia/router.js b/lib/routes/liquipedia/router.js index 5f9144201b07f7..dd304b67b04919 100644 --- a/lib/routes/liquipedia/router.js +++ b/lib/routes/liquipedia/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/counterstrike/matches/:team', './cs-matches.js'); router.get('/dota2/matches/:id', './dota2-matches.js'); }; diff --git a/lib/routes/literotica/category.js b/lib/routes/literotica/category.js index 5e1770a9a11514..30125c24317297 100644 --- a/lib/routes/literotica/category.js +++ b/lib/routes/literotica/category.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const rootUrl = 'https://www.literotica.com'; diff --git a/lib/routes/literotica/new.js b/lib/routes/literotica/new.js index ee60aaf8149076..5130adc76309fc 100644 --- a/lib/routes/literotica/new.js +++ b/lib/routes/literotica/new.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.literotica.com'; const currentUrl = `${rootUrl}/stories/new_submissions.php`; diff --git a/lib/routes/literotica/router.js b/lib/routes/literotica/router.js index 2939f350070dab..fbf09e5c54af13 100644 --- a/lib/routes/literotica/router.js +++ b/lib/routes/literotica/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/new', './new'); router.get('/category/:category', './category'); }; diff --git a/lib/routes/liulinblog/index.js b/lib/routes/liulinblog/index.js index a7703083d07c09..02f90e5f18a630 100644 --- a/lib/routes/liulinblog/index.js +++ b/lib/routes/liulinblog/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = ctx.req.param('params'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 20; diff --git a/lib/routes/liulinblog/itnews.js b/lib/routes/liulinblog/itnews.js index c86cd5ec1be1cd..4b6d2be02aafba 100644 --- a/lib/routes/liulinblog/itnews.js +++ b/lib/routes/liulinblog/itnews.js @@ -1,4 +1,4 @@ -module.exports = (ctx) => { +export default (ctx) => { const { channel } = ctx.req.param(); const redirectTo = `/liulinblog/${channel}`; ctx.redirect(redirectTo); diff --git a/lib/routes/liulinblog/router.js b/lib/routes/liulinblog/router.js index d3e364c968eb3c..425afe2004fd10 100644 --- a/lib/routes/liulinblog/router.js +++ b/lib/routes/liulinblog/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/itnews/:channel', './itnews'); router.get('/:params*', './'); }; diff --git a/lib/routes/liveuamap/index.js b/lib/routes/liveuamap/index.js index 9e6b8210c81b4c..6b5cc57470843e 100644 --- a/lib/routes/liveuamap/index.js +++ b/lib/routes/liveuamap/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const region = ctx.req.param('region') ?? 'ukraine'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; if (!isValidHost(region)) { diff --git a/lib/routes/liveuamap/router.js b/lib/routes/liveuamap/router.js index d7928c9f29bb61..9e26b6b5a4c31f 100644 --- a/lib/routes/liveuamap/router.js +++ b/lib/routes/liveuamap/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:region?', './'); }; diff --git a/lib/routes/lkong/forum.js b/lib/routes/lkong/forum.js index a066f81f7cbdf5..c71213e05e63c5 100644 --- a/lib/routes/lkong/forum.js +++ b/lib/routes/lkong/forum.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; const { viewForum, viewThread } = require('./query'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '8'; const digest = ctx.req.param('digest'); diff --git a/lib/routes/lkong/router.js b/lib/routes/lkong/router.js index 848bae446f2e82..c80cdc3267f380 100644 --- a/lib/routes/lkong/router.js +++ b/lib/routes/lkong/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/forum/:id?/:digest?', './forum'); router.get('/thread/:id', './thread'); }; diff --git a/lib/routes/lkong/thread.js b/lib/routes/lkong/thread.js index 14299837d0cd33..bea475a12f1f4c 100644 --- a/lib/routes/lkong/thread.js +++ b/lib/routes/lkong/thread.js @@ -5,7 +5,7 @@ import * as path from 'node:path'; const { viewThread, countReplies } = require('./query'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://www.lkong.com'; diff --git a/lib/routes/lofter/router.js b/lib/routes/lofter/router.js index cfc92cc98d8e49..0c9af68467f010 100644 --- a/lib/routes/lofter/router.js +++ b/lib/routes/lofter/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/tag/:name?/:type?', './tag'); router.get('/user/:name?', './user'); }; diff --git a/lib/routes/lofter/tag.js b/lib/routes/lofter/tag.js index 9a8584a4f8f172..a8e9cde4847fde 100644 --- a/lib/routes/lofter/tag.js +++ b/lib/routes/lofter/tag.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { JSDOM } = require('jsdom'); -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name') ?? '摄影'; const type = ctx.req.param('type') ?? 'new'; const pageSize = 20; diff --git a/lib/routes/lofter/user.js b/lib/routes/lofter/user.js index 2fb44da0ed14de..81716427be3466 100644 --- a/lib/routes/lofter/user.js +++ b/lib/routes/lofter/user.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name') ?? 'i'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : '50'; if (!isValidHost(name)) { diff --git a/lib/routes/logclub/index.js b/lib/routes/logclub/index.js index 6ddada6d57e82b..5891cf22d56a2b 100644 --- a/lib/routes/logclub/index.js +++ b/lib/routes/logclub/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'news' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 11; diff --git a/lib/routes/logclub/report.js b/lib/routes/logclub/report.js index 3797d2650afcee..a05c8979751c13 100644 --- a/lib/routes/logclub/report.js +++ b/lib/routes/logclub/report.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = 'Report' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 11; diff --git a/lib/routes/logclub/router.js b/lib/routes/logclub/router.js index fbb4b803044682..5421415a9cf1a4 100644 --- a/lib/routes/logclub/router.js +++ b/lib/routes/logclub/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/lc_report/:id?', './report'); router.get('/report/:id?', './report'); router.get('/:category*', './'); diff --git a/lib/routes/logonews/index.js b/lib/routes/logonews/index.js index b6d9cd65a1b86d..edcaa6eb9fab85 100644 --- a/lib/routes/logonews/index.js +++ b/lib/routes/logonews/index.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = getSubPath(ctx); const isWork = params.indexOf('/work') === 0; diff --git a/lib/routes/logonews/router.js b/lib/routes/logonews/router.js index 2f82924a30e212..8b994449379348 100644 --- a/lib/routes/logonews/router.js +++ b/lib/routes/logonews/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/work/tags/:tag', './index'); router.get('/tag/:tag', './index'); router.get('*', './index'); diff --git a/lib/routes/loltw/news.js b/lib/routes/loltw/news.js index 34eba4f2202b07..e2f6c05fe24180 100644 --- a/lib/routes/loltw/news.js +++ b/lib/routes/loltw/news.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const baseUrl = 'https://lol.garena.tw'; diff --git a/lib/routes/loltw/router.js b/lib/routes/loltw/router.js index 07a7a2990cfb44..ec7c5eda5bf4b4 100644 --- a/lib/routes/loltw/router.js +++ b/lib/routes/loltw/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:category?', './news'); }; diff --git a/lib/routes/lovelive-anime/news.js b/lib/routes/lovelive-anime/news.js index b35e2672d8f37c..97483a17723c73 100644 --- a/lib/routes/lovelive-anime/news.js +++ b/lib/routes/lovelive-anime/news.js @@ -5,7 +5,7 @@ import * as path from 'node:path'; import { art } from '@/utils/render'; const renderDescription = (desc) => art(path.join(__dirname, 'templates/description.art'), desc); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.lovelive-anime.jp/news/'; const response = await got(rootUrl); diff --git a/lib/routes/lovelive-anime/router.js b/lib/routes/lovelive-anime/router.js index 97249a4a0d8df2..e9d193c7e6f05b 100644 --- a/lib/routes/lovelive-anime/router.js +++ b/lib/routes/lovelive-anime/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:option?', './news'); router.get('/topics/:abbr/:category?/:option?', './topics'); router.get('/schedules/:serie?/:category?', './schedules'); diff --git a/lib/routes/lovelive-anime/schedules.js b/lib/routes/lovelive-anime/schedules.js index 526f5f7121fd5f..0e0e0ffc5a5c03 100644 --- a/lib/routes/lovelive-anime/schedules.js +++ b/lib/routes/lovelive-anime/schedules.js @@ -6,7 +6,7 @@ const dayjs = require('dayjs'); const utc = require('dayjs/plugin/utc'); const timezone = require('dayjs/plugin/timezone'); -module.exports = async (ctx) => { +export default async (ctx) => { dayjs.extend(utc); dayjs.extend(timezone); const serie = ctx.req.param('serie'); diff --git a/lib/routes/lovelive-anime/topics.js b/lib/routes/lovelive-anime/topics.js index 91eceaebd3db9e..a3debb22171631 100644 --- a/lib/routes/lovelive-anime/topics.js +++ b/lib/routes/lovelive-anime/topics.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; const renderDescription = (desc) => art(path.join(__dirname, 'templates/description.art'), desc); -module.exports = async (ctx) => { +export default async (ctx) => { const abbr = ctx.req.param('abbr'); const rootUrl = `https://www.lovelive-anime.jp/${abbr}`; const topicsUrlPart = 'yuigaoka' === abbr ? 'topics/' : 'topics.php'; diff --git a/lib/routes/lsnu/jiaowc/tzgg.js b/lib/routes/lsnu/jiaowc/tzgg.js index 0fdb70b8a6de66..b18930ab7056da 100644 --- a/lib/routes/lsnu/jiaowc/tzgg.js +++ b/lib/routes/lsnu/jiaowc/tzgg.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const url = category ? `https://jiaowc.lsnu.edu.cn/tzgg/${category}.htm` : 'https://jiaowc.lsnu.edu.cn/tzgg.htm'; diff --git a/lib/routes/lsnu/router.js b/lib/routes/lsnu/router.js index b4f0f92b54f763..367f97d1a1000b 100644 --- a/lib/routes/lsnu/router.js +++ b/lib/routes/lsnu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/jiaowc/tzgg/:category?', './jiaowc/tzgg'); }; diff --git a/lib/routes/luogu/contest.js b/lib/routes/luogu/contest.js index c6117e06a9389b..d0561bc26b9fba 100644 --- a/lib/routes/luogu/contest.js +++ b/lib/routes/luogu/contest.js @@ -26,7 +26,7 @@ const typeMap = { // }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `${baseUrl}/contest/list`; const { data: response } = await got(link); const $ = load(response); diff --git a/lib/routes/luogu/daily.js b/lib/routes/luogu/daily.js index 2cf26bb0d4623e..1413a1b850a2fa 100644 --- a/lib/routes/luogu/daily.js +++ b/lib/routes/luogu/daily.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 47327; const link = `https://www.luogu.com.cn/discuss/${id}`; const response = await got(link); diff --git a/lib/routes/luogu/router.js b/lib/routes/luogu/router.js index 285e83ab29fe1c..6c72d71067b9ac 100644 --- a/lib/routes/luogu/router.js +++ b/lib/routes/luogu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/contest', './contest'); router.get('/daily/:id?', './daily'); router.get('/user/feed/:uid', './user-feed'); diff --git a/lib/routes/luogu/user-blog.js b/lib/routes/luogu/user-blog.js index 7b13ca7325b2f7..49c4e708d743fa 100644 --- a/lib/routes/luogu/user-blog.js +++ b/lib/routes/luogu/user-blog.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const blogBaseUrl = `https://www.luogu.com.cn/blog/${name}/`; diff --git a/lib/routes/luogu/user-feed.js b/lib/routes/luogu/user-feed.js index 0cd80a561a555d..ca5abb5679648e 100644 --- a/lib/routes/luogu/user-feed.js +++ b/lib/routes/luogu/user-feed.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt(); -module.exports = async (ctx) => { +export default async (ctx) => { const getUsernameFromUID = (uid) => cache.tryGet('luogu:username:' + uid, async () => { const { data } = await got(`https://www.luogu.com.cn/user/${uid}?_contentOnly=1`); diff --git a/lib/routes/luxiangdong/archive.js b/lib/routes/luxiangdong/archive.js index b05c7ce7848d5d..4c7c594bf4e63a 100644 --- a/lib/routes/luxiangdong/archive.js +++ b/lib/routes/luxiangdong/archive.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got(`https://www.luxiangdong.com/content.json?t=${Date.now()}`); const items = data.posts.map((item) => ({ diff --git a/lib/routes/luxiangdong/router.js b/lib/routes/luxiangdong/router.js index 0022ae19963688..8651158c9a17f0 100644 --- a/lib/routes/luxiangdong/router.js +++ b/lib/routes/luxiangdong/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/archive', './archive'); }; diff --git a/lib/routes/lvv2/news.js b/lib/routes/lvv2/news.js index f4918d400f4be5..dad96f3e501ede 100644 --- a/lib/routes/lvv2/news.js +++ b/lib/routes/lvv2/news.js @@ -25,7 +25,7 @@ const titleMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const sort = (channel === 'sort-realtime' || channel === 'sort-score') && !ctx.req.param('sort') ? 't-week' : ctx.req.param('sort'); const url = `${rootUrl}/${channel}/${sort}`; diff --git a/lib/routes/lvv2/router.js b/lib/routes/lvv2/router.js index 8808e398015035..9e5f177cecb049 100644 --- a/lib/routes/lvv2/router.js +++ b/lib/routes/lvv2/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:channel/:sort?', './news'); router.get('/top/:channel/:sort?', './top'); }; diff --git a/lib/routes/lvv2/top.js b/lib/routes/lvv2/top.js index d926f5e0b32150..a54a67ec6a3c3c 100644 --- a/lib/routes/lvv2/top.js +++ b/lib/routes/lvv2/top.js @@ -25,7 +25,7 @@ const titleMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const sort = (channel === 'sort-realtime' || channel === 'sort-score') && !ctx.req.param('sort') ? 't-week' : ctx.req.param('sort'); const url = `${rootUrl}/${channel}/${sort}`; diff --git a/lib/routes/lxixsxa/discography.js b/lib/routes/lxixsxa/discography.js index 6bc2289ac4564e..d4302826980b78 100644 --- a/lib/routes/lxixsxa/discography.js +++ b/lib/routes/lxixsxa/discography.js @@ -4,7 +4,7 @@ const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const api = 'https://www.sonymusic.co.jp/json/v2/artist/lisa/discography/start/0/count/-1'; const url = 'https://www.sonymusic.co.jp/artist/lisa/discography'; diff --git a/lib/routes/lxixsxa/information.js b/lib/routes/lxixsxa/information.js index 278f379061580b..21f3856bea44e0 100644 --- a/lib/routes/lxixsxa/information.js +++ b/lib/routes/lxixsxa/information.js @@ -4,7 +4,7 @@ const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const api = 'https://www.sonymusic.co.jp/json/v2/artist/lisa/information/start/0/count/-1'; const url = 'https://www.sonymusic.co.jp/artist/lisa/info'; diff --git a/lib/routes/lxixsxa/router.js b/lib/routes/lxixsxa/router.js index 721528bd63e16e..83fac1471c1259 100644 --- a/lib/routes/lxixsxa/router.js +++ b/lib/routes/lxixsxa/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/info', './information'); router.get('/disco', './discography'); }; diff --git a/lib/routes/m4/index.js b/lib/routes/m4/index.js index 658bd725b699e5..57dbb82f8defb9 100644 --- a/lib/routes/m4/index.js +++ b/lib/routes/m4/index.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = 'news', category = 'china' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/m4/router.js b/lib/routes/m4/router.js index b514948995357f..fccbe3a58d2620 100644 --- a/lib/routes/m4/router.js +++ b/lib/routes/m4/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id?/:category*', './'); }; diff --git a/lib/routes/macfilos/blog.js b/lib/routes/macfilos/blog.js index e824551f09559f..c32cf8580bdacc 100644 --- a/lib/routes/macfilos/blog.js +++ b/lib/routes/macfilos/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.macfilos.com'; const currentUrl = `${rootUrl}/blog`; diff --git a/lib/routes/macfilos/router.js b/lib/routes/macfilos/router.js index 24a47bb2caf0b7..da5910733e49ed 100644 --- a/lib/routes/macfilos/router.js +++ b/lib/routes/macfilos/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog', './blog'); }; diff --git a/lib/routes/macmenubar/recently.js b/lib/routes/macmenubar/recently.js index 1a184da05fdf2b..af0da5c970542a 100644 --- a/lib/routes/macmenubar/recently.js +++ b/lib/routes/macmenubar/recently.js @@ -11,7 +11,7 @@ async function getCategoryId(categories) { return response.reduce((queryString, item) => queryString + item.id + ',', ''); } -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://macmenubar.com/wp-json/wp/v2/posts'; const categories = ctx.req.param('category'); const searchParams = { diff --git a/lib/routes/macmenubar/router.js b/lib/routes/macmenubar/router.js index 42df73db665c74..8cadc6c4d43dd8 100644 --- a/lib/routes/macmenubar/router.js +++ b/lib/routes/macmenubar/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/recently/:category?', './recently'); }; diff --git a/lib/routes/macupdate/app.js b/lib/routes/macupdate/app.js index f3890244998ad8..0e2ddd5b640070 100644 --- a/lib/routes/macupdate/app.js +++ b/lib/routes/macupdate/app.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { appId, appSlug } = ctx.req.param(); const baseUrl = 'https://www.macupdate.com'; const link = `${baseUrl}/app/mac/${appId}${appSlug ? `/${appSlug}` : ''}`; diff --git a/lib/routes/macupdate/router.js b/lib/routes/macupdate/router.js index e3dfd883cffa19..6ceebb8c0b2ee8 100644 --- a/lib/routes/macupdate/router.js +++ b/lib/routes/macupdate/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/app/:appId/:appSlug?', './app'); }; diff --git a/lib/routes/magazinelib/latest-magazine.js b/lib/routes/magazinelib/latest-magazine.js index 4e2747588fdbde..62dffd95e8bf6e 100644 --- a/lib/routes/magazinelib/latest-magazine.js +++ b/lib/routes/magazinelib/latest-magazine.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const host = 'https://magazinelib.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const query = ctx.req.param('query'); const url = `${host}/wp-json/wp/v2/posts/`; const response = await got({ diff --git a/lib/routes/magazinelib/router.js b/lib/routes/magazinelib/router.js index 5c8a66ba1c1db7..6203133c518cf0 100644 --- a/lib/routes/magazinelib/router.js +++ b/lib/routes/magazinelib/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/latest-magazine/:query?', './latest-magazine'); }; diff --git a/lib/routes/mail/imap.js b/lib/routes/mail/imap.js index d9d2afe28d4313..ded4cbf4daa1ca 100644 --- a/lib/routes/mail/imap.js +++ b/lib/routes/mail/imap.js @@ -5,7 +5,7 @@ const { simpleParser } = require('mailparser'); import logger from '@/utils/logger'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { email, folder = 'INBOX' } = ctx.req.param(); const { limit = 10 } = ctx.req.query(); const mailConfig = { diff --git a/lib/routes/mail/router.js b/lib/routes/mail/router.js index 0f5f92513ca5d7..d2c2ca54b5584f 100644 --- a/lib/routes/mail/router.js +++ b/lib/routes/mail/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/imap/:email/:folder*', './imap'); }; diff --git a/lib/routes/mangadex/index.js b/lib/routes/mangadex/index.js index 4332307d191817..493099a751a16a 100644 --- a/lib/routes/mangadex/index.js +++ b/lib/routes/mangadex/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id, lang } = ctx.req.param(); let { data } = await got.get(`https://api.mangadex.org/manga/${id}`); if (data.result === 'error') { diff --git a/lib/routes/mangadex/router.js b/lib/routes/mangadex/router.js index 3a18a40c31bd11..f9fdd781797824 100644 --- a/lib/routes/mangadex/router.js +++ b/lib/routes/mangadex/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id/:lang?', './index'); }; diff --git a/lib/routes/manhuagui/comic.js b/lib/routes/manhuagui/comic.js index 7430009c92be17..78b5f14cbd504f 100644 --- a/lib/routes/manhuagui/comic.js +++ b/lib/routes/manhuagui/comic.js @@ -43,7 +43,7 @@ const getChapters = ($) => { .reduce((acc, curr) => [...acc, ...curr]); }; -module.exports = async (ctx) => { +export default async (ctx) => { const { id, domain } = ctx.req.param(); if (domain === 'mhgui') { baseUrl = 'https://www.mhgui.com'; diff --git a/lib/routes/manhuagui/router.js b/lib/routes/manhuagui/router.js index 0fe544d7e731f4..3562246b21f5b5 100644 --- a/lib/routes/manhuagui/router.js +++ b/lib/routes/manhuagui/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/comic/:id/:chapterCnt?', './comic'); router.get('/:domain?/comic/:id/:chapterCnt?', './comic'); router.get('/subscribe', './subscribe'); diff --git a/lib/routes/manhuagui/subscribe.js b/lib/routes/manhuagui/subscribe.js index fed877ec9d810c..43effeb1cb8995 100644 --- a/lib/routes/manhuagui/subscribe.js +++ b/lib/routes/manhuagui/subscribe.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; import { config } from '@/config'; const web_url = 'https://www.manhuagui.com/user/book/shelf/1'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.manhuagui || !config.manhuagui.cookie) { throw new Error('manhuagui RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/mastodon/account-id.js b/lib/routes/mastodon/account-id.js index b7f998ea66cb7f..7c2de61db1225f 100644 --- a/lib/routes/mastodon/account-id.js +++ b/lib/routes/mastodon/account-id.js @@ -1,7 +1,7 @@ const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const site = ctx.req.param('site'); const account_id = ctx.req.param('account_id'); const only_media = ctx.req.param('only_media') ? 'true' : 'false'; diff --git a/lib/routes/mastodon/acct.js b/lib/routes/mastodon/acct.js index e3f5e07f9b7b39..57ac3a6a711411 100644 --- a/lib/routes/mastodon/acct.js +++ b/lib/routes/mastodon/acct.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const acct = ctx.req.param('acct'); const only_media = ctx.req.param('only_media') ? 'true' : 'false'; diff --git a/lib/routes/mastodon/router.js b/lib/routes/mastodon/router.js index 050a2ebb0302c4..4b21a81b5eabf2 100644 --- a/lib/routes/mastodon/router.js +++ b/lib/routes/mastodon/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/account_id/:site/:account_id/statuses/:only_media?', './account-id'); router.get('/acct/:acct/statuses/:only_media?', './acct'); router.get('/remote/:site/:only_media?', './timeline-remote'); diff --git a/lib/routes/mastodon/timeline-local.js b/lib/routes/mastodon/timeline-local.js index d7adb19919a343..973a0f8bc389b0 100644 --- a/lib/routes/mastodon/timeline-local.js +++ b/lib/routes/mastodon/timeline-local.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const site = ctx.req.param('site'); const only_media = ctx.req.param('only_media') ? 'true' : 'false'; if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) { diff --git a/lib/routes/mastodon/timeline-remote.js b/lib/routes/mastodon/timeline-remote.js index cb1deeb9fcda3d..1cb3a50b41c46d 100644 --- a/lib/routes/mastodon/timeline-remote.js +++ b/lib/routes/mastodon/timeline-remote.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const site = ctx.req.param('site'); const only_media = ctx.req.param('only_media') ? 'true' : 'false'; if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) { diff --git a/lib/routes/mckinsey/cn/index.js b/lib/routes/mckinsey/cn/index.js index e1fa7195936492..79a0dfccd8ccfd 100644 --- a/lib/routes/mckinsey/cn/index.js +++ b/lib/routes/mckinsey/cn/index.js @@ -8,7 +8,7 @@ const { categories } = require('./category-map'); const baseUrl = 'https://www.mckinsey.com.cn'; const endpoint = `${baseUrl}/wp-json`; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '25' } = ctx.req.param(); if (isNaN(category)) { categories.find((c) => c.slug === category); diff --git a/lib/routes/mckinsey/router.js b/lib/routes/mckinsey/router.js index a4490133057f6b..160ae620f34056 100644 --- a/lib/routes/mckinsey/router.js +++ b/lib/routes/mckinsey/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/cn/:category?', './cn/index'); }; diff --git a/lib/routes/mdpi/journal.js b/lib/routes/mdpi/journal.js index 9a354e46a7fa8f..3fa4d3e73d2d1f 100644 --- a/lib/routes/mdpi/journal.js +++ b/lib/routes/mdpi/journal.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); -module.exports = async (ctx) => { +export default async (ctx) => { const journal = ctx.req.param('journal'); const host = 'https://www.mdpi.com'; const jrnlUrl = `${host}/journal/${journal}`; diff --git a/lib/routes/mdpi/router.js b/lib/routes/mdpi/router.js index 7148520c808e75..c20cdcb03b1b39 100755 --- a/lib/routes/mdpi/router.js +++ b/lib/routes/mdpi/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:journal', './journal'); }; diff --git a/lib/routes/medieval-china/post.js b/lib/routes/medieval-china/post.js index fa68f6c001438e..7b23bc66c75044 100644 --- a/lib/routes/medieval-china/post.js +++ b/lib/routes/medieval-china/post.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://medieval-china.club'; const { data: response } = await got(baseUrl); const $ = load(response); diff --git a/lib/routes/medieval-china/router.js b/lib/routes/medieval-china/router.js index bc60719b9e786f..fa93efb97eb0f2 100644 --- a/lib/routes/medieval-china/router.js +++ b/lib/routes/medieval-china/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './post'); }; diff --git a/lib/routes/medium/following.js b/lib/routes/medium/following.js index 49f9cbc2a2947b..29ecd76ca18936 100644 --- a/lib/routes/medium/following.js +++ b/lib/routes/medium/following.js @@ -3,7 +3,7 @@ import { config } from '@/config'; const parseArticle = require('./parse-article.js'); const { getFollowingFeedQuery } = require('./graphql.js'); -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const cookie = config.medium.cookies[user]; diff --git a/lib/routes/medium/for-you.js b/lib/routes/medium/for-you.js index 29ff0a9e7369c2..2256d71d402e94 100644 --- a/lib/routes/medium/for-you.js +++ b/lib/routes/medium/for-you.js @@ -3,7 +3,7 @@ import { config } from '@/config'; const parseArticle = require('./parse-article.js'); const { getWebInlineRecommendedFeedQuery } = require('./graphql.js'); -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const cookie = config.medium.cookies[user]; diff --git a/lib/routes/medium/list.js b/lib/routes/medium/list.js index be7fda7fbeda61..ab020ddeb316f7 100644 --- a/lib/routes/medium/list.js +++ b/lib/routes/medium/list.js @@ -3,7 +3,7 @@ import { config } from '@/config'; const parseArticle = require('./parse-article.js'); const { getUserCatalogMainContentQuery } = require('./graphql.js'); -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const catalogId = ctx.req.param('catalogId'); diff --git a/lib/routes/medium/router.js b/lib/routes/medium/router.js index d4262c319d7842..e3f3554cb387c6 100644 --- a/lib/routes/medium/router.js +++ b/lib/routes/medium/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/following/:user', './following'); router.get('/for-you/:user', './for-you'); router.get('/list/:user/:catalogId', './list'); diff --git a/lib/routes/medium/tag.js b/lib/routes/medium/tag.js index 61646d40da35c4..4ce3c55231bdbd 100644 --- a/lib/routes/medium/tag.js +++ b/lib/routes/medium/tag.js @@ -3,7 +3,7 @@ import { config } from '@/config'; const parseArticle = require('./parse-article.js'); const { getWebInlineTopicFeedQuery } = require('./graphql.js'); -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const tag = ctx.req.param('tag'); diff --git a/lib/routes/medsci/index.js b/lib/routes/medsci/index.js index af02d036aac2ef..719fe8e08f6014 100644 --- a/lib/routes/medsci/index.js +++ b/lib/routes/medsci/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { let sid = ctx.req.param('sid') ?? ''; const tid = ctx.req.param('tid') ?? ''; diff --git a/lib/routes/medsci/router.js b/lib/routes/medsci/router.js index e6e1839289b26e..8bd5fb4f1a9ae9 100644 --- a/lib/routes/medsci/router.js +++ b/lib/routes/medsci/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:sid?/:tid?', './index'); }; diff --git a/lib/routes/metacritic/index.js b/lib/routes/metacritic/index.js index 7a8a6f8c7e67ec..6e3ac8cd167a6a 100644 --- a/lib/routes/metacritic/index.js +++ b/lib/routes/metacritic/index.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; const { sorts, types } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'game', sort = 'new', filter } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/metacritic/release.js b/lib/routes/metacritic/release.js index 9a8f7770ac44bf..e4c9d54ec8f322 100644 --- a/lib/routes/metacritic/release.js +++ b/lib/routes/metacritic/release.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { toTitleCase } from '@/utils/common-utils'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { let type = 'new-releases'; let title = 'New Releases'; diff --git a/lib/routes/metacritic/router.js b/lib/routes/metacritic/router.js index 2e555b3a243d4e..61300f6d2819b1 100644 --- a/lib/routes/metacritic/router.js +++ b/lib/routes/metacritic/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:type?/:sort?/:filter?', './'); }; diff --git a/lib/routes/meteor/boards.js b/lib/routes/meteor/boards.js index ae35918b4f56bb..c63105b224f140 100644 --- a/lib/routes/meteor/boards.js +++ b/lib/routes/meteor/boards.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { baseUrl, getBoards } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const items = await getBoards(cache.tryGet); ctx.set('data', { diff --git a/lib/routes/meteor/index.js b/lib/routes/meteor/index.js index ff3396d6197f29..7dc05b207308b4 100644 --- a/lib/routes/meteor/index.js +++ b/lib/routes/meteor/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, getBoards, renderDesc } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { let { board = 'all' } = ctx.req.param(); const boards = await getBoards(cache.tryGet); diff --git a/lib/routes/meteor/router.js b/lib/routes/meteor/router.js index 9411645bc51ece..c4223ab36acf66 100644 --- a/lib/routes/meteor/router.js +++ b/lib/routes/meteor/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/boards', './boards'); router.get('/:board?', './index'); }; diff --git a/lib/routes/metmuseum/exhibitions.js b/lib/routes/metmuseum/exhibitions.js index c256c419c46961..84d35e3806f294 100644 --- a/lib/routes/metmuseum/exhibitions.js +++ b/lib/routes/metmuseum/exhibitions.js @@ -11,7 +11,7 @@ function generateExhibitionItem(result) { }; } -module.exports = async (ctx) => { +export default async (ctx) => { const searchType = ctx.req.param('state') ?? 'current'; const url = `https://www.metmuseum.org/ghidorah/ExhibitionListing/Search?searchType=${searchType}`; diff --git a/lib/routes/metmuseum/router.js b/lib/routes/metmuseum/router.js index ca342afb7ca8dd..80cefced5df934 100644 --- a/lib/routes/metmuseum/router.js +++ b/lib/routes/metmuseum/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/exhibitions/:state?', './exhibitions'); }; diff --git a/lib/routes/mihoyo/bbs/follow-list.js b/lib/routes/mihoyo/bbs/follow-list.js index 08a50d6496cd9e..24890d93318a41 100644 --- a/lib/routes/mihoyo/bbs/follow-list.js +++ b/lib/routes/mihoyo/bbs/follow-list.js @@ -5,7 +5,7 @@ const cache = require('./cache'); const renderDescription = (description, images) => art(path.join(__dirname, '../templates/description.art'), { description, images }); -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const page_size = ctx.req.query('limit') || '20'; const searchParams = { diff --git a/lib/routes/mihoyo/bbs/img-ranking.js b/lib/routes/mihoyo/bbs/img-ranking.js index 5fb0f9a879a656..925a7f6711ebe9 100644 --- a/lib/routes/mihoyo/bbs/img-ranking.js +++ b/lib/routes/mihoyo/bbs/img-ranking.js @@ -38,7 +38,7 @@ const getRankingTypeInfo = (game, ranking_type) => { }; }; -module.exports = async (ctx) => { +export default async (ctx) => { const game = ctx.req.param('game'); const routeParams = Object.fromEntries(new URLSearchParams(ctx.req.param('routeParams'))); const { forumType: forum_type = 'tongren', cateType: cate_type, rankingType: ranking_type, lastId: last_id = '' } = routeParams; diff --git a/lib/routes/mihoyo/bbs/official.js b/lib/routes/mihoyo/bbs/official.js index 4882793b0266f4..13a84ed643ca87 100644 --- a/lib/routes/mihoyo/bbs/official.js +++ b/lib/routes/mihoyo/bbs/official.js @@ -17,7 +17,7 @@ const TYPE_MAP = { 3: '资讯', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { gids, type = '2', page_size = '20', last_id = '' } = ctx.req.param(); const query = new URLSearchParams({ gids, diff --git a/lib/routes/mihoyo/bbs/timeline.js b/lib/routes/mihoyo/bbs/timeline.js index abea838cb9a939..fc96d8fe0b592b 100644 --- a/lib/routes/mihoyo/bbs/timeline.js +++ b/lib/routes/mihoyo/bbs/timeline.js @@ -3,7 +3,7 @@ const cache = require('./cache'); import { config } from '@/config'; const { post2item } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.mihoyo.cookie) { throw new Error('Miyoushe Timeline is not available due to the absense of [Miyoushe Cookie]. Check relevant config tutorial'); } diff --git a/lib/routes/mihoyo/bbs/user-post.js b/lib/routes/mihoyo/bbs/user-post.js index 5871b975909c74..a5c0cd0ef0e283 100644 --- a/lib/routes/mihoyo/bbs/user-post.js +++ b/lib/routes/mihoyo/bbs/user-post.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { post2item } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const size = ctx.req.query('limit') || '20'; const searchParams = { diff --git a/lib/routes/mihoyo/router.js b/lib/routes/mihoyo/router.js index 23bceca5f45c5e..b4a4f25831ec03 100644 --- a/lib/routes/mihoyo/router.js +++ b/lib/routes/mihoyo/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/bbs/follow-list/:uid', './bbs/follow-list'); router.get('/bbs/img-ranking/:game/:routeParams?', './bbs/img-ranking'); router.get('/bbs/official/:gids/:type?/:page_size?/:last_id?', './bbs/official'); diff --git a/lib/routes/mihoyo/sr/news.js b/lib/routes/mihoyo/sr/news.js index 9618915d016463..41ab69ffc5436d 100644 --- a/lib/routes/mihoyo/sr/news.js +++ b/lib/routes/mihoyo/sr/news.js @@ -42,7 +42,7 @@ const categories = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { // location 地区 category 类型 const { location = 'zh-cn', category = 'news-all' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; diff --git a/lib/routes/mihoyo/ys/news.js b/lib/routes/mihoyo/ys/news.js index 84148af7575c2b..d3cd4faa5cb51f 100644 --- a/lib/routes/mihoyo/ys/news.js +++ b/lib/routes/mihoyo/ys/news.js @@ -76,7 +76,7 @@ const apiUrls = { 'zh-tw': '/content_v2_user/app/a1b1f9d3315447cc/getContentList', }; -module.exports = async (ctx) => { +export default async (ctx) => { const location = ctx.req.param('location') ?? 'main'; const category = ctx.req.param('category') ?? 'latest'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; diff --git a/lib/routes/mindmeister/example.js b/lib/routes/mindmeister/example.js index 89e1f9864f3bd6..61a919031d7e69 100644 --- a/lib/routes/mindmeister/example.js +++ b/lib/routes/mindmeister/example.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const baseUrl = 'https://www.mindmeister.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'mind-map-examples', language = 'en' } = ctx.req.param(); const link = `${baseUrl}${language === 'en' || language === 'other' ? '' : `/${language}`}/${category === 'mind-map-examples' ? category : `mind-maps/${category}?language=${language}`}`; const respsonse = await got(link); diff --git a/lib/routes/mindmeister/router.js b/lib/routes/mindmeister/router.js index 19abba14d2eb04..6b11823f5d080d 100644 --- a/lib/routes/mindmeister/router.js +++ b/lib/routes/mindmeister/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?/:language?', './example'); }; diff --git a/lib/routes/minecraft/router.js b/lib/routes/minecraft/router.js index e224e7aad1d6d4..66109a2016ac2d 100644 --- a/lib/routes/minecraft/router.js +++ b/lib/routes/minecraft/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/version', './version'); }; diff --git a/lib/routes/minecraft/version.js b/lib/routes/minecraft/version.js index bb482dd58833c6..10a717a5dbb20b 100644 --- a/lib/routes/minecraft/version.js +++ b/lib/routes/minecraft/version.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://launchermeta.mojang.com/mc/game/version_manifest.json'; const response = await got({ diff --git a/lib/routes/mingpao/index.js b/lib/routes/mingpao/index.js index 6383638a8edc75..eba6d5366cf143 100644 --- a/lib/routes/mingpao/index.js +++ b/lib/routes/mingpao/index.js @@ -18,7 +18,7 @@ const renderDesc = (media, desc) => desc, }); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'ins'; const category = ctx.req.param('category') ?? (type === 'ins' ? 'all' : 's00001'); const link = `https://news.mingpao.com/rss/${type}/${category}.xml`; diff --git a/lib/routes/mingpao/router.js b/lib/routes/mingpao/router.js index c57b4b9b661e8a..8591b506201fae 100644 --- a/lib/routes/mingpao/router.js +++ b/lib/routes/mingpao/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?/:category?', './index'); }; diff --git a/lib/routes/mirror/index.js b/lib/routes/mirror/index.js index 5ef1e43b329bef..ff7db76c089944 100644 --- a/lib/routes/mirror/index.js +++ b/lib/routes/mirror/index.js @@ -6,7 +6,7 @@ const md = require('markdown-it')({ }); import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); if (!id.endsWith('.eth') && !isValidHost(id)) { throw new Error('Invalid id'); diff --git a/lib/routes/mirror/router.js b/lib/routes/mirror/router.js index de87b52670c7db..c79f907ed7d0b5 100644 --- a/lib/routes/mirror/router.js +++ b/lib/routes/mirror/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id', './index'); }; diff --git a/lib/routes/missav/new.js b/lib/routes/missav/new.js index a90c32395055a8..dfc9b79eaf9677 100644 --- a/lib/routes/missav/new.js +++ b/lib/routes/missav/new.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://missav.com'; const { data: response } = await got(`${baseUrl}/dm397/new`); const $ = load(response); diff --git a/lib/routes/missav/router.js b/lib/routes/missav/router.js index 7ef289f8692524..b850a6c370994e 100644 --- a/lib/routes/missav/router.js +++ b/lib/routes/missav/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/new', './new'); }; diff --git a/lib/routes/misskey/featured-notes.js b/lib/routes/misskey/featured-notes.js index e5dd4a1a8321cb..12245e99c6bc73 100644 --- a/lib/routes/misskey/featured-notes.js +++ b/lib/routes/misskey/featured-notes.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const site = ctx.req.param('site'); if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) { throw new Error(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`); diff --git a/lib/routes/misskey/router.js b/lib/routes/misskey/router.js index 390d9404f5e1ee..e91487e3fd7a64 100644 --- a/lib/routes/misskey/router.js +++ b/lib/routes/misskey/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/notes/featured/:site', './featured-notes'); }; diff --git a/lib/routes/mittrchina/index.js b/lib/routes/mittrchina/index.js index 76c8b2e672f022..038737f10479fd 100644 --- a/lib/routes/mittrchina/index.js +++ b/lib/routes/mittrchina/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const typeMap = { breaking: { title: '快讯', diff --git a/lib/routes/mittrchina/router.js b/lib/routes/mittrchina/router.js index ace1433b9c3a0d..e2f6d76d38137b 100644 --- a/lib/routes/mittrchina/router.js +++ b/lib/routes/mittrchina/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:type?', './'); }; diff --git a/lib/routes/mixcloud/index.js b/lib/routes/mixcloud/index.js index d690e89e0f282d..4271527cc44241 100644 --- a/lib/routes/mixcloud/index.js +++ b/lib/routes/mixcloud/index.js @@ -3,7 +3,7 @@ const CryptoJS = require('crypto-js'); import { parseDate } from '@/utils/parse-date'; const { queries } = require('./queries'); -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://www.mixcloud.com'; const imageBaseURL = 'https://thumbnailer.mixcloud.com/unsafe/480x480/'; const graphqlURL = 'https://app.mixcloud.com/graphql'; diff --git a/lib/routes/mixcloud/router.js b/lib/routes/mixcloud/router.js index 8b09b1efdeb3c0..2d7a70a2110862 100644 --- a/lib/routes/mixcloud/router.js +++ b/lib/routes/mixcloud/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:username/:type?', './index'); }; diff --git a/lib/routes/modb/router.js b/lib/routes/modb/router.js index e03a81d1a5b042..b9f5c8ad5d3827 100644 --- a/lib/routes/modb/router.js +++ b/lib/routes/modb/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/topic/:id', './topic'); }; diff --git a/lib/routes/modb/topic.js b/lib/routes/modb/topic.js index 87f5571d9b35e4..1cc16a91f0ca41 100644 --- a/lib/routes/modb/topic.js +++ b/lib/routes/modb/topic.js @@ -5,7 +5,7 @@ import logger from '@/utils/logger'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.modb.pro'; const topicId = ctx.req.param('id'); const response = await got({ diff --git a/lib/routes/modelscope/community.js b/lib/routes/modelscope/community.js index 66bba2758e8f70..34d1558ee18f23 100644 --- a/lib/routes/modelscope/community.js +++ b/lib/routes/modelscope/community.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://community.modelscope.cn'; const { data } = await got.post(`${baseUrl}/v1/namespace_page/article`, { diff --git a/lib/routes/modelscope/datasets.js b/lib/routes/modelscope/datasets.js index ac28bed7fcdd86..90c912bfb171fe 100644 --- a/lib/routes/modelscope/datasets.js +++ b/lib/routes/modelscope/datasets.js @@ -8,7 +8,7 @@ import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://modelscope.cn'; const link = `${baseUrl}/datasets`; diff --git a/lib/routes/modelscope/models.js b/lib/routes/modelscope/models.js index c300534bea1061..ffd73aeb644dfb 100644 --- a/lib/routes/modelscope/models.js +++ b/lib/routes/modelscope/models.js @@ -6,7 +6,7 @@ const md = require('markdown-it')({ }); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://modelscope.cn'; const link = `${baseUrl}/models`; diff --git a/lib/routes/modelscope/router.js b/lib/routes/modelscope/router.js index 97aa6289472add..5ef5a762a88a8e 100644 --- a/lib/routes/modelscope/router.js +++ b/lib/routes/modelscope/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/community', './community'); router.get('/datasets', './datasets'); router.get('/models', './models'); diff --git a/lib/routes/modelscope/studios.js b/lib/routes/modelscope/studios.js index f2eb2cc11d8c2b..fc17bcc69716fe 100644 --- a/lib/routes/modelscope/studios.js +++ b/lib/routes/modelscope/studios.js @@ -8,7 +8,7 @@ import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://modelscope.cn'; const link = `${baseUrl}/studios`; diff --git a/lib/routes/modrinth/router.js b/lib/routes/modrinth/router.js index 0d888053b19734..fd0f19b940cf48 100644 --- a/lib/routes/modrinth/router.js +++ b/lib/routes/modrinth/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/project/:id/versions/:routeParams?', './versions'); }; diff --git a/lib/routes/mohw/clarification.js b/lib/routes/mohw/clarification.js index 0d5654bd3baa76..8ad67fecf64b69 100644 --- a/lib/routes/mohw/clarification.js +++ b/lib/routes/mohw/clarification.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.mohw.gov.tw'; const currentUrl = `${rootUrl}/lp-17-1.html`; diff --git a/lib/routes/mohw/router.js b/lib/routes/mohw/router.js index 8c1be8edc48a33..18f2af2267c89d 100644 --- a/lib/routes/mohw/router.js +++ b/lib/routes/mohw/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/clarification', './clarification'); }; diff --git a/lib/routes/mox/index.js b/lib/routes/mox/index.js index c05ba4abe5cc2a..3367aab42b830f 100644 --- a/lib/routes/mox/index.js +++ b/lib/routes/mox/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://mox.moe'; diff --git a/lib/routes/mox/router.js b/lib/routes/mox/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/mox/router.js +++ b/lib/routes/mox/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/mpaypass/main.js b/lib/routes/mpaypass/main.js index a31ea6ecc9e432..a697868a9179e7 100644 --- a/lib/routes/mpaypass/main.js +++ b/lib/routes/mpaypass/main.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = '' } = ctx.req.param(); const title_url = type ? `http://www.mpaypass.com.cn/${type}.html` : 'http://www.mpaypass.com.cn'; diff --git a/lib/routes/mpaypass/news.js b/lib/routes/mpaypass/news.js index 869d3e3866a4e0..a3db5318d28716 100644 --- a/lib/routes/mpaypass/news.js +++ b/lib/routes/mpaypass/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://m.mpaypass.com.cn'; const listData = await got(link); const $list = load(listData.data); diff --git a/lib/routes/mpaypass/router.js b/lib/routes/mpaypass/router.js index 1e2f18541de3dd..7811c54a756ea1 100644 --- a/lib/routes/mpaypass/router.js +++ b/lib/routes/mpaypass/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/main/:type?', './main'); router.get('/news', './news'); }; diff --git a/lib/routes/mrdx/daily.js b/lib/routes/mrdx/daily.js index 8ff3505de46dfe..80088f700daac4 100644 --- a/lib/routes/mrdx/daily.js +++ b/lib/routes/mrdx/daily.js @@ -8,7 +8,7 @@ dayjs.extend(utc); import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const dateFormatted = dayjs().utcOffset(8).format('YYYYMMDD'); const baseUrl = `http://mrdx.cn/content/${dateFormatted}`; diff --git a/lib/routes/mrdx/router.js b/lib/routes/mrdx/router.js index 53168ee8b6736b..478f6624e48367 100644 --- a/lib/routes/mrdx/router.js +++ b/lib/routes/mrdx/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/today', './daily'); }; diff --git a/lib/routes/mrm/index.js b/lib/routes/mrm/index.js index 36b81c7932654d..06bc5620cf8352 100644 --- a/lib/routes/mrm/index.js +++ b/lib/routes/mrm/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'zonghezixun3' } = ctx.req.param(); const baseUrl = 'http://www.mrm.com.cn'; const link = `${baseUrl}/${category}.html`; diff --git a/lib/routes/mrm/router.js b/lib/routes/mrm/router.js index 5db50869af4b34..0bcd82a5c2aa19 100644 --- a/lib/routes/mrm/router.js +++ b/lib/routes/mrm/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/mvm/index.js b/lib/routes/mvm/index.js index 222e201d35f49d..8889441bb4f9fa 100644 --- a/lib/routes/mvm/index.js +++ b/lib/routes/mvm/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'bqym'; const rootUrl = 'http://www.mwm.net.cn'; diff --git a/lib/routes/mvm/router.js b/lib/routes/mvm/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/mvm/router.js +++ b/lib/routes/mvm/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/mydrivers/cid.js b/lib/routes/mydrivers/cid.js index 349878f099c6c7..808c6e7b34dd4f 100644 --- a/lib/routes/mydrivers/cid.js +++ b/lib/routes/mydrivers/cid.js @@ -4,7 +4,7 @@ import parser from '@/utils/rss-parser'; const { rootUrl, rootRSSUrl, title, categories, getInfo, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 100; diff --git a/lib/routes/mydrivers/index.js b/lib/routes/mydrivers/index.js index ca3a91f60cd381..14a45457552028 100644 --- a/lib/routes/mydrivers/index.js +++ b/lib/routes/mydrivers/index.js @@ -8,7 +8,7 @@ import * as path from 'node:path'; const { rootUrl, title, categories, convertToQueryString, getInfo, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { let { category = 'new' } = ctx.req.param(); let newTitle = ''; diff --git a/lib/routes/mydrivers/rank.js b/lib/routes/mydrivers/rank.js index 53ac512cfe490a..409c00c5b60085 100644 --- a/lib/routes/mydrivers/rank.js +++ b/lib/routes/mydrivers/rank.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const { rootUrl, getInfo, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { range = '0' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/mydrivers/router.js b/lib/routes/mydrivers/router.js index b8cac1f1312ed6..a802b49c331b8e 100644 --- a/lib/routes/mydrivers/router.js +++ b/lib/routes/mydrivers/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/cid/:id?', './cid'); router.get('/rank/:range?', './rank'); router.get('/zhibo', './cid'); diff --git a/lib/routes/myfigurecollection/activity.js b/lib/routes/myfigurecollection/activity.js index eb24af94ea3b1f..6d6acb599d9fa4 100644 --- a/lib/routes/myfigurecollection/activity.js +++ b/lib/routes/myfigurecollection/activity.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '-1'; const language = ctx.req.param('language') ?? ''; const latestAdditions = ctx.req.param('latestAdditions') ?? '1'; diff --git a/lib/routes/myfigurecollection/index.js b/lib/routes/myfigurecollection/index.js index f0e3584a141e55..e669290e3e2ebf 100644 --- a/lib/routes/myfigurecollection/index.js +++ b/lib/routes/myfigurecollection/index.js @@ -11,7 +11,7 @@ const shortcuts = { potm: 'picture/browse/potm/', }; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? ''; const category = ctx.req.param('category') ?? 'figure'; if (language && !isValidHost(language)) { diff --git a/lib/routes/myfigurecollection/router.js b/lib/routes/myfigurecollection/router.js index 2e284ad82b2323..4a21404ed5d556 100644 --- a/lib/routes/myfigurecollection/router.js +++ b/lib/routes/myfigurecollection/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/activity/:category?/:language?/:latestAdditions?/:latestEdits?/:latestAlerts?/:latestPictures?', './activity'); router.get('/:category?/:language?', './index'); }; diff --git a/lib/routes/mygopen/index.js b/lib/routes/mygopen/index.js index 131b84b6d9ebf8..e892c0f35bf600 100644 --- a/lib/routes/mygopen/index.js +++ b/lib/routes/mygopen/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const label = ctx.req.param('label') ?? ''; const rootUrl = 'https://www.mygopen.com'; diff --git a/lib/routes/mygopen/router.js b/lib/routes/mygopen/router.js index 22891612f20bdf..cd2f44358e3e84 100644 --- a/lib/routes/mygopen/router.js +++ b/lib/routes/mygopen/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:label?', './index'); }; diff --git a/lib/routes/mymusicsheet/router.js b/lib/routes/mymusicsheet/router.js index a372dae05d6286..aea58bea530879 100644 --- a/lib/routes/mymusicsheet/router.js +++ b/lib/routes/mymusicsheet/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/user/sheets/:username/:iso?/:freeOnly?', './usersheets'); }; diff --git a/lib/routes/mymusicsheet/usersheets.js b/lib/routes/mymusicsheet/usersheets.js index b5d2239db61c35..1a029804c3ca6b 100644 --- a/lib/routes/mymusicsheet/usersheets.js +++ b/lib/routes/mymusicsheet/usersheets.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.mymusicsheet.com'; const graphqlUrl = 'https://mms.pd.mapia.io/mms/graphql'; const exchangeRateUrl = 'https://payport.pd.mapia.io/v2/currency'; diff --git a/lib/routes/mysql/release.js b/lib/routes/mysql/release.js index e8801ca2c9912d..ac107baafa9787 100644 --- a/lib/routes/mysql/release.js +++ b/lib/routes/mysql/release.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const version = ctx.req.param('version') ?? '8.0'; const rootUrl = 'https://dev.mysql.com'; diff --git a/lib/routes/mysql/router.js b/lib/routes/mysql/router.js index 4fb2a0e18168b0..cd7e499d1661c4 100644 --- a/lib/routes/mysql/router.js +++ b/lib/routes/mysql/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/release/:version?', './release'); }; diff --git a/lib/routes/nasa/apod-cn.js b/lib/routes/nasa/apod-cn.js index a4d846fb3d4640..572dacb8c81cd8 100644 --- a/lib/routes/nasa/apod-cn.js +++ b/lib/routes/nasa/apod-cn.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; const rootUrl = `https://www.nasachina.cn/wp-json/wp/v2/posts?categories=2&per_page=${limit}`; const { data } = await got({ diff --git a/lib/routes/nasa/apod-ncku.js b/lib/routes/nasa/apod-ncku.js index a7bcf9b791a32f..c363505fd617e2 100644 --- a/lib/routes/nasa/apod-ncku.js +++ b/lib/routes/nasa/apod-ncku.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; const rootUrl = 'http://sprite.phys.ncku.edu.tw/astrolab/mirrors/apod/archivepix.html'; const response = await got({ diff --git a/lib/routes/nasa/apod.js b/lib/routes/nasa/apod.js index b2db07200ac827..d37488c74b2129 100644 --- a/lib/routes/nasa/apod.js +++ b/lib/routes/nasa/apod.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; const rootUrl = 'https://apod.nasa.gov/apod/archivepix.html'; const response = await got({ diff --git a/lib/routes/nasa/router.js b/lib/routes/nasa/router.js index e22b2b4bab50b4..243cccc7d07efe 100644 --- a/lib/routes/nasa/router.js +++ b/lib/routes/nasa/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/apod', './apod'); router.get('/apod-ncku', './apod-ncku'); router.get('/apod-cn', './apod-cn'); diff --git a/lib/routes/natgeo/dailyphoto.js b/lib/routes/natgeo/dailyphoto.js index 999149f4fbaa42..bc1837ad24beaa 100644 --- a/lib/routes/natgeo/dailyphoto.js +++ b/lib/routes/natgeo/dailyphoto.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.nationalgeographic.com'; const apiUrl = `${rootUrl}/photo-of-the-day`; const response = await cache.tryGet(apiUrl, async () => (await got(apiUrl)).data, config.cache.contentExpire, false); diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index ded9bad7af2be9..944b920ea42a42 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'http://dili.bdatu.com/jiekou/mains/p1.html'; const data = await got(host); diff --git a/lib/routes/natgeo/natgeo.js b/lib/routes/natgeo/natgeo.js index d2cb84c8e467c6..2397a988089a7b 100644 --- a/lib/routes/natgeo/natgeo.js +++ b/lib/routes/natgeo/natgeo.js @@ -26,7 +26,7 @@ async function loadContent(link) { }; } -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? ''; const url = `https://www.natgeomedia.com/${ctx.req.param('cat')}/${type}`; const res = await got(url); diff --git a/lib/routes/natgeo/router.js b/lib/routes/natgeo/router.js index 26cb29ebe21f5c..e93a2f2cc9faa7 100644 --- a/lib/routes/natgeo/router.js +++ b/lib/routes/natgeo/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/dailyphoto', './dailyphoto'); router.get('/dailyselection', './dailyselection'); router.get('/:cat/:type?', './natgeo'); diff --git a/lib/routes/nationalgeographic/latest-stories.js b/lib/routes/nationalgeographic/latest-stories.js index 3066088f95bb97..61bbd78bd39807 100644 --- a/lib/routes/nationalgeographic/latest-stories.js +++ b/lib/routes/nationalgeographic/latest-stories.js @@ -12,7 +12,7 @@ const findNatgeo = ($) => .match(/\['__natgeo__']=({.*?});/)[1] ); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = 'https://www.nationalgeographic.com/pages/topic/latest-stories'; const response = await got(currentUrl); const $ = load(response.data); diff --git a/lib/routes/nationalgeographic/router.js b/lib/routes/nationalgeographic/router.js index 209cbac9455531..6ca7e0685fcf28 100644 --- a/lib/routes/nationalgeographic/router.js +++ b/lib/routes/nationalgeographic/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/latest-stories', './latest-stories'); }; diff --git a/lib/routes/nature/cover.js b/lib/routes/nature/cover.js index 2963f47efa1d36..1cc71ddb081737 100644 --- a/lib/routes/nature/cover.js +++ b/lib/routes/nature/cover.js @@ -21,7 +21,7 @@ import { parseDate } from '@/utils/parse-date'; const { baseUrl, journalMap } = require('./utils'); const { CookieJar } = require('tough-cookie'); -module.exports = async (ctx) => { +export default async (ctx) => { const cookieJar = new CookieJar(); await got('https://www.nature.com', { cookieJar }); diff --git a/lib/routes/nature/highlight.js b/lib/routes/nature/highlight.js index 6df738fbac197f..f31e23b84d5487 100644 --- a/lib/routes/nature/highlight.js +++ b/lib/routes/nature/highlight.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; const { baseUrl, cookieJar, getArticleList, getArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { journal = 'nature' } = ctx.req.param(); const url = `${baseUrl}/${journal}/articles?type=research-highlight`; diff --git a/lib/routes/nature/news-and-comment.js b/lib/routes/nature/news-and-comment.js index 438bc4c43060d1..d92e4cf40c69e6 100644 --- a/lib/routes/nature/news-and-comment.js +++ b/lib/routes/nature/news-and-comment.js @@ -16,7 +16,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; const { baseUrl, cookieJar, getArticleList, getArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const journal = ctx.req.param('journal'); const pageURL = `${baseUrl}/${journal}/news-and-comment`; diff --git a/lib/routes/nature/news.js b/lib/routes/nature/news.js index ce0b894aa2aca5..b624ebaf4114dd 100644 --- a/lib/routes/nature/news.js +++ b/lib/routes/nature/news.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, cookieJar, getArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${baseUrl}/latest-news`; const res = await got(url, { cookieJar }); const $ = load(res.data); diff --git a/lib/routes/nature/research.js b/lib/routes/nature/research.js index c4f948cd9b641d..077f060aec5126 100644 --- a/lib/routes/nature/research.js +++ b/lib/routes/nature/research.js @@ -17,7 +17,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; const { baseUrl, cookieJar, getArticleList, getDataLayer, getArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const journal = ctx.req.param('journal') ?? 'nature'; const pageURL = `${baseUrl}/${journal}/research-articles`; diff --git a/lib/routes/nature/router.js b/lib/routes/nature/router.js index b1c7746969f384..f74be80b97ef34 100644 --- a/lib/routes/nature/router.js +++ b/lib/routes/nature/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/cover', './cover'); router.get('/highlight/:journal?', './highlight'); router.get('/news', './news'); diff --git a/lib/routes/nature/siteindex.js b/lib/routes/nature/siteindex.js index dfac4ae0d4e6ee..289e80afefde0c 100644 --- a/lib/routes/nature/siteindex.js +++ b/lib/routes/nature/siteindex.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl, cookieJar } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(`${baseUrl}/siteindex`, { cookieJar }); const $ = load(response.data); diff --git a/lib/routes/nautil/router.js b/lib/routes/nautil/router.js index 44d84f54478be2..cea838f2646fe0 100644 --- a/lib/routes/nautil/router.js +++ b/lib/routes/nautil/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/topic/:tid', './topics'); }; diff --git a/lib/routes/nautil/topics.js b/lib/routes/nautil/topics.js index cf045af096975f..254254ed42aa16 100644 --- a/lib/routes/nautil/topics.js +++ b/lib/routes/nautil/topics.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const baseUrl = 'https://nautil.us'; -module.exports = async (ctx) => { +export default async (ctx) => { const categoryIdMap = await cache.tryGet('nautil:categories', async () => { const { data } = await got(`${baseUrl}/wp-json/wp/v2/categories`, { searchParams: { diff --git a/lib/routes/nbd/daily.js b/lib/routes/nbd/daily.js index f46f5d44c311aa..a5a5398d83d761 100644 --- a/lib/routes/nbd/daily.js +++ b/lib/routes/nbd/daily.js @@ -1,3 +1,3 @@ -module.exports = (ctx) => { +export default (ctx) => { ctx.redirect('/nbd/332'); }; diff --git a/lib/routes/nbd/index.js b/lib/routes/nbd/index.js index fabb8da76847ae..3d4568e0847b9d 100644 --- a/lib/routes/nbd/index.js +++ b/lib/routes/nbd/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '3'; const rootUrl = 'https://www.nbd.com.cn'; diff --git a/lib/routes/nbd/router.js b/lib/routes/nbd/router.js index 74756a2e88c662..016eba827d08ea 100644 --- a/lib/routes/nbd/router.js +++ b/lib/routes/nbd/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/daily', './daily'); router.get('/:id?', './index'); }; diff --git a/lib/routes/nber/index.js b/lib/routes/nber/index.js index e4de3045ced72f..1791ad018dbf44 100644 --- a/lib/routes/nber/index.js +++ b/lib/routes/nber/index.js @@ -12,7 +12,7 @@ async function getData(url) { return response.results; } -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.nber.org/api/v1/working_page_listing/contentType/working_paper/_/_/search'; const baseUrl = 'https://www.nber.org'; const data = await cache.tryGet(url, () => getData(url), config.cache.routeExpire, false); diff --git a/lib/routes/nber/router.js b/lib/routes/nber/router.js index 1f2cd5a811bd3e..d389d0913b66bf 100644 --- a/lib/routes/nber/router.js +++ b/lib/routes/nber/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/papers', '.'); router.get('/news', '.'); }; diff --git a/lib/routes/ncc-cma/cmdp.js b/lib/routes/ncc-cma/cmdp.js index d2a44ad2c0f964..5152f0ae5d1fa6 100644 --- a/lib/routes/ncc-cma/cmdp.js +++ b/lib/routes/ncc-cma/cmdp.js @@ -5,7 +5,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const iconv = require('iconv-lite'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/ncc-cma/router.js b/lib/routes/ncc-cma/router.js index e2d52a407d5fb3..83b9dae976478e 100644 --- a/lib/routes/ncc-cma/router.js +++ b/lib/routes/ncc-cma/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/cmdp/image/:id*', './cmdp'); }; diff --git a/lib/routes/ncepu/master/masterinfo.js b/lib/routes/ncepu/master/masterinfo.js index 9d3992003e73a4..fc640401ca9e86 100644 --- a/lib/routes/ncepu/master/masterinfo.js +++ b/lib/routes/ncepu/master/masterinfo.js @@ -20,7 +20,7 @@ const url_map = { pyxx: 'pyxx/pyxx', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const response = await got(`https://yjsy.ncepu.edu.cn/${url_map[type]}/index.htm`); const data = response.data; // 获取页面 html 数据 diff --git a/lib/routes/ncepu/router.js b/lib/routes/ncepu/router.js index 72d58adc84ab2d..49fd899096e0bd 100644 --- a/lib/routes/ncepu/router.js +++ b/lib/routes/ncepu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/master/:type', './master/masterinfo'); }; diff --git a/lib/routes/ncu/jwc.js b/lib/routes/ncu/jwc.js index f3ad44fc293162..01caf425014590 100644 --- a/lib/routes/ncu/jwc.js +++ b/lib/routes/ncu/jwc.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; // 自订的 got import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析器 import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://jwc.ncu.edu.cn'; const response = await got(baseUrl); const $ = load(response.body); diff --git a/lib/routes/ncu/router.js b/lib/routes/ncu/router.js index 635440384a8796..1b3d4a03189a85 100644 --- a/lib/routes/ncu/router.js +++ b/lib/routes/ncu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/jwc', './jwc'); }; diff --git a/lib/routes/ncwu/notice.js b/lib/routes/ncwu/notice.js index 1bcb74badf150d..2f4b6036dd76b7 100644 --- a/lib/routes/ncwu/notice.js +++ b/lib/routes/ncwu/notice.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; const baseUrl = 'https://www.ncwu.edu.cn/xxtz.htm'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(baseUrl); const $ = load(response.data); diff --git a/lib/routes/ncwu/router.js b/lib/routes/ncwu/router.js index f23ddaad77c382..542a85d08ce2fc 100644 --- a/lib/routes/ncwu/router.js +++ b/lib/routes/ncwu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/notice', './notice'); }; diff --git a/lib/routes/ndss-symposium/ndss.js b/lib/routes/ndss-symposium/ndss.js index b63acb9da63769..f83778c5033996 100644 --- a/lib/routes/ndss-symposium/ndss.js +++ b/lib/routes/ndss-symposium/ndss.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const url = 'https://www.ndss-symposium.org'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { // use wordpress api to get data const { data } = await got(`${url}/wp-json/wp/v2/pages?slug=accepted-papers`); diff --git a/lib/routes/ndss-symposium/router.js b/lib/routes/ndss-symposium/router.js index 66279212b5817d..60721aeaac64e8 100644 --- a/lib/routes/ndss-symposium/router.js +++ b/lib/routes/ndss-symposium/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/ndss', './ndss'); }; diff --git a/lib/routes/neatdownloadmanager/download.js b/lib/routes/neatdownloadmanager/download.js index ffc587c8c07d85..f1ffdd8d170fb7 100644 --- a/lib/routes/neatdownloadmanager/download.js +++ b/lib/routes/neatdownloadmanager/download.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const os = (ctx.req.param('os') ?? '').toLowerCase(); const rootUrl = 'https://www.neatdownloadmanager.com'; diff --git a/lib/routes/neatdownloadmanager/router.js b/lib/routes/neatdownloadmanager/router.js index 4527907205022a..6d2776bed1c958 100644 --- a/lib/routes/neatdownloadmanager/router.js +++ b/lib/routes/neatdownloadmanager/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/download/:os?', './download'); }; diff --git a/lib/routes/neea/index.js b/lib/routes/neea/index.js index db1aa385047f42..7b2b26ed2e9f4f 100644 --- a/lib/routes/neea/index.js +++ b/lib/routes/neea/index.js @@ -19,7 +19,7 @@ function loadContent(link) { }); } -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const host = `http://${type}.neea.edu.cn${typeDic[type].url}`; const response = await got({ diff --git a/lib/routes/neea/jlpt.js b/lib/routes/neea/jlpt.js index bdd35cd3d9ca84..12c515b0c1bf34 100644 --- a/lib/routes/neea/jlpt.js +++ b/lib/routes/neea/jlpt.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://news.neea.cn'; const currentUrl = `${rootUrl}/JLPT/1/newslist.htm`; diff --git a/lib/routes/neea/router.js b/lib/routes/neea/router.js index 53e0d630074028..012dd574247295 100644 --- a/lib/routes/neea/router.js +++ b/lib/routes/neea/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/jlpt', './jlpt'); router.get('/:type?', './index'); }; diff --git a/lib/routes/nenu/router.js b/lib/routes/nenu/router.js index 808a6b124d1e18..a7f73157511722 100644 --- a/lib/routes/nenu/router.js +++ b/lib/routes/nenu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/sohac/*', './sohac'); router.get('/yjsy/*', './yjsy'); }; diff --git a/lib/routes/nenu/sohac.js b/lib/routes/nenu/sohac.js index 98d9256e068779..fc61eee2d1af40 100644 --- a/lib/routes/nenu/sohac.js +++ b/lib/routes/nenu/sohac.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10; const path = getSubPath(ctx) === '/sohac' ? '/index/tzgg' : getSubPath(ctx).replace(/^\/sohac/, ''); diff --git a/lib/routes/nenu/yjsy.js b/lib/routes/nenu/yjsy.js index d43890aa995b39..6a53513099d4f2 100644 --- a/lib/routes/nenu/yjsy.js +++ b/lib/routes/nenu/yjsy.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10; const path = getSubPath(ctx) === '/yjsy' ? '/tzgg' : getSubPath(ctx).replace(/^\/yjsy/, ''); diff --git a/lib/routes/netflav/index.js b/lib/routes/netflav/index.js index 64e8cf65b0e820..df876e9dbbb8b5 100644 --- a/lib/routes/netflav/index.js +++ b/lib/routes/netflav/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://netflav.com'; const { data } = await got(baseUrl); diff --git a/lib/routes/netflav/router.js b/lib/routes/netflav/router.js index e98e1e4e8e694b..f15cf51c5b114d 100644 --- a/lib/routes/netflav/router.js +++ b/lib/routes/netflav/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './'); }; diff --git a/lib/routes/neu/bmie.js b/lib/routes/neu/bmie.js index c0dfe16261ae36..d39a3ea329d70f 100644 --- a/lib/routes/neu/bmie.js +++ b/lib/routes/neu/bmie.js @@ -23,7 +23,7 @@ const map = { alumni_style: 557, }; -module.exports = async (ctx) => { +export default async (ctx) => { let type = ctx.req.param('type'); if (map[type] !== undefined) { type = map[type]; diff --git a/lib/routes/neu/news.js b/lib/routes/neu/news.js index c6068ed3f77b5e..6ef3ea6fc1af17 100644 --- a/lib/routes/neu/news.js +++ b/lib/routes/neu/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://neunews.neu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const newsUrl = `${baseUrl}/${type}/list.htm`; const response = await got(newsUrl); diff --git a/lib/routes/neu/router.js b/lib/routes/neu/router.js index ca738d4c1c5af4..bd331e19b4882b 100644 --- a/lib/routes/neu/router.js +++ b/lib/routes/neu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/bmie/:type', './bmie'); router.get('/news/:type', './news'); }; diff --git a/lib/routes/newmuseum/exhibitions.js b/lib/routes/newmuseum/exhibitions.js index 36eb2ec137f3fd..ea4a1889e66be0 100644 --- a/lib/routes/newmuseum/exhibitions.js +++ b/lib/routes/newmuseum/exhibitions.js @@ -1,6 +1,6 @@ import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { let link; const state = ctx.req.query('state'); diff --git a/lib/routes/newmuseum/router.js b/lib/routes/newmuseum/router.js index 3a5dd943c689cb..5876eb54144613 100644 --- a/lib/routes/newmuseum/router.js +++ b/lib/routes/newmuseum/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/exhibitions', './exhibitions'); }; diff --git a/lib/routes/newrank/douyin.js b/lib/routes/newrank/douyin.js index 74446acf32ff64..075cde93812903 100644 --- a/lib/routes/newrank/douyin.js +++ b/lib/routes/newrank/douyin.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.newrank || !config.newrank.cookie) { throw new Error('newrank RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/newrank/router.js b/lib/routes/newrank/router.js index 0f384938295b79..dd3cc884a5ac7f 100644 --- a/lib/routes/newrank/router.js +++ b/lib/routes/newrank/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/douyin/:dyid', './douyin'); router.get('/wechat/:wxid', './wechat'); }; diff --git a/lib/routes/newrank/wechat.js b/lib/routes/newrank/wechat.js index 2e71eaa67e3d57..02867e685f65f3 100644 --- a/lib/routes/newrank/wechat.js +++ b/lib/routes/newrank/wechat.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.newrank || !config.newrank.cookie) { throw new Error('newrank RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/news/router.js b/lib/routes/news/router.js index 5c954e3a15efdf..abc05ba3c91f66 100644 --- a/lib/routes/news/router.js +++ b/lib/routes/news/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/xhsxw', './xhsxw'); router.get('/whxw', './xhsxw'); }; diff --git a/lib/routes/news/xhsxw.js b/lib/routes/news/xhsxw.js index 11c34fe7be0bf6..02ecdd277e791a 100644 --- a/lib/routes/news/xhsxw.js +++ b/lib/routes/news/xhsxw.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 100; const rootUrl = 'http://www.news.cn'; diff --git a/lib/routes/newsmarket/index.js b/lib/routes/newsmarket/index.js index c81dd2c4e98039..20c0c91a1fccce 100644 --- a/lib/routes/newsmarket/index.js +++ b/lib/routes/newsmarket/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://www.newsmarket.com.tw'; diff --git a/lib/routes/newsmarket/router.js b/lib/routes/newsmarket/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/newsmarket/router.js +++ b/lib/routes/newsmarket/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/newzmz/index.js b/lib/routes/newzmz/index.js index c7a07ecebdd5a6..66dd17fe25b1a2 100644 --- a/lib/routes/newzmz/index.js +++ b/lib/routes/newzmz/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const { rootUrl, getItems, getItemInfo, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id = '1', downLinkType = '磁力链' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/newzmz/router.js b/lib/routes/newzmz/router.js index bfb28d49ad2165..adf2083a8b2552 100644 --- a/lib/routes/newzmz/router.js +++ b/lib/routes/newzmz/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id?/:downLinkType?', './'); }; diff --git a/lib/routes/nextapple/realtime.js b/lib/routes/nextapple/realtime.js index 1c101144ea7320..65103a5e99b0fb 100644 --- a/lib/routes/nextapple/realtime.js +++ b/lib/routes/nextapple/realtime.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; const asyncPool = require('tiny-async-pool'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'latest'; const currentUrl = `https://tw.nextapple.com/realtime/${category}`; const response = await got(currentUrl); diff --git a/lib/routes/nextapple/router.js b/lib/routes/nextapple/router.js index 97a07d0d581413..95b2f653be4da3 100644 --- a/lib/routes/nextapple/router.js +++ b/lib/routes/nextapple/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/realtime/:category?', './realtime'); }; diff --git a/lib/routes/nga/forum.js b/lib/routes/nga/forum.js index 6bb653e141b381..64bc54b4220445 100644 --- a/lib/routes/nga/forum.js +++ b/lib/routes/nga/forum.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const X_UA = 'NGA_skull/6.0.5(iPhone10,3;iOS 12.0.1)'; -module.exports = async (ctx) => { +export default async (ctx) => { const { fid, recommend } = ctx.req.param(); const timestamp = Math.floor(Date.now() / 1000); let cookieString = `guestJs=${timestamp};`; diff --git a/lib/routes/nga/post.js b/lib/routes/nga/post.js index 186d2ada9d5387..2ae9e21cbe0179 100644 --- a/lib/routes/nga/post.js +++ b/lib/routes/nga/post.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const getPageUrl = (tid, authorId, page = 1, hash = '') => `https://nga.178.com/read.php?tid=${tid}&page=${page}${authorId ? `&authorid=${authorId}` : ''}&rand=${Math.random() * 1000}#${hash}`; const getPage = async (tid, authorId, pageId = 1) => { const link = getPageUrl(tid, authorId, pageId); diff --git a/lib/routes/nga/router.js b/lib/routes/nga/router.js index d87bba475e91e9..4e1686e3586a5f 100644 --- a/lib/routes/nga/router.js +++ b/lib/routes/nga/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/forum/:fid/:recommend?', './forum'); router.get('/post/:tid/:authorId?', './post'); }; diff --git a/lib/routes/ngocn2/index.js b/lib/routes/ngocn2/index.js index c692f4aa730580..5a5811659e3425 100644 --- a/lib/routes/ngocn2/index.js +++ b/lib/routes/ngocn2/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'article'; const rootUrl = 'https://ngocn2.org'; diff --git a/lib/routes/ngocn2/router.js b/lib/routes/ngocn2/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/ngocn2/router.js +++ b/lib/routes/ngocn2/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/nhentai/other.js b/lib/routes/nhentai/other.js index 825410517175d9..df61739a61309c 100644 --- a/lib/routes/nhentai/other.js +++ b/lib/routes/nhentai/other.js @@ -3,7 +3,7 @@ const { getSimple, getDetails, getTorrents } = require('./util'); const supportedKeys = new Set(['parody', 'character', 'tag', 'artist', 'group', 'language', 'category']); -module.exports = async (ctx) => { +export default async (ctx) => { const { key, keyword, mode } = ctx.req.param(); if (!supportedKeys.has(key)) { diff --git a/lib/routes/nhentai/router.js b/lib/routes/nhentai/router.js index 51e80cc46342c2..dbf21204d093e6 100644 --- a/lib/routes/nhentai/router.js +++ b/lib/routes/nhentai/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/search/:keyword/:mode?', './search'); router.get('/:key/:keyword/:mode?', './other'); }; diff --git a/lib/routes/nhentai/search.js b/lib/routes/nhentai/search.js index 42771af9458e77..c510b54c71f91b 100644 --- a/lib/routes/nhentai/search.js +++ b/lib/routes/nhentai/search.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getSimple, getDetails, getTorrents } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { keyword, mode } = ctx.req.param(); const url = `https://nhentai.net/search/?q=${keyword}`; diff --git a/lib/routes/nhk/news-web-easy.js b/lib/routes/nhk/news-web-easy.js index 9e8a81a21ebf90..108e3f1e8550ae 100644 --- a/lib/routes/nhk/news-web-easy.js +++ b/lib/routes/nhk/news-web-easy.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got('https://www3.nhk.or.jp/news/easy/news-list.json'); const dates = data[0]; diff --git a/lib/routes/nhk/news.js b/lib/routes/nhk/news.js index 22bddfc7e019e7..d5e7ea3c45677c 100644 --- a/lib/routes/nhk/news.js +++ b/lib/routes/nhk/news.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; const baseUrl = 'https://www3.nhk.or.jp'; const apiUrl = 'https://nwapi.nhk.jp'; -module.exports = async (ctx) => { +export default async (ctx) => { const { lang = 'en' } = ctx.req.param(); const { data } = await got(`${apiUrl}/nhkworld/rdnewsweb/v7b/${lang}/outline/list.json`); const meta = await got(`${baseUrl}/nhkworld/common/assets/news/config/${lang}.json`); diff --git a/lib/routes/nhk/router.js b/lib/routes/nhk/router.js index ff7a74a2c8aee5..3f02e824a71c86 100644 --- a/lib/routes/nhk/router.js +++ b/lib/routes/nhk/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:lang?', './news'); router.get('/news_web_easy', './news-web-easy'); }; diff --git a/lib/routes/niaogebiji/cat.js b/lib/routes/niaogebiji/cat.js index edb52a40575f83..59d050e648104d 100644 --- a/lib/routes/niaogebiji/cat.js +++ b/lib/routes/niaogebiji/cat.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const categoryId = ctx.req.param('cat'); const link = `https://www.niaogebiji.com/cat/${categoryId}`; diff --git a/lib/routes/niaogebiji/index.js b/lib/routes/niaogebiji/index.js index b09bac393125b8..13d6c899205d74 100644 --- a/lib/routes/niaogebiji/index.js +++ b/lib/routes/niaogebiji/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.niaogebiji.com'; const { data: response } = await got(`${baseUrl}/pc/index/getMoreArticle`); diff --git a/lib/routes/niaogebiji/router.js b/lib/routes/niaogebiji/router.js index 1cd31f2e0f1fbf..1caac6bd05bda6 100644 --- a/lib/routes/niaogebiji/router.js +++ b/lib/routes/niaogebiji/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/cat/:cat', './cat'); router.get('/today', './today'); diff --git a/lib/routes/niaogebiji/today.js b/lib/routes/niaogebiji/today.js index 85081c6297360c..5ea6da459176a7 100644 --- a/lib/routes/niaogebiji/today.js +++ b/lib/routes/niaogebiji/today.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'post', url: 'https://www.niaogebiji.com/pc/bulletin/index', diff --git a/lib/routes/nifd/research.js b/lib/routes/nifd/research.js index c5b821df7aa67d..e45248836c4967 100644 --- a/lib/routes/nifd/research.js +++ b/lib/routes/nifd/research.js @@ -18,7 +18,7 @@ const titleMap = { '6363bdc7-3e1b-4771-a904-6162cd3a3143': '其他报告', }; -module.exports = async (ctx) => { +export default async (ctx) => { const categoryGuid = ctx.req.param('categoryGuid') ?? '7a6a826d-b525-42aa-b550-4236e524227f'; const url = `${rootUrl}/Research?categoryGuid=${categoryGuid}`; diff --git a/lib/routes/nifd/router.js b/lib/routes/nifd/router.js index 77f8f3ce842372..06ee6d497a4820 100644 --- a/lib/routes/nifd/router.js +++ b/lib/routes/nifd/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/research/:categoryGuid?', './research'); }; diff --git a/lib/routes/nikkei/asia/index.js b/lib/routes/nikkei/asia/index.js index fd31633e274d93..e72f13ee1cd335 100644 --- a/lib/routes/nikkei/asia/index.js +++ b/lib/routes/nikkei/asia/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = 'https://main-asianreview-nikkei.content.pugpig.com/editionfeed/4519/pugpig_atom_contents.json'; const response = await got({ diff --git a/lib/routes/nikkei/cn/index.js b/lib/routes/nikkei/cn/index.js index 9596e9466f74b7..b92ce5582dfd3c 100644 --- a/lib/routes/nikkei/cn/index.js +++ b/lib/routes/nikkei/cn/index.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import parser from '@/utils/rss-parser'; -module.exports = async (ctx) => { +export default async (ctx) => { let language = ''; let path = getSubPath(ctx); diff --git a/lib/routes/nikkei/index.js b/lib/routes/nikkei/index.js index a614bfbaa68756..ab8322ad54ef03 100644 --- a/lib/routes/nikkei/index.js +++ b/lib/routes/nikkei/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.nikkei.com'; const response = await got(url); const $ = load(response.data); diff --git a/lib/routes/nikkei/news.js b/lib/routes/nikkei/news.js index e8c047035938ab..396f3bec8e86fe 100644 --- a/lib/routes/nikkei/news.js +++ b/lib/routes/nikkei/news.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.nikkei.com'; const { category, article_type = 'paid' } = ctx.req.param(); let url = ''; diff --git a/lib/routes/nikkei/router.js b/lib/routes/nikkei/router.js index e3b7fb23c3fe9f..52fe50d3df103c 100644 --- a/lib/routes/nikkei/router.js +++ b/lib/routes/nikkei/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/asia', './asia/index'); router.get('/cn/*', './cn/index'); diff --git a/lib/routes/nintendo/direct.js b/lib/routes/nintendo/direct.js index a138370170e757..c3c9f6ab493b98 100644 --- a/lib/routes/nintendo/direct.js +++ b/lib/routes/nintendo/direct.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://www.nintendo.com/nintendo-direct/archive/'); const data = response.data; diff --git a/lib/routes/nintendo/eshop-cn.js b/lib/routes/nintendo/eshop-cn.js index 2fbb27730f7956..b64c8476aa5755 100644 --- a/lib/routes/nintendo/eshop-cn.js +++ b/lib/routes/nintendo/eshop-cn.js @@ -4,7 +4,7 @@ const util = require('./utils'); const software_url = 'https://www.nintendoswitch.com.cn/software/'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(software_url); // 获取Nuxt对象 diff --git a/lib/routes/nintendo/eshop-hk.js b/lib/routes/nintendo/eshop-hk.js index 83c8cc21168e78..c551fcfe758c35 100644 --- a/lib/routes/nintendo/eshop-hk.js +++ b/lib/routes/nintendo/eshop-hk.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://www.nintendo.com.hk/data/json/switch_software.json'); const data = response.data.filter(({ link }) => link.startsWith('https://')).slice(0, ctx.req.query('limit') ? Number(ctx.req.query('limit')) : 30); diff --git a/lib/routes/nintendo/eshop-jp.js b/lib/routes/nintendo/eshop-jp.js index e503e6ee33a0be..8a5227ee20417d 100644 --- a/lib/routes/nintendo/eshop-jp.js +++ b/lib/routes/nintendo/eshop-jp.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://search.nintendo.jp/nintendo_soft/search.json', { searchParams: { opt_sshow: 1, diff --git a/lib/routes/nintendo/eshop-us.js b/lib/routes/nintendo/eshop-us.js index 698a183cf68c8c..040c52ab60cd27 100644 --- a/lib/routes/nintendo/eshop-us.js +++ b/lib/routes/nintendo/eshop-us.js @@ -2,7 +2,7 @@ import { art } from '@/utils/render'; import got from '@/utils/got'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got.post('https://u3b6gr4ua3-dsn.algolia.net/1/indexes/store_game_en_us_release_des/query', { headers: { 'x-algolia-api-key': 'a29c6927638bfd8cee23993e51e721c9', diff --git a/lib/routes/nintendo/news-china.js b/lib/routes/nintendo/news-china.js index b0a0eb7fb11055..4fcd014118b645 100644 --- a/lib/routes/nintendo/news-china.js +++ b/lib/routes/nintendo/news-china.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const util = require('./utils'); const news_url = 'https://www.nintendoswitch.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(news_url); // 获取Nuxt对象 diff --git a/lib/routes/nintendo/news.js b/lib/routes/nintendo/news.js index deb421fff57188..c8dd5971fba935 100644 --- a/lib/routes/nintendo/news.js +++ b/lib/routes/nintendo/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const util = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://www.nintendo.com.hk/data/json/topics.json'); const data = response.data.filter((val) => val.only_for !== 'tw' && val.url.startsWith('/topics/article/')).slice(0, ctx.req.query('limit') ? Number(ctx.req.query('limit')) : 30); diff --git a/lib/routes/nintendo/router.js b/lib/routes/nintendo/router.js index 46c098c098c5a4..ced9f9985cc9c2 100644 --- a/lib/routes/nintendo/router.js +++ b/lib/routes/nintendo/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/direct', './direct'); router.get('/eshop/cn', './eshop-cn'); router.get('/eshop/hk', './eshop-hk'); diff --git a/lib/routes/nintendo/system-update.js b/lib/routes/nintendo/system-update.js index a860e8b70f42a7..065314a1b87172 100644 --- a/lib/routes/nintendo/system-update.js +++ b/lib/routes/nintendo/system-update.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.nintendo.co.jp/support/switch/system_update/index.html'; const response = await got(url); diff --git a/lib/routes/nippon/index.js b/lib/routes/nippon/index.js index 0418a3ce464d0f..7a5bd4d028373d 100644 --- a/lib/routes/nippon/index.js +++ b/lib/routes/nippon/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'Politics'; const path = category === 'Science,Technology' ? 'condition4' : 'category_code'; const res = await got.get(`https://www.nippon.com/api/search/cn/${path}/20/1/${category}?t=${Date.now()}`); diff --git a/lib/routes/nippon/router.js b/lib/routes/nippon/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/nippon/router.js +++ b/lib/routes/nippon/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/njglyy/router.js b/lib/routes/njglyy/router.js index da77c1e5d144ee..7588cd42df88ee 100644 --- a/lib/routes/njglyy/router.js +++ b/lib/routes/njglyy/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/ygbjypx', './ygbjypx'); }; diff --git a/lib/routes/njglyy/ygbjypx.js b/lib/routes/njglyy/ygbjypx.js index d277a97ed71a00..2adfd5a2f26a08 100644 --- a/lib/routes/njglyy/ygbjypx.js +++ b/lib/routes/njglyy/ygbjypx.js @@ -3,7 +3,7 @@ const { getNoticeList } = require('./utils'); const url = 'https://njglyy.com/ygb/jypx/jypx.aspx'; const host = 'https://njglyy.com/ygb/jypx/'; -module.exports = async (ctx) => { +export default async (ctx) => { const out = await getNoticeList(ctx, url, host, '.mtbd-list > dl', 'a', 'dt', { title: '.detail', content: '.detail2', diff --git a/lib/routes/njit/jwc.js b/lib/routes/njit/jwc.js index 14d65b9fdf3755..1d3d2867103fe5 100644 --- a/lib/routes/njit/jwc.js +++ b/lib/routes/njit/jwc.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'https://jwc.njit.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'jx'; const link = host + '/index/' + type + '.htm'; const response = await got({ diff --git a/lib/routes/njit/router.js b/lib/routes/njit/router.js index cef2597f18528d..5e409bb57da11d 100644 --- a/lib/routes/njit/router.js +++ b/lib/routes/njit/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/tzgg', './tzgg'); router.get('/jwc/:type?', './jwc'); }; diff --git a/lib/routes/njit/tzgg.js b/lib/routes/njit/tzgg.js index b3da834d875d34..6175a6e7147712 100644 --- a/lib/routes/njit/tzgg.js +++ b/lib/routes/njit/tzgg.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const url = 'https://www.njit.edu.cn/index/tzgg.htm'; const host = 'https://www.njit.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url, diff --git a/lib/routes/njnu/ceai/ceai.js b/lib/routes/njnu/ceai/ceai.js index 57bb707c791983..66fb4efbc2cea6 100644 --- a/lib/routes/njnu/ceai/ceai.js +++ b/lib/routes/njnu/ceai/ceai.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let title, path; switch (type) { diff --git a/lib/routes/njnu/jwc/jwc.js b/lib/routes/njnu/jwc/jwc.js index b8f30195cc2853..67244d78a913e3 100644 --- a/lib/routes/njnu/jwc/jwc.js +++ b/lib/routes/njnu/jwc/jwc.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let title, path; switch (type) { diff --git a/lib/routes/njnu/router.js b/lib/routes/njnu/router.js index ff2b4451d26b69..d8c7565fad770d 100644 --- a/lib/routes/njnu/router.js +++ b/lib/routes/njnu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/jwc/:type', './jwc/jwc'); router.get('/ceai/:type', './ceai/ceai'); }; diff --git a/lib/routes/nju/admission.js b/lib/routes/nju/admission.js index c6fa09e4c528eb..f6020b6a0b6627 100644 --- a/lib/routes/nju/admission.js +++ b/lib/routes/nju/admission.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category_dict = { tzgg: '通知公告', }; diff --git a/lib/routes/nju/dafls.js b/lib/routes/nju/dafls.js index 86c4d1c4e8eb0f..c60cd495c60f41 100644 --- a/lib/routes/nju/dafls.js +++ b/lib/routes/nju/dafls.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const category_dict = { tzgg: '通知公告', }; diff --git a/lib/routes/nju/exchangesys.js b/lib/routes/nju/exchangesys.js index aad47c04a2b3b1..1f31ccc955886b 100644 --- a/lib/routes/nju/exchangesys.js +++ b/lib/routes/nju/exchangesys.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const dayjs = require('dayjs'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const type_dict = { news: ['http://elite.nju.edu.cn/exchangesystem/index/moreList', 'http://elite.nju.edu.cn/exchangesystem/index/more?type=xw', '新闻通知'], diff --git a/lib/routes/nju/gra.js b/lib/routes/nju/gra.js index 63ac6195cfbb06..10cfa61144336e 100644 --- a/lib/routes/nju/gra.js +++ b/lib/routes/nju/gra.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://grawww.nju.edu.cn/905/list.htm', diff --git a/lib/routes/nju/hosptial.js b/lib/routes/nju/hosptial.js index 55ee68085d9ff4..5b7699cbbb68c9 100644 --- a/lib/routes/nju/hosptial.js +++ b/lib/routes/nju/hosptial.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category_dict = { ggtz: '公告通知', }; diff --git a/lib/routes/nju/hqjt.js b/lib/routes/nju/hqjt.js index a2d717a70f2145..2b0f14dc018c94 100644 --- a/lib/routes/nju/hqjt.js +++ b/lib/routes/nju/hqjt.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const category_dict = { zbcg: '招标采购', }; diff --git a/lib/routes/nju/itsc.js b/lib/routes/nju/itsc.js index 60d3932e9326fa..6322150683a0d4 100644 --- a/lib/routes/nju/itsc.js +++ b/lib/routes/nju/itsc.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const category_dict = { tzgg: '通知公告', }; diff --git a/lib/routes/nju/jjc.js b/lib/routes/nju/jjc.js index d4c6b5667e9d22..803dcdb3290cfd 100644 --- a/lib/routes/nju/jjc.js +++ b/lib/routes/nju/jjc.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const category_dict = { cgxx: '采购信息', cjgg: '成交公告', diff --git a/lib/routes/nju/jw.js b/lib/routes/nju/jw.js index 280da4ea784689..e411b2bc96942a 100644 --- a/lib/routes/nju/jw.js +++ b/lib/routes/nju/jw.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const type_dict = { ggtz: [ diff --git a/lib/routes/nju/rczp.js b/lib/routes/nju/rczp.js index c1f8cb0ab32b7e..b7c14ea5cf1044 100644 --- a/lib/routes/nju/rczp.js +++ b/lib/routes/nju/rczp.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const title_dict = { xxfb: { title: '信息发布', channelid: '9531,9532,9533,9534,9535,9419' }, diff --git a/lib/routes/nju/router.js b/lib/routes/nju/router.js index e9b7f615a34797..e2177177ed00af 100644 --- a/lib/routes/nju/router.js +++ b/lib/routes/nju/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/admission', './admission'); router.get('/dafls', './dafls'); router.get('/exchangesys/:type', './exchangesys'); diff --git a/lib/routes/nju/scit.js b/lib/routes/nju/scit.js index 0594892d8d14b6..96e56baa2b9382 100644 --- a/lib/routes/nju/scit.js +++ b/lib/routes/nju/scit.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const type_dict = { tzgg: ['https://scit.nju.edu.cn/10916/list.htm', '通知公告'], diff --git a/lib/routes/nju/zbb.js b/lib/routes/nju/zbb.js index be82bb47c3574d..26948cd0b62a77 100644 --- a/lib/routes/nju/zbb.js +++ b/lib/routes/nju/zbb.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); if (type === 'zfcgyxgk') { const url = `https://zbb.nju.edu.cn/zfcgyxgk/index.chtml`; diff --git a/lib/routes/nju/zcc.js b/lib/routes/nju/zcc.js index e3c95b6d9047e4..5482efef2f00d6 100644 --- a/lib/routes/nju/zcc.js +++ b/lib/routes/nju/zcc.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category_dict = { ggtz: '公告通知', }; diff --git a/lib/routes/njucm/grabs.js b/lib/routes/njucm/grabs.js index b1a728ef27f59f..113f51ecf3592a 100644 --- a/lib/routes/njucm/grabs.js +++ b/lib/routes/njucm/grabs.js @@ -3,7 +3,7 @@ const { getNoticeList } = require('./utils'); const url = 'https://gra.njucm.edu.cn/2899/list.htm'; const host = 'https://gra.njucm.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const out = await getNoticeList(ctx, url, host, '#wp_news_w3 > table > tbody > tr', 'a', { title: '.Article_Title', content: '.Article_Content', diff --git a/lib/routes/njucm/router.js b/lib/routes/njucm/router.js index 095654ecc69323..27a20410b0003d 100644 --- a/lib/routes/njucm/router.js +++ b/lib/routes/njucm/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/grabszs', './grabs'); }; diff --git a/lib/routes/njupt/jwc.js b/lib/routes/njupt/jwc.js index 7bedb0398015d4..1362ea35aacd66 100644 --- a/lib/routes/njupt/jwc.js +++ b/lib/routes/njupt/jwc.js @@ -10,7 +10,7 @@ const map = { news: '/1596', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'notice'; const link = host + map[type] + '/list.htm'; const response = await got({ diff --git a/lib/routes/njupt/router.js b/lib/routes/njupt/router.js index c86dc3b299314a..85091c3c07a39f 100644 --- a/lib/routes/njupt/router.js +++ b/lib/routes/njupt/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/jwc/:type?', './jwc'); }; diff --git a/lib/routes/njust/cwc.js b/lib/routes/njust/cwc.js index 6e50f58798c281..c8574de0d08f21 100644 --- a/lib/routes/njust/cwc.js +++ b/lib/routes/njust/cwc.js @@ -10,7 +10,7 @@ const map = new Map([ const host = 'https://cwc.njust.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'tzgg'; const info = map.get(type); if (!info) { diff --git a/lib/routes/njust/dgxg.js b/lib/routes/njust/dgxg.js index 9a618855a72902..c741c5f28c670b 100644 --- a/lib/routes/njust/dgxg.js +++ b/lib/routes/njust/dgxg.js @@ -11,7 +11,7 @@ const map = new Map([ const host = 'https://dgxg.njust.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'gstz'; const info = map.get(type); if (!info) { diff --git a/lib/routes/njust/eo.js b/lib/routes/njust/eo.js index fde04df4f984b1..e52fca04eda8df 100644 --- a/lib/routes/njust/eo.js +++ b/lib/routes/njust/eo.js @@ -16,7 +16,7 @@ const map = new Map([ const host = 'https://dgxg.njust.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const grade = ctx.req.param('grade') ?? '17'; const type = ctx.req.param('type') ?? 'tz'; let info = map.get(grade + type); diff --git a/lib/routes/njust/eoe.js b/lib/routes/njust/eoe.js index 8495d1e3a3d824..c94e3d90ca5b34 100644 --- a/lib/routes/njust/eoe.js +++ b/lib/routes/njust/eoe.js @@ -10,7 +10,7 @@ const map = new Map([ const host = 'https://eoe.njust.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'tzgg'; const info = map.get(type); if (!info) { diff --git a/lib/routes/njust/gs.js b/lib/routes/njust/gs.js index 4e3d54e35ff4d3..82c04add2db81f 100644 --- a/lib/routes/njust/gs.js +++ b/lib/routes/njust/gs.js @@ -5,7 +5,7 @@ const { getContent } = require('./utils'); const host = 'https://gs.njust.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'sytzgg_4568'; const id = '/' + type; const siteUrl = host + id + '/list.htm'; diff --git a/lib/routes/njust/jwc.js b/lib/routes/njust/jwc.js index 213bf81c5da5ff..e172d9ba294bbb 100644 --- a/lib/routes/njust/jwc.js +++ b/lib/routes/njust/jwc.js @@ -12,7 +12,7 @@ const map = new Map([ const host = 'https://jwc.njust.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'xstz'; const info = map.get(type); if (!info) { diff --git a/lib/routes/njust/router.js b/lib/routes/njust/router.js index 19a26c630d083e..3d2e25fc1e1dbc 100644 --- a/lib/routes/njust/router.js +++ b/lib/routes/njust/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/cwc/:type?', './cwc'); router.get('/dgxg/:type?', './dgxg'); router.get('/eo/:grade?/:type?', './eo'); diff --git a/lib/routes/njxzc/home.js b/lib/routes/njxzc/home.js index 049d00b085636b..5dfdf8ee338b92 100644 --- a/lib/routes/njxzc/home.js +++ b/lib/routes/njxzc/home.js @@ -3,7 +3,7 @@ const { getNoticeList } = require('./utils'); const url = 'https://www.njxzc.edu.cn/89/list.htm'; const host = 'https://www.njxzc.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const out = await getNoticeList( ctx, url, diff --git a/lib/routes/njxzc/lib.js b/lib/routes/njxzc/lib.js index 583b28389ea67e..ff85d1abdbe75b 100644 --- a/lib/routes/njxzc/lib.js +++ b/lib/routes/njxzc/lib.js @@ -3,7 +3,7 @@ const { getNoticeList } = require('./utils'); const url = 'https://lib.njxzc.edu.cn/pxyhd/list.htm'; const host = 'https://lib.njxzc.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const out = await getNoticeList( ctx, url, diff --git a/lib/routes/njxzc/router.js b/lib/routes/njxzc/router.js index d6e470475402aa..a4142a1a7975b8 100644 --- a/lib/routes/njxzc/router.js +++ b/lib/routes/njxzc/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { // 南京晓庄学院图书馆通知公告 router.get('/libtzgg', './lib'); // 南京晓庄学院通知公告 diff --git a/lib/routes/nltimes/news.js b/lib/routes/nltimes/news.js index a6b38fc6a4abbe..0bcb9439dc8a87 100644 --- a/lib/routes/nltimes/news.js +++ b/lib/routes/nltimes/news.js @@ -17,7 +17,7 @@ const map = new Map([ ['1-1-2', { title: 'NL Times -- 1-1-2', suffix: '/categories/1-1-2' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'top-stories'; const suffix = map.get(category).suffix; diff --git a/lib/routes/nltimes/router.js b/lib/routes/nltimes/router.js index 94e58c83a4832c..ec7c5eda5bf4b4 100644 --- a/lib/routes/nltimes/router.js +++ b/lib/routes/nltimes/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:category?', './news'); }; diff --git a/lib/routes/nmtv/column.js b/lib/routes/nmtv/column.js index 189215aaab789d..d74d623d2e94e3 100644 --- a/lib/routes/nmtv/column.js +++ b/lib/routes/nmtv/column.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '877'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 100; diff --git a/lib/routes/nmtv/router.js b/lib/routes/nmtv/router.js index b79885e1606f85..fb223e8b126d35 100644 --- a/lib/routes/nmtv/router.js +++ b/lib/routes/nmtv/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/column/:id?', './column'); }; diff --git a/lib/routes/nodejs/blog.js b/lib/routes/nodejs/blog.js index f4bfd9081e9674..bfa010c211dd2f 100644 --- a/lib/routes/nodejs/blog.js +++ b/lib/routes/nodejs/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? 'en'; const rootUrl = 'https://nodejs.org'; diff --git a/lib/routes/nodejs/router.js b/lib/routes/nodejs/router.js index d4fdc9516d3bfb..46410d3d1cff91 100644 --- a/lib/routes/nodejs/router.js +++ b/lib/routes/nodejs/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:language?', './blog'); }; diff --git a/lib/routes/nogizaka46/blog.js b/lib/routes/nogizaka46/blog.js index 21022789c19930..7c9c128e1b3c3d 100644 --- a/lib/routes/nogizaka46/blog.js +++ b/lib/routes/nogizaka46/blog.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.nogizaka46.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'all'; const params = id === 'all' ? '' : `?ct=${id}`; const currentUrl = `${rootUrl}/s/n46/api/list/blog${params}`; diff --git a/lib/routes/nogizaka46/news.js b/lib/routes/nogizaka46/news.js index b68d96e0359fe5..1f035eaeecfc14 100644 --- a/lib/routes/nogizaka46/news.js +++ b/lib/routes/nogizaka46/news.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.nogizaka46.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25; const response = await got({ diff --git a/lib/routes/nogizaka46/router.js b/lib/routes/nogizaka46/router.js index 2047a87cadcb72..f055a2dee0b5b7 100644 --- a/lib/routes/nogizaka46/router.js +++ b/lib/routes/nogizaka46/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); router.get('/blog/:id?', './blog'); }; diff --git a/lib/routes/notateslaapp/router.js b/lib/routes/notateslaapp/router.js index 04ef7506af626f..31539db21672b0 100644 --- a/lib/routes/notateslaapp/router.js +++ b/lib/routes/notateslaapp/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/ota', './update'); }; diff --git a/lib/routes/notateslaapp/update.js b/lib/routes/notateslaapp/update.js index e51e0daffec1b8..dfa98abf243eed 100644 --- a/lib/routes/notateslaapp/update.js +++ b/lib/routes/notateslaapp/update.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://www.notateslaapp.com/software-updates/history/', diff --git a/lib/routes/notefolio/router.js b/lib/routes/notefolio/router.js index 7711288c76898e..2c24e61560c10b 100644 --- a/lib/routes/notefolio/router.js +++ b/lib/routes/notefolio/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/search/:category?/:order?/:time?/:query?', './search'); }; diff --git a/lib/routes/notefolio/search.js b/lib/routes/notefolio/search.js index e1b9a5f3238be9..1fbe2d7ed05651 100644 --- a/lib/routes/notefolio/search.js +++ b/lib/routes/notefolio/search.js @@ -64,7 +64,7 @@ const categoryMap = [ * @param query 搜索词 * @query limit 分页,默认20 */ -module.exports = async (ctx) => { +export default async (ctx) => { // 分类、排序、时间范围、搜索词 const { category = 'all', order = 'pick', time = 'all', query = '' } = ctx.req.param(); // 分页 diff --git a/lib/routes/notion/database.js b/lib/routes/notion/database.js index 823c99a57fe24f..9667b0b3c16447 100644 --- a/lib/routes/notion/database.js +++ b/lib/routes/notion/database.js @@ -11,7 +11,7 @@ const md = require('markdown-it')({ linkify: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.notion.key) { throw new Error('Notion RSS is disabled due to the lack of NOTION_TOKEN(relevant config)'); } diff --git a/lib/routes/notion/router.js b/lib/routes/notion/router.js index d2b32b0a9f7a31..078dfbde50ef6e 100644 --- a/lib/routes/notion/router.js +++ b/lib/routes/notion/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/database/:databaseId', './database'); }; diff --git a/lib/routes/now/news.js b/lib/routes/now/news.js index 35c2b03e3df946..1581c1c5cc6e6d 100644 --- a/lib/routes/now/news.js +++ b/lib/routes/now/news.js @@ -9,7 +9,7 @@ const categories = { opinion: 125, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || ''; const id = ctx.req.param('id') || ''; diff --git a/lib/routes/now/router.js b/lib/routes/now/router.js index 0fb7d624b927ea..ea7f3d6f38993e 100644 --- a/lib/routes/now/router.js +++ b/lib/routes/now/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:category?/:id?', './news'); }; diff --git a/lib/routes/nowcoder/discuss.js b/lib/routes/nowcoder/discuss.js index 2ef9b05da34967..2b85d3b8704ef7 100644 --- a/lib/routes/nowcoder/discuss.js +++ b/lib/routes/nowcoder/discuss.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const host = 'https://www.nowcoder.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const order = ctx.req.param('order'); diff --git a/lib/routes/nowcoder/experience.js b/lib/routes/nowcoder/experience.js index 7619e610476b58..4aa10bfd627709 100644 --- a/lib/routes/nowcoder/experience.js +++ b/lib/routes/nowcoder/experience.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const host = 'https://www.nowcoder.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = new URLSearchParams(ctx.req.query()); params.append('tagId', ctx.req.param('tagId')); diff --git a/lib/routes/nowcoder/jobcenter.js b/lib/routes/nowcoder/jobcenter.js index 23d692746abae8..8c3ebbb7630bba 100644 --- a/lib/routes/nowcoder/jobcenter.js +++ b/lib/routes/nowcoder/jobcenter.js @@ -3,7 +3,7 @@ const url = require('url'); import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { 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') : '' diff --git a/lib/routes/nowcoder/recommend.js b/lib/routes/nowcoder/recommend.js index da43c5a16e8aa4..5cc704c12689c1 100644 --- a/lib/routes/nowcoder/recommend.js +++ b/lib/routes/nowcoder/recommend.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `https://www.nowcoder.com/recommand/activity?token=&type=3&_=${Date.now()}`; const responseBody = (await got.get(link)).data; if (responseBody.code !== 0) { diff --git a/lib/routes/nowcoder/router.js b/lib/routes/nowcoder/router.js index ec0f02cab5f801..4568984b09f9b8 100644 --- a/lib/routes/nowcoder/router.js +++ b/lib/routes/nowcoder/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/discuss/:type/:order', './discuss'); router.get('/experience/:tagId', './experience'); router.get('/jobcenter/:recruitType?/:city?/:type?/:order?/:latest?', './jobcenter'); diff --git a/lib/routes/nowcoder/schedule.js b/lib/routes/nowcoder/schedule.js index 2199c91ec66dd6..5e2ff68364590b 100644 --- a/lib/routes/nowcoder/schedule.js +++ b/lib/routes/nowcoder/schedule.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const propertyId = ctx.req.param('propertyId') ?? 0; const typeId = ctx.req.param('typeId') ?? 0; diff --git a/lib/routes/npm/package.js b/lib/routes/npm/package.js index c721ff45341435..c8119a8a95f8e5 100644 --- a/lib/routes/npm/package.js +++ b/lib/routes/npm/package.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.url.split('package/')[1]; const packageDownloadLastMonthAPI = `https://api.npmjs.org/downloads/point/last-month/${name}`; // 按月统计 const packageDownloadLastWeekAPI = `https://api.npmjs.org/downloads/point/last-week/${name}`; // 按周统计 diff --git a/lib/routes/npm/router.js b/lib/routes/npm/router.js index 1a99dc9c3b8147..03da709285ff96 100644 --- a/lib/routes/npm/router.js +++ b/lib/routes/npm/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('package/*', './package'); }; diff --git a/lib/routes/npr/full.js b/lib/routes/npr/full.js index ac217ad5a8694b..3b6c5f1c3d672d 100644 --- a/lib/routes/npr/full.js +++ b/lib/routes/npr/full.js @@ -58,7 +58,7 @@ const getArticleDetail = (link) => return { article, categories }; }); -module.exports = async (ctx) => { +export default async (ctx) => { const endpoint = ctx.req.param('endpoint') || '1001'; const feed = await parser.parseURL(`https://feeds.npr.org/${endpoint}/rss.xml`); diff --git a/lib/routes/npr/router.js b/lib/routes/npr/router.js index 2c3a8e3916ed40..da2caff132b277 100644 --- a/lib/routes/npr/router.js +++ b/lib/routes/npr/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:endpoint?', './full'); }; diff --git a/lib/routes/ntdtv/channel.js b/lib/routes/ntdtv/channel.js index c04bc0b2fd4315..8aff1a5f9e11a1 100644 --- a/lib/routes/ntdtv/channel.js +++ b/lib/routes/ntdtv/channel.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const host = 'https://www.ntdtv.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language'); const id = ctx.req.param('id'); const url = `${host}/${language}/${id}`; diff --git a/lib/routes/ntdtv/router.js b/lib/routes/ntdtv/router.js index be82f2ed876994..5c218bb8b07b34 100644 --- a/lib/routes/ntdtv/router.js +++ b/lib/routes/ntdtv/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:language/:id', './channel'); }; diff --git a/lib/routes/nua/dc.js b/lib/routes/nua/dc.js index 033afe10c3b9fc..d44419d439cffc 100644 --- a/lib/routes/nua/dc.js +++ b/lib/routes/nua/dc.js @@ -1,6 +1,6 @@ const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const baseUrl = 'https://dc.nua.edu.cn'; diff --git a/lib/routes/nua/gra.js b/lib/routes/nua/gra.js index 15d2023c5a11e4..55433aef508894 100644 --- a/lib/routes/nua/gra.js +++ b/lib/routes/nua/gra.js @@ -1,7 +1,7 @@ const util = require('./utils'); const baseUrl = 'https://grad.nua.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const newsUrl = `${baseUrl}/${type}/list.htm`; const listName = 'li.list_item'; diff --git a/lib/routes/nua/index.js b/lib/routes/nua/index.js index 7a684b5060988e..65448c4ba0df7e 100644 --- a/lib/routes/nua/index.js +++ b/lib/routes/nua/index.js @@ -1,6 +1,6 @@ const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const baseUrl = 'https://www.nua.edu.cn'; diff --git a/lib/routes/nua/lib.js b/lib/routes/nua/lib.js index f8fe85528e5c54..7c36fa37dcaa8d 100644 --- a/lib/routes/nua/lib.js +++ b/lib/routes/nua/lib.js @@ -1,7 +1,7 @@ const util = require('./utils'); const baseUrl = 'https://lib.nua.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let webPageName; diff --git a/lib/routes/nua/router.js b/lib/routes/nua/router.js index 91668931e9d1e6..f1e32b9dbc71e5 100644 --- a/lib/routes/nua/router.js +++ b/lib/routes/nua/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/dc/:type', './dc'); router.get('/gra/:type', './gra'); router.get('/index/:type', './index'); diff --git a/lib/routes/nua/sxw.js b/lib/routes/nua/sxw.js index 8f3bc9b1d9b491..86956860cd91e9 100644 --- a/lib/routes/nua/sxw.js +++ b/lib/routes/nua/sxw.js @@ -1,6 +1,6 @@ const util = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const baseUrl = 'https://sxw.nua.edu.cn'; diff --git a/lib/routes/nuaa/college/cae.js b/lib/routes/nuaa/college/cae.js index 8e22bebb873cd3..7e0c6dc9476481 100644 --- a/lib/routes/nuaa/college/cae.js +++ b/lib/routes/nuaa/college/cae.js @@ -17,7 +17,7 @@ const map = new Map([ ['dbgg', { title: '答辩公告 | 南京航空航天大学自动化学院', suffix: 'dbgg/list.htm' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const suffix = map.get(type).suffix; const getDescription = Boolean(ctx.req.param('getDescription')) || false; diff --git a/lib/routes/nuaa/college/cs.js b/lib/routes/nuaa/college/cs.js index 5cd70a5a17b949..48a0218cf17d3a 100644 --- a/lib/routes/nuaa/college/cs.js +++ b/lib/routes/nuaa/college/cs.js @@ -15,7 +15,7 @@ const map = new Map([ ['xsgz', { title: '学生工作 | 南京航空航天大学计算机科学与技术学院', suffix: '1959/list.htm' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const getDescription = Boolean(ctx.req.param('getDescription')) || false; const suffix = map.get(type).suffix; diff --git a/lib/routes/nuaa/jwc/jwc.js b/lib/routes/nuaa/jwc/jwc.js index 286b7a4dbfd668..e09c30bdba9b36 100644 --- a/lib/routes/nuaa/jwc/jwc.js +++ b/lib/routes/nuaa/jwc/jwc.js @@ -13,7 +13,7 @@ const map = new Map([ ['jxzy', { title: '教学资源 | 南京航空航天大学教务处', suffix: '8233/list.htm' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const suffix = map.get(type).suffix; const getDescription = Boolean(ctx.req.param('getDescription')) || false; diff --git a/lib/routes/nuaa/router.js b/lib/routes/nuaa/router.js index ed223298809ab4..1671cc9ff82602 100644 --- a/lib/routes/nuaa/router.js +++ b/lib/routes/nuaa/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/cae/:type/:getDescription?', './college/cae'); router.get('/cs/:type/:getDescription?', './college/cs'); router.get('/jwc/:type/:getDescription?', './jwc/jwc'); diff --git a/lib/routes/nuaa/yjsy/yjsy.js b/lib/routes/nuaa/yjsy/yjsy.js index 3ccac38d316e6b..5a58f69ce3680f 100644 --- a/lib/routes/nuaa/yjsy/yjsy.js +++ b/lib/routes/nuaa/yjsy/yjsy.js @@ -12,7 +12,7 @@ const map = new Map([ ['ssfc', { title: '师生风采 | 南京航空航天大学研究生院', suffix: '13278/list.htm' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const suffix = map.get(type).suffix; const getDescription = Boolean(ctx.req.param('getDescription')) || false; diff --git a/lib/routes/nuist/bulletin.js b/lib/routes/nuist/bulletin.js index 8f10769e00e4b3..bc787602c9fcf8 100644 --- a/lib/routes/nuist/bulletin.js +++ b/lib/routes/nuist/bulletin.js @@ -21,7 +21,7 @@ const map = { qt: '其他', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = Object.hasOwn(map, ctx.req.param('category')) ? ctx.req.param('category') : '791'; const link = `${baseUrl}/${category}/list.htm`; diff --git a/lib/routes/nuist/cas.js b/lib/routes/nuist/cas.js index 290125e9596ed9..83a87bd2475edd 100644 --- a/lib/routes/nuist/cas.js +++ b/lib/routes/nuist/cas.js @@ -7,7 +7,7 @@ import timezone from '@/utils/timezone'; const baseTitle = 'NUIST AS(南信大大气科学学院)'; const baseUrl = 'https://cas.nuist.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'xxgg' } = ctx.req.param(); const link = `${baseUrl}/index/${category}.htm`; diff --git a/lib/routes/nuist/jwc.js b/lib/routes/nuist/jwc.js index 5c58d4ebfde4ee..bfafdb4b4a0df9 100644 --- a/lib/routes/nuist/jwc.js +++ b/lib/routes/nuist/jwc.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const baseTitle = '南京信息工程大学-教务处'; const baseUrl = 'https://jwc.nuist.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'jxyw' } = ctx.req.param(); const link = `${baseUrl}/${category === 'jxyw' || category === 'xyjx' ? 'index' : 'xxtz'}/${category}.htm`; diff --git a/lib/routes/nuist/library/lib.js b/lib/routes/nuist/library/lib.js index 608d11f4b14adb..9585dba88fa878 100644 --- a/lib/routes/nuist/library/lib.js +++ b/lib/routes/nuist/library/lib.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseTitle = '南京信息工程大学图书馆通知'; const baseUrl = 'https://lib.nuist.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = baseUrl + '/index/tzgg.htm'; const response = await got(link); diff --git a/lib/routes/nuist/router.js b/lib/routes/nuist/router.js index d57531cb947f4e..17187c37e63990 100644 --- a/lib/routes/nuist/router.js +++ b/lib/routes/nuist/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/bulletin/:category?', './bulletin'); router.get('/cas/:category?', './cas'); router.get('/jwc/:category?', './jwc'); diff --git a/lib/routes/nuist/scs.js b/lib/routes/nuist/scs.js index 03cbf3c18363df..b4744aa80c75ab 100644 --- a/lib/routes/nuist/scs.js +++ b/lib/routes/nuist/scs.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseTitle = 'NUIST CS(南信大计软院)'; const baseUrl = 'https://scs.nuist.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'xwkx' } = ctx.req.param(); const link = `${baseUrl}/${category}/list.htm`; diff --git a/lib/routes/nuist/sese.js b/lib/routes/nuist/sese.js index b9db319ae00ed4..aa0b759f0689c6 100644 --- a/lib/routes/nuist/sese.js +++ b/lib/routes/nuist/sese.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const baseTitle = 'NUIST ESE(南信大环科院)'; const baseUrl = 'https://sese.nuist.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'tzgg1' } = ctx.req.param(); const link = `${baseUrl}/${category}.htm`; diff --git a/lib/routes/nuist/xgc.js b/lib/routes/nuist/xgc.js index 92bf8511015dad..ba30f01814f6a4 100644 --- a/lib/routes/nuist/xgc.js +++ b/lib/routes/nuist/xgc.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const baseTitle = '南信大学生工作处'; const baseUrl = 'https://xgc.nuist.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = baseUrl + '/419/list.htm'; const response = await got(link); diff --git a/lib/routes/nuist/yjs.js b/lib/routes/nuist/yjs.js index ab62fe1fea5855..5ee986836899bc 100644 --- a/lib/routes/nuist/yjs.js +++ b/lib/routes/nuist/yjs.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = getSubPath(ctx) === '/yjs/' ? 'index/tzgg' : getSubPath(ctx).replace(/^\/yjs\//, ''); const rootUrl = 'https://yjs.nuist.edu.cn'; diff --git a/lib/routes/nwafu/all.js b/lib/routes/nwafu/all.js index 5935ea0aaf8c62..b2a995f068fe97 100644 --- a/lib/routes/nwafu/all.js +++ b/lib/routes/nwafu/all.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { nwafuMap } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'jiaowu' } = ctx.req.param(); const response = await got.get(nwafuMap.get(type)[0]); const $ = load(response.data); diff --git a/lib/routes/nwafu/router.js b/lib/routes/nwafu/router.js index 90a29f9b3c8cd4..872c7309c81960 100644 --- a/lib/routes/nwafu/router.js +++ b/lib/routes/nwafu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?', './all'); }; diff --git a/lib/routes/nyaa/main.js b/lib/routes/nyaa/main.js index f1e3b88d68e521..cb6660b0000390 100644 --- a/lib/routes/nyaa/main.js +++ b/lib/routes/nyaa/main.js @@ -1,7 +1,7 @@ import { config } from '@/config'; const Parser = require('rss-parser'); -module.exports = async (ctx) => { +export default async (ctx) => { const parser = new Parser({ customFields: { item: ['magnet', ['nyaa:infoHash', 'infoHash']], diff --git a/lib/routes/nyaa/router.js b/lib/routes/nyaa/router.js index c4cf0820f4d64e..839a2b9db5a45f 100644 --- a/lib/routes/nyaa/router.js +++ b/lib/routes/nyaa/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/search/:query?', './main'); router.get('/user/:username?', './main'); router.get('/user/:username/search/:query?', './main'); diff --git a/lib/routes/nytimes/book.js b/lib/routes/nytimes/book.js index 8c547e5b399465..90dfef9a4ea31c 100644 --- a/lib/routes/nytimes/book.js +++ b/lib/routes/nytimes/book.js @@ -15,7 +15,7 @@ const categoryList = { 'young-adult-hardcover': '青少年', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'combined-print-and-e-book-nonfiction'; const url = `https://www.nytimes.com/books/best-sellers/${category}`; diff --git a/lib/routes/nytimes/daily-briefing-chinese.js b/lib/routes/nytimes/daily-briefing-chinese.js index 1f4e55f0b09e6f..a9543e13e874c4 100644 --- a/lib/routes/nytimes/daily-briefing-chinese.js +++ b/lib/routes/nytimes/daily-briefing-chinese.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.nytimes.com'; const currentUrl = `${rootUrl}/zh-hans/series/daily-briefing-chinese`; diff --git a/lib/routes/nytimes/index.js b/lib/routes/nytimes/index.js index c5c7ddd67e26aa..56fc7e2cc03db4 100644 --- a/lib/routes/nytimes/index.js +++ b/lib/routes/nytimes/index.js @@ -5,7 +5,7 @@ const utils = require('./utils'); import { load } from 'cheerio'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { let { lang = '' } = ctx.req.param(); lang = lang.toLowerCase(); diff --git a/lib/routes/nytimes/router.js b/lib/routes/nytimes/router.js index 5070c2742e215c..86544838f3b9b4 100644 --- a/lib/routes/nytimes/router.js +++ b/lib/routes/nytimes/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/book/:category?', './book.js'); router.get('/daily_briefing_chinese', './daily-briefing-chinese.js'); router.get('/:lang?', './index'); diff --git a/lib/routes/oceanengine/arithmetic-index.js b/lib/routes/oceanengine/arithmetic-index.js index e0f9f91f1c33ff..d9bd21e54713fc 100644 --- a/lib/routes/oceanengine/arithmetic-index.js +++ b/lib/routes/oceanengine/arithmetic-index.js @@ -78,7 +78,7 @@ const createContent = (keyword, queryList, queryListText) => })), }); -module.exports = async (ctx) => { +export default async (ctx) => { const now = dayjs(); const start_date = now.subtract(DEFAULT_FETCH_DURATION_MONTH, 'month').format('YYYYMMDD'); const end_date = now.format('YYYYMMDD'); diff --git a/lib/routes/oceanengine/router.js b/lib/routes/oceanengine/router.js index 8d78f94f3d66ad..191f9459e1f23a 100644 --- a/lib/routes/oceanengine/router.js +++ b/lib/routes/oceanengine/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/index/:keyword/:channel?', './arithmetic-index'); }; diff --git a/lib/routes/odaily/activity.js b/lib/routes/odaily/activity.js index 5ab89a85c2f78e..e250f049ad0403 100644 --- a/lib/routes/odaily/activity.js +++ b/lib/routes/odaily/activity.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; const { rootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/service/scheme/group/8?page=1&per_page=${ctx.req.query('limit') ?? 25}`; const response = await got({ diff --git a/lib/routes/odaily/newsflash.js b/lib/routes/odaily/newsflash.js index 9187a20a8e72a6..ebf7fe86d3eb13 100644 --- a/lib/routes/odaily/newsflash.js +++ b/lib/routes/odaily/newsflash.js @@ -3,7 +3,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; const { rootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/api/pp/api/info-flow/newsflash_columns/newsflashes?b_id=&per_page=${ctx.req.query('limit') ?? 100}`; const response = await got({ diff --git a/lib/routes/odaily/post.js b/lib/routes/odaily/post.js index 1439882fea7af1..13eb91b1ee274c 100644 --- a/lib/routes/odaily/post.js +++ b/lib/routes/odaily/post.js @@ -16,7 +16,7 @@ const titles = { 296: '活动', }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '280'; const currentUrl = `${rootUrl}/api/pp/api/app-front/feed-stream?feed_id=${id}&b_id=&per_page=${ctx.req.query('limit') ?? 25}`; diff --git a/lib/routes/odaily/router.js b/lib/routes/odaily/router.js index 5372eaadad800f..53b983c16b462a 100644 --- a/lib/routes/odaily/router.js +++ b/lib/routes/odaily/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/activity', './activity'); router.get('/newsflash', './newsflash'); router.get('/search/news/:keyword', './search-news'); diff --git a/lib/routes/odaily/search-news.js b/lib/routes/odaily/search-news.js index d52c90968c0388..f2c54c29d0a2d9 100644 --- a/lib/routes/odaily/search-news.js +++ b/lib/routes/odaily/search-news.js @@ -3,7 +3,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; const { rootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/api/pp/api/search/entity-search?per_page=${ctx.req.query('limit') ?? 25}&keyword=${ctx.req.param('keyword')}&entity_type=newsflash`; const response = await got({ diff --git a/lib/routes/odaily/user.js b/lib/routes/odaily/user.js index 22f2481887ffd3..0866a9d13ef014 100644 --- a/lib/routes/odaily/user.js +++ b/lib/routes/odaily/user.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; const { rootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const currentUrl = `${rootUrl}/service/feed_stream/user/${id}?b_id=10&per_page=${ctx.req.query('limit') ?? 25}`; diff --git a/lib/routes/oeeee/app/channel.js b/lib/routes/oeeee/app/channel.js index 84f0cafe9dd74c..5e2d2f17aa9fc4 100644 --- a/lib/routes/oeeee/app/channel.js +++ b/lib/routes/oeeee/app/channel.js @@ -6,7 +6,7 @@ const { parseArticle } = require('../utils'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 50; const currentUrl = `https://api-ndapp.oeeee.com/friends.php?m=Zone&a=SpaceDoclist&uid=${id}&type=doc`; diff --git a/lib/routes/oeeee/app/reporter.js b/lib/routes/oeeee/app/reporter.js index 07713a26e96457..4e515c6408be06 100644 --- a/lib/routes/oeeee/app/reporter.js +++ b/lib/routes/oeeee/app/reporter.js @@ -4,7 +4,7 @@ const { parseArticle } = require('../utils'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 0; const currentUrl = `https://m.mp.oeeee.com/show.php?m=Doc&a=getAuthorInfo&id=${id}`; diff --git a/lib/routes/oeeee/router.js b/lib/routes/oeeee/router.js index 9f4eb01cb5062c..b7cb56df509474 100644 --- a/lib/routes/oeeee/router.js +++ b/lib/routes/oeeee/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/web/:channel', './web'); router.get('/app/channel/:id', './app/channel'); router.get('/app/reporter/:id', './app/reporter'); diff --git a/lib/routes/oeeee/web.js b/lib/routes/oeeee/web.js index ce75735888429b..b6977a7a7ae480 100644 --- a/lib/routes/oeeee/web.js +++ b/lib/routes/oeeee/web.js @@ -6,7 +6,7 @@ const { parseArticle } = require('./utils'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel') ?? 0; const currentUrl = `https://www.oeeee.com/api/channel.php?m=Js4channelNews&a=newLatest&cid=${channel}`; diff --git a/lib/routes/oilchem/index.js b/lib/routes/oilchem/index.js index 1a21bea46a2dc8..5ac13030c849ec 100644 --- a/lib/routes/oilchem/index.js +++ b/lib/routes/oilchem/index.js @@ -5,7 +5,7 @@ const routes = require('./routes'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? ''; const category = ctx.req.param('category') ?? ''; const subCategory = ctx.req.param('subCategory') ?? ''; diff --git a/lib/routes/oilchem/router.js b/lib/routes/oilchem/router.js index 1c7097ca66fc62..ec258d92323b49 100644 --- a/lib/routes/oilchem/router.js +++ b/lib/routes/oilchem/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:type?/:category?/:subCategory?', './'); }; diff --git a/lib/routes/oncc/index.js b/lib/routes/oncc/index.js index a8b713666be827..449f046a994558 100644 --- a/lib/routes/oncc/index.js +++ b/lib/routes/oncc/index.js @@ -35,7 +35,7 @@ const channelMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language'); const channel = ctx.req.param('channel') ?? 'news'; const newsUrl = `${rootUrl}/hk/${channel}/index${languageMap[language]}.html`; diff --git a/lib/routes/oncc/money18.js b/lib/routes/oncc/money18.js index 28a25bc8c4883c..77d15e6f53dfa7 100644 --- a/lib/routes/oncc/money18.js +++ b/lib/routes/oncc/money18.js @@ -20,7 +20,7 @@ const sections = { tech: '科技財情', }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'exp'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 30; diff --git a/lib/routes/oncc/router.js b/lib/routes/oncc/router.js index d21a34d5355eda..b1fde730485188 100644 --- a/lib/routes/oncc/router.js +++ b/lib/routes/oncc/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/money18/:id?', './money18'); router.get('/:language/:channel?', './index'); }; diff --git a/lib/routes/onehu/common.js b/lib/routes/onehu/common.js index 0f4e260ad805f7..deec272d2d7860 100644 --- a/lib/routes/onehu/common.js +++ b/lib/routes/onehu/common.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://onehu.xyz'; const response = await got(link); const data = response.data; diff --git a/lib/routes/onehu/router.js b/lib/routes/onehu/router.js index c4336285cc56f2..d8324ea274b64f 100644 --- a/lib/routes/onehu/router.js +++ b/lib/routes/onehu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './common'); }; diff --git a/lib/routes/onet/news.js b/lib/routes/onet/news.js index 1a87966b7618ba..6143b8556d45c2 100644 --- a/lib/routes/onet/news.js +++ b/lib/routes/onet/news.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { parseArticleContent, parseMainImage } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const rssUrl = 'https://wiadomosci.onet.pl/.feed'; const feed = await parser.parseURL(rssUrl); const items = await Promise.all( diff --git a/lib/routes/onet/router.js b/lib/routes/onet/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/onet/router.js +++ b/lib/routes/onet/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/oo-software/changelog.js b/lib/routes/oo-software/changelog.js index 2da0e7e613776e..b3f0ff224821c5 100644 --- a/lib/routes/oo-software/changelog.js +++ b/lib/routes/oo-software/changelog.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'shutup10'; const rootUrl = 'https://www.oo-software.com'; diff --git a/lib/routes/oo-software/router.js b/lib/routes/oo-software/router.js index 1de56ebf0b4db5..d726e61d94f98a 100644 --- a/lib/routes/oo-software/router.js +++ b/lib/routes/oo-software/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/changelog/:id', './changelog'); }; diff --git a/lib/routes/openai/blog.js b/lib/routes/openai/blog.js index 1347bebfde37fb..391b9314b4bf48 100644 --- a/lib/routes/openai/blog.js +++ b/lib/routes/openai/blog.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { toTitleCase } from '@/utils/common-utils'; const { getApiUrl, parseArticle } = require('./common'); -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag') || ''; const rootUrl = 'https://openai.com'; diff --git a/lib/routes/openai/chatgpt.js b/lib/routes/openai/chatgpt.js index 3b516e8a16277c..d61db06e6fe29f 100644 --- a/lib/routes/openai/chatgpt.js +++ b/lib/routes/openai/chatgpt.js @@ -6,7 +6,7 @@ import { config } from '@/config'; dayjs.extend(require('dayjs/plugin/isSameOrBefore')); -module.exports = async (ctx) => { +export default async (ctx) => { const articleUrl = 'https://help.openai.com/en/articles/6825453-chatgpt-release-notes'; const cacheIn = await cache.tryGet( diff --git a/lib/routes/openai/research.js b/lib/routes/openai/research.js index b4ef832b48cd26..fcac0aef31b7de 100644 --- a/lib/routes/openai/research.js +++ b/lib/routes/openai/research.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { getApiUrl, parseArticle } = require('./common'); -module.exports = async (ctx) => { +export default async (ctx) => { const apiUrl = new URL('/api/v1/research-publications', await getApiUrl()); const researchRootUrl = 'https://openai.com/research'; diff --git a/lib/routes/openai/router.js b/lib/routes/openai/router.js index 05e34b6f513fb6..6a519630f896af 100644 --- a/lib/routes/openai/router.js +++ b/lib/routes/openai/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:tag?', './blog'); router.get('/chatgpt/release-notes', './chatgpt'); router.get('/research', './research'); diff --git a/lib/routes/openwrt/releases.js b/lib/routes/openwrt/releases.js index 9cbee47883894b..33fc38e255d95e 100644 --- a/lib/routes/openwrt/releases.js +++ b/lib/routes/openwrt/releases.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const brand = ctx.req.param('brand'); const model = ctx.req.param('model'); const url = `https://openwrt.org/toh/${brand}/${model}`; diff --git a/lib/routes/openwrt/router.js b/lib/routes/openwrt/router.js index e74a3720336957..e661601bcbc178 100644 --- a/lib/routes/openwrt/router.js +++ b/lib/routes/openwrt/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/releases/:brand/:model', './releases'); }; diff --git a/lib/routes/orcid/index.js b/lib/routes/orcid/index.js index ef4ea1eb6be484..07ff8e7222e250 100644 --- a/lib/routes/orcid/index.js +++ b/lib/routes/orcid/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://orcid.org/'; const currentUrl = `${rootUrl}${id}/worksPage.json?offset=0&sort=date&sortAsc=false&pageSize=20`; diff --git a/lib/routes/orcid/router.js b/lib/routes/orcid/router.js index 4d3b1e694acf5f..c79f907ed7d0b5 100644 --- a/lib/routes/orcid/router.js +++ b/lib/routes/orcid/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id', './index'); }; diff --git a/lib/routes/oreno3d/main.js b/lib/routes/oreno3d/main.js index aa038c2c302ce5..aaf8a876e3e738 100644 --- a/lib/routes/oreno3d/main.js +++ b/lib/routes/oreno3d/main.js @@ -35,7 +35,7 @@ function get_user_url(rootUrl, ctx, sort) { } return userUrl; } -module.exports = async (ctx) => { +export default async (ctx) => { // 获取视频链接列表及标题 function getLinksTitle(response) { const selector = 'a.box'; diff --git a/lib/routes/oreno3d/router.js b/lib/routes/oreno3d/router.js index 65d4ae11cf79b5..5092b66e2602c4 100644 --- a/lib/routes/oreno3d/router.js +++ b/lib/routes/oreno3d/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/authors/:authorid/:sort/:pagelimit?', './main'); router.get('/characters/:characterid/:sort/:pagelimit?', './main'); router.get('/origins/:originid/:sort/:pagelimit?', './main'); diff --git a/lib/routes/oschina/news.js b/lib/routes/oschina/news.js index fe01fc3d49ca16..877fd72fe92b8b 100644 --- a/lib/routes/oschina/news.js +++ b/lib/routes/oschina/news.js @@ -32,7 +32,7 @@ const configs = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'all'; const config = configs[category]; diff --git a/lib/routes/oschina/router.js b/lib/routes/oschina/router.js index aab2bb047e3549..b0dac120b3d998 100644 --- a/lib/routes/oschina/router.js +++ b/lib/routes/oschina/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:category?', './news'); router.get('/topic/:topic', './topic'); router.get('/u/:uid', './user'); diff --git a/lib/routes/oschina/topic.js b/lib/routes/oschina/topic.js index e7bc4b1a25ed24..c2e1ef675700bf 100644 --- a/lib/routes/oschina/topic.js +++ b/lib/routes/oschina/topic.js @@ -10,7 +10,7 @@ async function loadContent(link) { return content; } -module.exports = async (ctx) => { +export default async (ctx) => { const topic = ctx.req.param('topic'); const topicUrl = `https://www.oschina.net/question/topic/${topic}?show=time`; diff --git a/lib/routes/oschina/user.js b/lib/routes/oschina/user.js index e85762c0997ea3..4ab3a3417c1746 100644 --- a/lib/routes/oschina/user.js +++ b/lib/routes/oschina/user.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id, uid } = ctx.req.param(); const res = id ? await got(`https://my.oschina.net/${id}`) : await got(`https://my.oschina.net/u/${uid}`); const $ = load(res.data); diff --git a/lib/routes/oshwhub/explore.js b/lib/routes/oshwhub/explore.js index 7f2803ba7f8355..ddc7db6d0457d0 100644 --- a/lib/routes/oshwhub/explore.js +++ b/lib/routes/oshwhub/explore.js @@ -48,7 +48,7 @@ const requestImages = (url, tryGet) => return { images, boms }; }); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://oshwhub.com'; const sortType = ctx.req.param('sortType') ?? 'updatedTime'; diff --git a/lib/routes/oshwhub/router.js b/lib/routes/oshwhub/router.js index c5c6220bb8b61d..26dc16c7cc04b4 100644 --- a/lib/routes/oshwhub/router.js +++ b/lib/routes/oshwhub/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:sortType?', './explore'); }; diff --git a/lib/routes/osu/beatmaps/packs.js b/lib/routes/osu/beatmaps/packs.js index b8db5816f32205..d36ca5ce214e25 100644 --- a/lib/routes/osu/beatmaps/packs.js +++ b/lib/routes/osu/beatmaps/packs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'standard' } = ctx.req.param(); const link = `https://osu.ppy.sh/beatmaps/packs?type=${type}`; diff --git a/lib/routes/osu/router.js b/lib/routes/osu/router.js index ec0b792e376cf8..b6add5e08ec2d2 100644 --- a/lib/routes/osu/router.js +++ b/lib/routes/osu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/packs/:type?', './beatmaps/packs'); }; diff --git a/lib/routes/otobanana/cast.js b/lib/routes/otobanana/cast.js index ae377444676a6e..12824e087496f1 100644 --- a/lib/routes/otobanana/cast.js +++ b/lib/routes/otobanana/cast.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { apiBase, baseUrl, getUserInfo, renderCast } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const userInfo = await getUserInfo(id, cache.tryGet); diff --git a/lib/routes/otobanana/livestream.js b/lib/routes/otobanana/livestream.js index ae32edf2d9561f..c2062f29fe8ce7 100644 --- a/lib/routes/otobanana/livestream.js +++ b/lib/routes/otobanana/livestream.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { apiBase, baseUrl, getUserInfo, renderLive } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const userInfo = await getUserInfo(id, cache.tryGet); diff --git a/lib/routes/otobanana/router.js b/lib/routes/otobanana/router.js index b544fb3f4f89b6..3cfd941f4270d5 100644 --- a/lib/routes/otobanana/router.js +++ b/lib/routes/otobanana/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/user/:id', './timeline'); router.get('/user/:id/cast', './cast'); router.get('/user/:id/livestream', './livestream'); diff --git a/lib/routes/otobanana/timeline.js b/lib/routes/otobanana/timeline.js index fdadf6988e0bfb..949c8fcff5135c 100644 --- a/lib/routes/otobanana/timeline.js +++ b/lib/routes/otobanana/timeline.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { apiBase, baseUrl, getUserInfo, renderPost } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const userInfo = await getUserInfo(id, cache.tryGet); diff --git a/lib/routes/ouc/it-postgraduate.js b/lib/routes/ouc/it-postgraduate.js index 26839b1fd90d37..89f329927a4e26 100644 --- a/lib/routes/ouc/it-postgraduate.js +++ b/lib/routes/ouc/it-postgraduate.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://it.ouc.edu.cn/_s381/16619/list.psp'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/ouc/it-tx.js b/lib/routes/ouc/it-tx.js index 8c869d1f4f43eb..bf761ffdcbc1be 100644 --- a/lib/routes/ouc/it-tx.js +++ b/lib/routes/ouc/it-tx.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://it.ouc.edu.cn'; const id = ctx.req.param('id') || 'xwdt'; const link = `${host}/tx/${id}/list.htm`; diff --git a/lib/routes/ouc/it.js b/lib/routes/ouc/it.js index 92d97711273e79..528558e57123e3 100644 --- a/lib/routes/ouc/it.js +++ b/lib/routes/ouc/it.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://it.ouc.edu.cn'; const typelist = ['学院要闻', '学院公告', '学术活动']; const urlList = ['xyyw/list.htm', 'xygg/list.htm', 'xshd/list.htm']; diff --git a/lib/routes/ouc/jwc.js b/lib/routes/ouc/jwc.js index 6caf6af1a13de0..ba50ff5b725af3 100644 --- a/lib/routes/ouc/jwc.js +++ b/lib/routes/ouc/jwc.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://jwc.ouc.edu.cn/6517/list.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/ouc/jwgl.js b/lib/routes/ouc/jwgl.js index ffd459ef001ec0..7d181856f1e000 100644 --- a/lib/routes/ouc/jwgl.js +++ b/lib/routes/ouc/jwgl.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://jwgl.ouc.edu.cn/public/listSchoolNotices.action?currentPage=1&recordsPerPage=15&qtitle='; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/ouc/router.js b/lib/routes/ouc/router.js index fa6d0dccb24505..368bf9b05e5681 100644 --- a/lib/routes/ouc/router.js +++ b/lib/routes/ouc/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/it/postgraduate', './it-postgraduate'); router.get('/it/tx/:id?', './it-tx'); router.get('/it/:type?', './it'); diff --git a/lib/routes/ouc/yjs.js b/lib/routes/ouc/yjs.js index 30b73ae13a69b2..553db0cf90f3f3 100644 --- a/lib/routes/ouc/yjs.js +++ b/lib/routes/ouc/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://yz.ouc.edu.cn/5926/list.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/oup/index.js b/lib/routes/oup/index.js index 5e30597b84780e..b68af541d83fb5 100644 --- a/lib/routes/oup/index.js +++ b/lib/routes/oup/index.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; const rootUrl = 'https://academic.oup.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const url = `${rootUrl}/${name}/issue`; diff --git a/lib/routes/oup/router.js b/lib/routes/oup/router.js index 5ef2431c2cde7b..281b92222be4a3 100644 --- a/lib/routes/oup/router.js +++ b/lib/routes/oup/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/journals/:name', './index'); }; diff --git a/lib/routes/outagereport/index.js b/lib/routes/outagereport/index.js index d43d216276a8e3..d012344d346e41 100644 --- a/lib/routes/outagereport/index.js +++ b/lib/routes/outagereport/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const baseUrl = 'https://outage.report/'; -module.exports = async (ctx) => { +export default async (ctx) => { const serviceName = ctx.req.param('name'); // Which service do you want to monitor? Have to be the same as what it appears in URL. const watchCount = ctx.req.param('count') || 10; // How many reports is received during last 20 minutes? 10 reports as default. const url = `${baseUrl}${serviceName}`; diff --git a/lib/routes/outagereport/router.js b/lib/routes/outagereport/router.js index d92d0161b8017c..6d7cb82d294829 100644 --- a/lib/routes/outagereport/router.js +++ b/lib/routes/outagereport/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:name/:count?', './index'); }; diff --git a/lib/routes/panewslab/author.js b/lib/routes/panewslab/author.js index 2755098ed18539..30beb1cc9964ed 100644 --- a/lib/routes/panewslab/author.js +++ b/lib/routes/panewslab/author.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://panewslab.com'; diff --git a/lib/routes/panewslab/index.js b/lib/routes/panewslab/index.js index 300d71c254abc3..66cc99ef50d468 100644 --- a/lib/routes/panewslab/index.js +++ b/lib/routes/panewslab/index.js @@ -18,7 +18,7 @@ const categories = { 活动: 'zqives', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '精选'; const rootUrl = 'https://panewslab.com'; diff --git a/lib/routes/panewslab/news.js b/lib/routes/panewslab/news.js index 255cb332e63a8d..84f6485164f517 100644 --- a/lib/routes/panewslab/news.js +++ b/lib/routes/panewslab/news.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://panewslab.com'; const apiUrl = `${rootUrl}/webapi/flashnews?LId=1&Rn=${ctx.req.query('limit') ?? 50}&tw=0`; const currentUrl = `${rootUrl}/zh/news/index.html`; diff --git a/lib/routes/panewslab/router.js b/lib/routes/panewslab/router.js index 8a9c1503cbec8b..b99c746b43847d 100644 --- a/lib/routes/panewslab/router.js +++ b/lib/routes/panewslab/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/author/:id', './author'); router.get('/column/:id', './author'); router.get('/news', './news'); diff --git a/lib/routes/panewslab/topic.js b/lib/routes/panewslab/topic.js index 593388bb0b0fa8..93f7b3949fc985 100644 --- a/lib/routes/panewslab/topic.js +++ b/lib/routes/panewslab/topic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://panewslab.com'; diff --git a/lib/routes/papers/index.js b/lib/routes/papers/index.js index a94b89a0b39e12..10eab9ddae72bf 100644 --- a/lib/routes/papers/index.js +++ b/lib/routes/papers/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'arxiv/cs.CL' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 150; diff --git a/lib/routes/papers/router.js b/lib/routes/papers/router.js index 5c89b519009bee..cffd8f2def5c8c 100644 --- a/lib/routes/papers/router.js +++ b/lib/routes/papers/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category*', './'); }; diff --git a/lib/routes/paradigm/router.js b/lib/routes/paradigm/router.js index 203b11bd735700..cebd1756637c46 100644 --- a/lib/routes/paradigm/router.js +++ b/lib/routes/paradigm/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/writing', './writing'); }; diff --git a/lib/routes/paradigm/writing.js b/lib/routes/paradigm/writing.js index e745b3efa68c4a..15ca7395746be3 100644 --- a/lib/routes/paradigm/writing.js +++ b/lib/routes/paradigm/writing.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.paradigm.xyz'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${baseUrl}/writing`; const response = await got(url); diff --git a/lib/routes/parliament/router.js b/lib/routes/parliament/router.js index b6b7483b36baf5..4823c2dc95e256 100644 --- a/lib/routes/parliament/router.js +++ b/lib/routes/parliament/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/section77/:type?', './section77'); }; diff --git a/lib/routes/parliament/section77.js b/lib/routes/parliament/section77.js index 7e561d52f3392d..b6757400a562c0 100644 --- a/lib/routes/parliament/section77.js +++ b/lib/routes/parliament/section77.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; const { CookieJar } = require('tough-cookie'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.parliament.go.th/section77'; const { type = '' } = ctx.req.param(); const cookieJar = new CookieJar(); diff --git a/lib/routes/patagonia/new-arrivals.js b/lib/routes/patagonia/new-arrivals.js index 13a5d5176be28d..8f1a40b67e58ee 100644 --- a/lib/routes/patagonia/new-arrivals.js +++ b/lib/routes/patagonia/new-arrivals.js @@ -15,7 +15,7 @@ function extractSfrmUrl(url) { urlObj.search = new URLSearchParams({ sfrm: sfrmValue }).toString(); return urlObj.toString(); } -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const url = `${host}/on/demandware.store/Sites-patagonia-us-Site/en_US/Search-LazyGrid`; const response = await got({ diff --git a/lib/routes/patagonia/router.js b/lib/routes/patagonia/router.js index befb7acb0dd3b4..c239f63c36d04f 100644 --- a/lib/routes/patagonia/router.js +++ b/lib/routes/patagonia/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/new-arrivals/:category', './new-arrivals'); }; diff --git a/lib/routes/paulgraham/article.js b/lib/routes/paulgraham/article.js index a38f47f032e2f6..1899ea14368ea3 100644 --- a/lib/routes/paulgraham/article.js +++ b/lib/routes/paulgraham/article.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; const rootUrl = 'http://paulgraham.com'; diff --git a/lib/routes/paulgraham/router.js b/lib/routes/paulgraham/router.js index c639041e5645a4..2ce60784c3ec8c 100644 --- a/lib/routes/paulgraham/router.js +++ b/lib/routes/paulgraham/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/articles', './article'); router.get('/essays', './article'); router.get('/', './article'); diff --git a/lib/routes/penguin-random-house/articles.js b/lib/routes/penguin-random-house/articles.js index d05cbc2888b1e4..100dfd7778b79e 100644 --- a/lib/routes/penguin-random-house/articles.js +++ b/lib/routes/penguin-random-house/articles.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import { load } from 'cheerio'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.penguinrandomhouse.com/articles/'; const res = await got(link); const $ = load(res.data); diff --git a/lib/routes/penguin-random-house/router.js b/lib/routes/penguin-random-house/router.js index e262625ab862c5..47a09d3b74e344 100644 --- a/lib/routes/penguin-random-house/router.js +++ b/lib/routes/penguin-random-house/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/articles', './articles'); router.get('/the-read-down', './thereaddown'); }; diff --git a/lib/routes/penguin-random-house/thereaddown.js b/lib/routes/penguin-random-house/thereaddown.js index c6ccc0a288be63..68df88d48e3e8d 100644 --- a/lib/routes/penguin-random-house/thereaddown.js +++ b/lib/routes/penguin-random-house/thereaddown.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import { load } from 'cheerio'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.penguinrandomhouse.com/the-read-down/'; const res = await got(link); const $ = load(res.data); diff --git a/lib/routes/people/index.js b/lib/routes/people/index.js index cc40ac42502bea..dfe478caae74eb 100644 --- a/lib/routes/people/index.js +++ b/lib/routes/people/index.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const { site = 'www' } = ctx.req.param(); let { category = site === 'www' ? '59476' : '' } = ctx.req.param(); category = site === 'cpc' && category === '24h' ? '87228' : category; diff --git a/lib/routes/people/liuyan.js b/lib/routes/people/liuyan.js index d17e40ace97110..6a66bc46e2494d 100644 --- a/lib/routes/people/liuyan.js +++ b/lib/routes/people/liuyan.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const fid = ctx.req.param('id'); const state = ctx.req.param('state') ?? '1'; diff --git a/lib/routes/people/router.js b/lib/routes/people/router.js index 6b23712b42dbf6..6f2aa9bc48b211 100644 --- a/lib/routes/people/router.js +++ b/lib/routes/people/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/liuyan/:id/:state?', './liuyan'); router.get('/xjpjh/:keyword?/:year?', './xjpjh'); router.get('/:site?/:category*', './'); diff --git a/lib/routes/people/xjpjh.js b/lib/routes/people/xjpjh.js index 5b3fc8f4199905..f89770363ffb6a 100644 --- a/lib/routes/people/xjpjh.js +++ b/lib/routes/people/xjpjh.js @@ -5,7 +5,7 @@ const url = require('url'); const host = 'http://jhsjk.people.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { let keyword = ctx.req.param('keyword') || 'all'; let year = ctx.req.param('year') || 0; diff --git a/lib/routes/peopo/router.js b/lib/routes/peopo/router.js index 1feb8eafccddf2..a7ac0aa6baa268 100644 --- a/lib/routes/peopo/router.js +++ b/lib/routes/peopo/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/topic/:topicId?', './topic'); }; diff --git a/lib/routes/peopo/topic.js b/lib/routes/peopo/topic.js index 84b47cb10a5da9..485a8765f6ec9a 100644 --- a/lib/routes/peopo/topic.js +++ b/lib/routes/peopo/topic.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const baseUrl = 'https://www.peopo.org'; -module.exports = async (ctx) => { +export default async (ctx) => { const { topicId = '159' } = ctx.req.param(); const url = `${baseUrl}/topic/${topicId}`; const response = await got(url); diff --git a/lib/routes/phoronix/index.js b/lib/routes/phoronix/index.js index 9fd4c80f36d619..f56e6903e81492 100644 --- a/lib/routes/phoronix/index.js +++ b/lib/routes/phoronix/index.js @@ -109,7 +109,7 @@ const tryFetch = async (category, topic) => { return feed; }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category, topic } = ctx.req.param(); let feed; switch (category) { diff --git a/lib/routes/phoronix/router.js b/lib/routes/phoronix/router.js index 065e0b03947682..0a5493c46a6e43 100644 --- a/lib/routes/phoronix/router.js +++ b/lib/routes/phoronix/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?/:topic?', './index'); }; diff --git a/lib/routes/pianyuan/app.js b/lib/routes/pianyuan/app.js index 335be9d9e6b8ec..6d90d6ff640edb 100644 --- a/lib/routes/pianyuan/app.js +++ b/lib/routes/pianyuan/app.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const media = ctx.req.param('media') ?? -1; const link_base = 'https://pianyuan.org/'; let description = '电影和剧集'; diff --git a/lib/routes/pianyuan/router.js b/lib/routes/pianyuan/router.js index 0bbad6e79dd75c..f2a5f687bb6b6d 100644 --- a/lib/routes/pianyuan/router.js +++ b/lib/routes/pianyuan/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/index/:media?', './app'); router.get('/indexers/pianyuan/results/search/api', './search'); }; diff --git a/lib/routes/pianyuan/search.js b/lib/routes/pianyuan/search.js index 20e7c7d84d81e6..c2497aeeb8da93 100644 --- a/lib/routes/pianyuan/search.js +++ b/lib/routes/pianyuan/search.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const link_base = 'https://pianyuan.org/'; const description = '搜索'; // 适配jackett 搜索api, eg: https://rsshub.app/pianyuan/indexers/pianyuan/results/search/api?t=test&q=halo diff --git a/lib/routes/picnob/router.js b/lib/routes/picnob/router.js index ed709f330aa29a..a7fbaa70aa8a1e 100644 --- a/lib/routes/picnob/router.js +++ b/lib/routes/picnob/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/user/:id', './user'); }; diff --git a/lib/routes/picnob/user.js b/lib/routes/picnob/user.js index c0ce13df895404..8ca5947d5bc088 100644 --- a/lib/routes/picnob/user.js +++ b/lib/routes/picnob/user.js @@ -7,7 +7,7 @@ import * as path from 'node:path'; const { puppeteerGet } = require('./utils'); import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.picnob.com'; const id = ctx.req.param('id'); const url = `${baseUrl}/profile/${id}/`; diff --git a/lib/routes/picuki/profile.js b/lib/routes/picuki/profile.js index 3a9269ade9a57b..d602de7867e3ae 100644 --- a/lib/routes/picuki/profile.js +++ b/lib/routes/picuki/profile.js @@ -20,7 +20,7 @@ function deVideo(media) { return media_deVideo; } -module.exports = async (ctx) => { +export default async (ctx) => { // use Puppeteer due to the obstacle by cloudflare challenge const browser = await puppeteer(); diff --git a/lib/routes/picuki/router.js b/lib/routes/picuki/router.js index 97e20b01881fd9..5673f37e15d94f 100644 --- a/lib/routes/picuki/router.js +++ b/lib/routes/picuki/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/profile/:id/:functionalFlag?', './profile'); }; diff --git a/lib/routes/pikabu/community.js b/lib/routes/pikabu/community.js index bff58000db3c9c..0f90eadef815f4 100644 --- a/lib/routes/pikabu/community.js +++ b/lib/routes/pikabu/community.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, fixImage, fixVideo } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { type, name, sort = 'new' } = ctx.req.param(); const sortString = sort === 'default' || type === 'tag' ? '' : `/${sort}`; const { data: response } = await got(`${baseUrl}/ajax/${type}/${name}${sortString}`); diff --git a/lib/routes/pikabu/router.js b/lib/routes/pikabu/router.js index 7a7ef26340d7ef..8c4f03e0d0f1d0 100644 --- a/lib/routes/pikabu/router.js +++ b/lib/routes/pikabu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/user/:name', './user'); router.get('/:type/:name', './community'); }; diff --git a/lib/routes/pikabu/user.js b/lib/routes/pikabu/user.js index 2e05417bad9277..84b464161c92a9 100644 --- a/lib/routes/pikabu/user.js +++ b/lib/routes/pikabu/user.js @@ -4,7 +4,7 @@ const iconv = require('iconv-lite'); import { parseDate } from '@/utils/parse-date'; const { baseUrl, fixImage, fixVideo } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const link = `${baseUrl}/${name}`; const response = await got(link, { diff --git a/lib/routes/pincong/hot.js b/lib/routes/pincong/hot.js index 3525dffd9642fc..43b7092e0d7471 100644 --- a/lib/routes/pincong/hot.js +++ b/lib/routes/pincong/hot.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, puppeteerGet } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '0' } = ctx.req.param(); const url = `${baseUrl}/hot/list/category-${category}`; diff --git a/lib/routes/pincong/index.js b/lib/routes/pincong/index.js index 754322f559ba95..5837f6cb57bb37 100644 --- a/lib/routes/pincong/index.js +++ b/lib/routes/pincong/index.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, puppeteerGet } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { let url = `${baseUrl}/`; const sortMap = { diff --git a/lib/routes/pincong/router.js b/lib/routes/pincong/router.js index 5b1a0dfec7eaed..42a0bc0256b672 100644 --- a/lib/routes/pincong/router.js +++ b/lib/routes/pincong/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/category/:category?/:sort?', './index'); router.get('/hot/:category?', './hot'); router.get('/topic/:topic', './topic'); diff --git a/lib/routes/pincong/topic.js b/lib/routes/pincong/topic.js index 73b725b642cf65..3a75a2ed24cb23 100644 --- a/lib/routes/pincong/topic.js +++ b/lib/routes/pincong/topic.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, puppeteerGet } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${baseUrl}/topic/${ctx.req.param('topic')}`; // use Puppeteer due to the obstacle by cloudflare challenge diff --git a/lib/routes/pingwest/router.js b/lib/routes/pingwest/router.js index 9f6afb29a6d161..132adfabdc5fbf 100644 --- a/lib/routes/pingwest/router.js +++ b/lib/routes/pingwest/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/status', './status'); router.get('/tag/:tag/:type/:option?', './tag'); router.get('/user/:uid/:type?/:option?', './user'); diff --git a/lib/routes/pingwest/status.js b/lib/routes/pingwest/status.js index 3efa06de3ed381..8ae9e64875b4c2 100644 --- a/lib/routes/pingwest/status.js +++ b/lib/routes/pingwest/status.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.pingwest.com'; const url = `${baseUrl}/api/state/list`; const response = await got(url, { diff --git a/lib/routes/pingwest/tag.js b/lib/routes/pingwest/tag.js index 325ee54edbec98..7ef4927fa57b80 100644 --- a/lib/routes/pingwest/tag.js +++ b/lib/routes/pingwest/tag.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { tag, type, option } = ctx.req.param(); const needFullText = option === 'fulltext'; diff --git a/lib/routes/pingwest/user.js b/lib/routes/pingwest/user.js index 0c7cf55879fa0b..3ebb95ead95319 100644 --- a/lib/routes/pingwest/user.js +++ b/lib/routes/pingwest/user.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { uid, type = 'article', option } = ctx.req.param(); const baseUrl = 'https://www.pingwest.com'; const aimUrl = `${baseUrl}/user/${uid}/${type}`; diff --git a/lib/routes/pixabay/router.js b/lib/routes/pixabay/router.js index a8b1c9297e9389..9c2a2543a4b22e 100644 --- a/lib/routes/pixabay/router.js +++ b/lib/routes/pixabay/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/search/:q/:order?', './search'); }; diff --git a/lib/routes/pixabay/search.js b/lib/routes/pixabay/search.js index 0b39decd05a0dd..1860b96aa213ba 100644 --- a/lib/routes/pixabay/search.js +++ b/lib/routes/pixabay/search.js @@ -4,7 +4,7 @@ import { config } from '@/config'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { q, order = 'latest' } = ctx.req.param(); const key = config.pixabay?.key ?? '7329690-bbadad6d872ba577d5a358679'; const baseUrl = 'https://pixabay.com'; diff --git a/lib/routes/pixiv/bookmarks.js b/lib/routes/pixiv/bookmarks.js index ea5791c9f07a50..67d5c14aa76aaf 100644 --- a/lib/routes/pixiv/bookmarks.js +++ b/lib/routes/pixiv/bookmarks.js @@ -6,7 +6,7 @@ import { config } from '@/config'; const pixivUtils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { throw new Error('pixiv RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/pixiv/illustfollow.js b/lib/routes/pixiv/illustfollow.js index 7a8f7fb59be515..1bb0df581311a6 100644 --- a/lib/routes/pixiv/illustfollow.js +++ b/lib/routes/pixiv/illustfollow.js @@ -5,7 +5,7 @@ import { config } from '@/config'; const pixivUtils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { throw new Error('pixiv RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/pixiv/novels.js b/lib/routes/pixiv/novels.js index ef24d57c867a6d..e6863864589f3e 100644 --- a/lib/routes/pixiv/novels.js +++ b/lib/routes/pixiv/novels.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.pixiv.net'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { limit = 100 } = ctx.req.query(); const url = `${baseUrl}/users/${id}/novels`; diff --git a/lib/routes/pixiv/ranking.js b/lib/routes/pixiv/ranking.js index 4afd87f1b2f7bf..e5c12571a79572 100644 --- a/lib/routes/pixiv/ranking.js +++ b/lib/routes/pixiv/ranking.js @@ -56,7 +56,7 @@ const alias = { r18g: 'week_r18g', }; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { throw new Error('pixiv RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/pixiv/router.js b/lib/routes/pixiv/router.js index fff412930071b0..e825db5a85960b 100644 --- a/lib/routes/pixiv/router.js +++ b/lib/routes/pixiv/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/ranking/:mode/:date?', './ranking'); router.get('/search/:keyword/:order?/:mode?', './search'); router.get('/user/bookmarks/:id', './bookmarks'); diff --git a/lib/routes/pixiv/search.js b/lib/routes/pixiv/search.js index 8ecfd30b17d36f..ffe010782ef202 100644 --- a/lib/routes/pixiv/search.js +++ b/lib/routes/pixiv/search.js @@ -6,7 +6,7 @@ import { config } from '@/config'; const pixivUtils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { throw new Error('pixiv RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/pixiv/user.js b/lib/routes/pixiv/user.js index e5d3d766add766..1ab8ed2a5288c5 100644 --- a/lib/routes/pixiv/user.js +++ b/lib/routes/pixiv/user.js @@ -5,7 +5,7 @@ import { config } from '@/config'; const pixivUtils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { throw new Error('pixiv RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/piyao/jrpy.js b/lib/routes/piyao/jrpy.js index 5d06a217f7e800..36584bd4c6666c 100644 --- a/lib/routes/piyao/jrpy.js +++ b/lib/routes/piyao/jrpy.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.piyao.org.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/jrpy/index.htm`; const response = await got(currentUrl); diff --git a/lib/routes/piyao/router.js b/lib/routes/piyao/router.js index a0ecf3fec77280..5536e156579694 100644 --- a/lib/routes/piyao/router.js +++ b/lib/routes/piyao/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/jrpy', './jrpy'); }; diff --git a/lib/routes/pkmer/recent.js b/lib/routes/pkmer/recent.js index d90e4c08db8c73..000c03b4cad0a0 100644 --- a/lib/routes/pkmer/recent.js +++ b/lib/routes/pkmer/recent.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const baseUrl = 'https://pkmer.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got(`${baseUrl}/page/1/`); const $ = load(response); const items = process($); diff --git a/lib/routes/pkmer/router.js b/lib/routes/pkmer/router.js index c71d8147b2d512..a442ba56e4e0b7 100644 --- a/lib/routes/pkmer/router.js +++ b/lib/routes/pkmer/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/recent', './recent.js'); }; diff --git a/lib/routes/pku/bbs/hot.js b/lib/routes/pku/bbs/hot.js index d1b12c0d8d6e05..2c15a13553b0d4 100644 --- a/lib/routes/pku/bbs/hot.js +++ b/lib/routes/pku/bbs/hot.js @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const cookie = config.pkubbs.cookie; const headers = {}; if (cookie) { diff --git a/lib/routes/pku/cls/announcement.js b/lib/routes/pku/cls/announcement.js index 3004da393c4ec7..cf54e6407942b6 100644 --- a/lib/routes/pku/cls/announcement.js +++ b/lib/routes/pku/cls/announcement.js @@ -7,7 +7,7 @@ const homeUrl = 'https://bio.pku.edu.cn/homes/Index/news/21/21.html'; const baseUrl = 'https://bio.pku.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(homeUrl); const $ = load(response.data); diff --git a/lib/routes/pku/cls/lecture.js b/lib/routes/pku/cls/lecture.js index 59d81501c0c835..511d4da78dd0eb 100644 --- a/lib/routes/pku/cls/lecture.js +++ b/lib/routes/pku/cls/lecture.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const homeUrl = 'http://bio.pku.edu.cn/homes/Index/news_jz/7/7.html'; const baseUrl = 'http://bio.pku.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(homeUrl); const $ = load(response.data); diff --git a/lib/routes/pku/eecs.js b/lib/routes/pku/eecs.js index ace5db70101dc6..d425d48721cc3d 100644 --- a/lib/routes/pku/eecs.js +++ b/lib/routes/pku/eecs.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const { eecsMap } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://eecs.pku.edu.cn'; let type = ctx.params && Number.parseInt(ctx.req.param('type')); diff --git a/lib/routes/pku/hr.js b/lib/routes/pku/hr.js index df065757c5f0ff..93dbd575010f38 100644 --- a/lib/routes/pku/hr.js +++ b/lib/routes/pku/hr.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category')?.replace(/-/g, '/') ?? 'zxgg'; const rootUrl = 'https://hr.pku.edu.cn/'; diff --git a/lib/routes/pku/nsd.js b/lib/routes/pku/nsd.js index d8bc65896bb612..dfe720b83371a5 100644 --- a/lib/routes/pku/nsd.js +++ b/lib/routes/pku/nsd.js @@ -20,7 +20,7 @@ const pageType = (href) => { } }; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ url: baseUrl, https: { rejectUnauthorized: false } }); const $ = load(response.data); diff --git a/lib/routes/pku/pkuyjs.js b/lib/routes/pku/pkuyjs.js index 0da532df2ee87e..7b109b8f1ecdd9 100644 --- a/lib/routes/pku/pkuyjs.js +++ b/lib/routes/pku/pkuyjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://admission.pku.edu.cn/zsxx/sszs/index.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/pku/rccp/mzyt.js b/lib/routes/pku/rccp/mzyt.js index 894a582c318bc0..fb436b2d831926 100644 --- a/lib/routes/pku/rccp/mzyt.js +++ b/lib/routes/pku/rccp/mzyt.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.rccp.pku.edu.cn/mzyt/'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(baseUrl); const $ = load(response.data); diff --git a/lib/routes/pku/router.js b/lib/routes/pku/router.js index 20a55891303565..1575454cfaf717 100644 --- a/lib/routes/pku/router.js +++ b/lib/routes/pku/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/admission/sszs', './pkuyjs'); router.get('/bbs/hot', './bbs/hot'); router.get('/cls/announcement', './cls/announcement'); diff --git a/lib/routes/pku/scc/recruit.js b/lib/routes/pku/scc/recruit.js index 52b6c415906af3..0a43862146f185 100644 --- a/lib/routes/pku/scc/recruit.js +++ b/lib/routes/pku/scc/recruit.js @@ -13,7 +13,7 @@ const arr = { }; const baseUrl = 'https://scc.pku.edu.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'zpxx'; const rootUrl = baseUrl + arr[type]; diff --git a/lib/routes/pku/ss/admission.js b/lib/routes/pku/ss/admission.js index 3845eb5d9ad563..5175c299401ae4 100644 --- a/lib/routes/pku/ss/admission.js +++ b/lib/routes/pku/ss/admission.js @@ -3,7 +3,7 @@ const { baseUrl, getSingleRecord, getArticle } = require('./common'); const host = `${baseUrl}/admission/admnotice/`; -module.exports = async (ctx) => { +export default async (ctx) => { const items = await getSingleRecord(host); const out = await Promise.all(items.map((item) => getArticle(item, cache.tryGet))); diff --git a/lib/routes/pku/ss/notice.js b/lib/routes/pku/ss/notice.js index ca80203f84d72d..083b6fa0c68676 100644 --- a/lib/routes/pku/ss/notice.js +++ b/lib/routes/pku/ss/notice.js @@ -3,7 +3,7 @@ const { baseUrl, getSingleRecord, getArticle } = require('./common'); const host = `${baseUrl}/newscenter/notice/`; -module.exports = async (ctx) => { +export default async (ctx) => { const items = await getSingleRecord(host); const out = await Promise.all(items.map((item) => getArticle(item, cache.tryGet))); diff --git a/lib/routes/pku/ss/pg-admin.js b/lib/routes/pku/ss/pg-admin.js index a4f0a062e655b0..d0e6970f825482 100644 --- a/lib/routes/pku/ss/pg-admin.js +++ b/lib/routes/pku/ss/pg-admin.js @@ -3,7 +3,7 @@ const { baseUrl, getSingleRecord, getArticle } = require('./common'); const host = `${baseUrl}/admission/admbrochure/`; -module.exports = async (ctx) => { +export default async (ctx) => { const items = await getSingleRecord(host); const out = await Promise.all(items.map((item) => getArticle(item, cache.tryGet))); diff --git a/lib/routes/playno1/av.js b/lib/routes/playno1/av.js index 71d8b0fed3a165..ecb251ac4cc802 100644 --- a/lib/routes/playno1/av.js +++ b/lib/routes/playno1/av.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const { cookieJar, processArticle } = require('./utils'); const baseUrl = 'http://www.playno1.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { catid = '78' } = ctx.req.param(); const url = `${baseUrl}/portal.php?mod=list&catid=${catid}`; const response = await got(url, { diff --git a/lib/routes/playno1/router.js b/lib/routes/playno1/router.js index 40e29526be9d4c..7d934c69bef2d8 100644 --- a/lib/routes/playno1/router.js +++ b/lib/routes/playno1/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/av/:catid?', './av'); router.get('/st/:catid?', './st'); }; diff --git a/lib/routes/playno1/st.js b/lib/routes/playno1/st.js index 0b724ed499643b..08b64c5ceb90c5 100644 --- a/lib/routes/playno1/st.js +++ b/lib/routes/playno1/st.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const { cookieJar, processArticle } = require('./utils'); const baseUrl = 'http://stno1.playno1.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { catid = 'all' } = ctx.req.param(); const url = `${baseUrl}/stno1/${catid}/`; const response = await got(url, { diff --git a/lib/routes/playpcesor/router.js b/lib/routes/playpcesor/router.js index 42ffe3a854b3a5..09c585b57315bb 100644 --- a/lib/routes/playpcesor/router.js +++ b/lib/routes/playpcesor/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './rss'); }; diff --git a/lib/routes/playpcesor/rss.js b/lib/routes/playpcesor/rss.js index d6a7e1de203934..2b90bced9dc8cb 100644 --- a/lib/routes/playpcesor/rss.js +++ b/lib/routes/playpcesor/rss.js @@ -2,7 +2,7 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.playpcesor.com/'; const response = await got({ method: 'get', url }); const $ = load(response.data); diff --git a/lib/routes/plurk/anonymous.js b/lib/routes/plurk/anonymous.js index 6c1cd3fe54c57d..33499e8cec43fe 100644 --- a/lib/routes/plurk/anonymous.js +++ b/lib/routes/plurk/anonymous.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { baseUrl, getPlurk } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { data: apiResponse } = await got(`${baseUrl}/Stats/getAnonymousPlurks`, { searchParams: { offset: 0, diff --git a/lib/routes/plurk/hotlinks.js b/lib/routes/plurk/hotlinks.js index 0220921cb9c3e8..cc256338b28932 100644 --- a/lib/routes/plurk/hotlinks.js +++ b/lib/routes/plurk/hotlinks.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { baseUrl, getPlurk } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { data: apiResponse } = await got(`${baseUrl}/hotlinks/getLinks`, { searchParams: { offset: 0, diff --git a/lib/routes/plurk/news.js b/lib/routes/plurk/news.js index 134711b76e8323..06471a60835512 100644 --- a/lib/routes/plurk/news.js +++ b/lib/routes/plurk/news.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { baseUrl, fetchFriends, getPlurk } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { lang = 'en' } = ctx.req.param(); const { data: apiResponse } = await got(`${baseUrl}/PlurkTop/fetchOfficialPlurks`, { searchParams: { diff --git a/lib/routes/plurk/router.js b/lib/routes/plurk/router.js index aa2fa3ab9c4cbd..36278fc14aef43 100644 --- a/lib/routes/plurk/router.js +++ b/lib/routes/plurk/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/anonymous', './anonymous'); router.get('/hotlinks', './hotlinks'); router.get('/news/:lang?', './news'); diff --git a/lib/routes/plurk/search.js b/lib/routes/plurk/search.js index f2052ad7ccec4e..29e7d026b30d90 100644 --- a/lib/routes/plurk/search.js +++ b/lib/routes/plurk/search.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const dayjs = require('dayjs'); const { baseUrl, getPlurk } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const { data: apiResponse } = await got.post(`${baseUrl}/Search/search2`, { searchParams: { diff --git a/lib/routes/plurk/top.js b/lib/routes/plurk/top.js index 6467630d46216b..586013ed0d10bd 100644 --- a/lib/routes/plurk/top.js +++ b/lib/routes/plurk/top.js @@ -4,7 +4,7 @@ const { baseUrl, getPlurk } = require('./utils'); const categoryList = new Set(['topReplurks', 'topFavorites', 'topResponded']); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'topReplurks', lang = 'en' } = ctx.req.param(); if (!categoryList.has(category)) { throw new Error(`Invalid category: ${category}`); diff --git a/lib/routes/plurk/topic.js b/lib/routes/plurk/topic.js index 555f3ac60233d6..6cd0a5a6a31d86 100644 --- a/lib/routes/plurk/topic.js +++ b/lib/routes/plurk/topic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl, fetchFriends, getPlurk } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const topic = ctx.req.param('topic'); const { data: pageResponse } = await got(`${baseUrl}/topic/${topic}`); const { data: apiResponse } = await got(`${baseUrl}/topic/getPlurks`, { diff --git a/lib/routes/plurk/user.js b/lib/routes/plurk/user.js index 0b12f166942716..84e35c94b7d0c8 100644 --- a/lib/routes/plurk/user.js +++ b/lib/routes/plurk/user.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl, fetchFriends, getPlurk } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const { data: pageResponse } = await got(`${baseUrl}/${user}`); diff --git a/lib/routes/pnas/index.js b/lib/routes/pnas/index.js index 68cb201c9ab1ba..23efc96e0a855f 100644 --- a/lib/routes/pnas/index.js +++ b/lib/routes/pnas/index.js @@ -9,7 +9,7 @@ const { CookieJar } = require('tough-cookie'); import logger from '@/utils/logger'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.pnas.org'; const topicPath = ctx.req.param('topicPath'); const link = `${baseUrl}/${topicPath ?? 'latest'}`; diff --git a/lib/routes/pnas/router.js b/lib/routes/pnas/router.js index a46c1a01903486..83ffd0cdd05aaa 100644 --- a/lib/routes/pnas/router.js +++ b/lib/routes/pnas/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:topicPath*', './index'); }; diff --git a/lib/routes/pornhub/category-url.js b/lib/routes/pornhub/category-url.js index 42cad5bbe2ea4e..d91730e8b75cbf 100644 --- a/lib/routes/pornhub/category-url.js +++ b/lib/routes/pornhub/category-url.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { isValidHost } from '@/utils/valid-host'; const { headers, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { language = 'www', url = 'video' } = ctx.req.param(); const link = `https://${language}.pornhub.com/${url}`; if (!isValidHost(language)) { diff --git a/lib/routes/pornhub/category.js b/lib/routes/pornhub/category.js index ba90f95b3d592f..1635d1d4fd6536 100644 --- a/lib/routes/pornhub/category.js +++ b/lib/routes/pornhub/category.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const { defaultDomain, renderDescription } = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('caty'); const categories = await cache.tryGet('pornhub:categories', async () => { diff --git a/lib/routes/pornhub/model.js b/lib/routes/pornhub/model.js index d716db740305e0..7a0a5d655cf9a7 100644 --- a/lib/routes/pornhub/model.js +++ b/lib/routes/pornhub/model.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { isValidHost } from '@/utils/valid-host'; const { headers, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { language = 'www', username, sort = '' } = ctx.req.param(); const link = `https://${language}.pornhub.com/model/${username}/videos${sort ? `?o=${sort}` : ''}`; if (!isValidHost(language)) { diff --git a/lib/routes/pornhub/pornstar.js b/lib/routes/pornhub/pornstar.js index 4dd9a40b4715f9..5cadad72bf3230 100644 --- a/lib/routes/pornhub/pornstar.js +++ b/lib/routes/pornhub/pornstar.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { isValidHost } from '@/utils/valid-host'; const { headers, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { language = 'www', username, sort = 'mr' } = ctx.req.param(); const link = `https://${language}.pornhub.com/pornstar/${username}/videos?o=${sort}`; if (!isValidHost(language)) { diff --git a/lib/routes/pornhub/router.js b/lib/routes/pornhub/router.js index c9483cca7fdf55..05bf2e74ed7871 100644 --- a/lib/routes/pornhub/router.js +++ b/lib/routes/pornhub/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/category/:caty', './category'); router.get('/search/:keyword', './search'); router.get('/:language?/category_url/:url?', './category-url'); diff --git a/lib/routes/pornhub/search.js b/lib/routes/pornhub/search.js index d285fe97dcc40d..b421d6a66627b0 100644 --- a/lib/routes/pornhub/search.js +++ b/lib/routes/pornhub/search.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { defaultDomain, renderDescription } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const currentUrl = `${defaultDomain}/webmasters/search?search=${keyword}`; const response = await got(currentUrl); diff --git a/lib/routes/pornhub/users.js b/lib/routes/pornhub/users.js index f7b23518ae770b..44e01072e617d5 100644 --- a/lib/routes/pornhub/users.js +++ b/lib/routes/pornhub/users.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { isValidHost } from '@/utils/valid-host'; const { headers, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { language = 'www', username } = ctx.req.param(); const link = `https://${language}.pornhub.com/users/${username}/videos`; if (!isValidHost(language)) { diff --git a/lib/routes/postman/release-notes.js b/lib/routes/postman/release-notes.js index 2f074462565f07..578543abed31c0 100644 --- a/lib/routes/postman/release-notes.js +++ b/lib/routes/postman/release-notes.js @@ -3,7 +3,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.postman.com'; const apiUrl = `${rootUrl}/mkapi/release.json`; const currentUrl = `${rootUrl}/downloads/release-notes`; diff --git a/lib/routes/postman/router.js b/lib/routes/postman/router.js index f1a4bcc1f36032..26822698d12825 100644 --- a/lib/routes/postman/router.js +++ b/lib/routes/postman/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/release-notes', './release-notes'); }; diff --git a/lib/routes/priconne-redive/news.js b/lib/routes/priconne-redive/news.js index c35fd6bbdc6da6..b24e24487d7504 100644 --- a/lib/routes/priconne-redive/news.js +++ b/lib/routes/priconne-redive/news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import cache from '@/utils/cache'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const parseContent = (htmlString) => { const $ = load(htmlString); diff --git a/lib/routes/priconne-redive/router.js b/lib/routes/priconne-redive/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/priconne-redive/router.js +++ b/lib/routes/priconne-redive/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/producthunt/router.js b/lib/routes/producthunt/router.js index 45858b034fbcdd..c582a661cd6d4b 100644 --- a/lib/routes/producthunt/router.js +++ b/lib/routes/producthunt/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/today', './today'); }; diff --git a/lib/routes/producthunt/today.js b/lib/routes/producthunt/today.js index 92a5907aa24981..bf21e53d195658 100644 --- a/lib/routes/producthunt/today.js +++ b/lib/routes/producthunt/today.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://www.producthunt.com/'); const data = JSON.parse(load(response.data)('#__NEXT_DATA__').html()); diff --git a/lib/routes/ps/monthly-games.js b/lib/routes/ps/monthly-games.js index 5c83a1351c97a9..51bc1a0eeb1c60 100644 --- a/lib/routes/ps/monthly-games.js +++ b/lib/routes/ps/monthly-games.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import * as path from 'node:path'; import { art } from '@/utils/render'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.playstation.com/en-sg/ps-plus/whats-new/'; const { data: response } = await got(baseUrl); diff --git a/lib/routes/ps/router.js b/lib/routes/ps/router.js index 36bc34aeee9483..4651511fa8157b 100644 --- a/lib/routes/ps/router.js +++ b/lib/routes/ps/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/monthly-games', './monthly-games'); router.get('/trophy/:id', './trophy'); }; diff --git a/lib/routes/ps/trophy.js b/lib/routes/ps/trophy.js index 28df49fc4ef508..c25f1f6181ae17 100644 --- a/lib/routes/ps/trophy.js +++ b/lib/routes/ps/trophy.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got({ diff --git a/lib/routes/pts/curations.js b/lib/routes/pts/curations.js index 4e6adc974f1756..02fe3d4510b434 100644 --- a/lib/routes/pts/curations.js +++ b/lib/routes/pts/curations.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://news.pts.org.tw'; const currentUrl = `${rootUrl}/curations`; diff --git a/lib/routes/pts/index.js b/lib/routes/pts/index.js index bec17231987423..9123f3b82e400f 100644 --- a/lib/routes/pts/index.js +++ b/lib/routes/pts/index.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://news.pts.org.tw'; const currentUrl = `${rootUrl}${getSubPath(ctx) === '/' ? '/dailynews' : getSubPath(ctx)}`; diff --git a/lib/routes/pts/live.js b/lib/routes/pts/live.js index 2bfe62b841a7c1..dde7b7080d77d3 100644 --- a/lib/routes/pts/live.js +++ b/lib/routes/pts/live.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://news.pts.org.tw'; diff --git a/lib/routes/pts/projects.js b/lib/routes/pts/projects.js index 9fb4fd1f2a791c..206c6b9e14d74f 100644 --- a/lib/routes/pts/projects.js +++ b/lib/routes/pts/projects.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://news.pts.org.tw'; const currentUrl = `${rootUrl}/projects`; diff --git a/lib/routes/pts/router.js b/lib/routes/pts/router.js index 91d18f6af3312e..017040b3001fbb 100644 --- a/lib/routes/pts/router.js +++ b/lib/routes/pts/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/curations', './curations'); router.get('/live/:id', './live'); router.get('/projects', './projects'); diff --git a/lib/routes/pubmed/router.js b/lib/routes/pubmed/router.js index 8ccc49e3d3e745..a78a929cc5bf0c 100644 --- a/lib/routes/pubmed/router.js +++ b/lib/routes/pubmed/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/trending/:filters?', './trending'); }; diff --git a/lib/routes/pubmed/trending.js b/lib/routes/pubmed/trending.js index 2efa02d0a24472..c5bfb1e0442ef5 100644 --- a/lib/routes/pubmed/trending.js +++ b/lib/routes/pubmed/trending.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const filters = ctx.req.param('filters'); const rootUrl = 'https://pubmed.ncbi.nlm.nih.gov'; diff --git a/lib/routes/pumc/mdadmission.js b/lib/routes/pumc/mdadmission.js index 97836256ad8e0d..210061d847078e 100644 --- a/lib/routes/pumc/mdadmission.js +++ b/lib/routes/pumc/mdadmission.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 100; const rootUrl = 'https://mdadmission.pumc.edu.cn'; diff --git a/lib/routes/pumc/router.js b/lib/routes/pumc/router.js index 6bcd2718bfc475..08fa6ceaaa81b4 100644 --- a/lib/routes/pumc/router.js +++ b/lib/routes/pumc/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/mdadmission', './mdadmission'); }; diff --git a/lib/routes/putty/changes.js b/lib/routes/putty/changes.js index d47a97c8b02f81..2613e22805325c 100644 --- a/lib/routes/putty/changes.js +++ b/lib/routes/putty/changes.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.chiark.greenend.org.uk'; const currentUrl = `${rootUrl}/~sgtatham/putty/changes.html`; diff --git a/lib/routes/putty/router.js b/lib/routes/putty/router.js index 80cffe3b1c56c0..3a46a992721c5c 100644 --- a/lib/routes/putty/router.js +++ b/lib/routes/putty/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/changes', './changes'); }; diff --git a/lib/routes/pwc/router.js b/lib/routes/pwc/router.js index 3900e395c1189f..bf657de1539a0a 100644 --- a/lib/routes/pwc/router.js +++ b/lib/routes/pwc/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/strategyand/sustainability', './sustainability'); }; diff --git a/lib/routes/pwc/sustainability.js b/lib/routes/pwc/sustainability.js index 65698aa1f5942e..b32fb1f118af49 100644 --- a/lib/routes/pwc/sustainability.js +++ b/lib/routes/pwc/sustainability.js @@ -3,7 +3,7 @@ import logger from '@/utils/logger'; import { parseDate } from '@/utils/parse-date'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.strategyand.pwc.com/at/en/functions/sustainability-strategy/publications.html'; const feedLang = 'en'; const feedDescription = 'Sustainability Publications from PwC Strategy&'; diff --git a/lib/routes/qbitai/category.js b/lib/routes/qbitai/category.js index 64aa39773a42cd..9a6bffbbbda10b 100644 --- a/lib/routes/qbitai/category.js +++ b/lib/routes/qbitai/category.js @@ -2,7 +2,7 @@ import parser from '@/utils/rss-parser'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const link = encodeURI(`https://www.qbitai.com/category/${category}/feed`); const feed = await parser.parseURL(link); diff --git a/lib/routes/qbitai/router.js b/lib/routes/qbitai/router.js index 7a4ffd72fe68e6..164278fb4850f5 100644 --- a/lib/routes/qbitai/router.js +++ b/lib/routes/qbitai/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/category/:category', './category'); router.get('/tag/:tag', './tag'); }; diff --git a/lib/routes/qbitai/tag.js b/lib/routes/qbitai/tag.js index 0b0f7a85dcb849..cd8b4742bba6f5 100644 --- a/lib/routes/qbitai/tag.js +++ b/lib/routes/qbitai/tag.js @@ -2,7 +2,7 @@ import parser from '@/utils/rss-parser'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const link = encodeURI(`https://www.qbitai.com/tag/${tag}/feed`); const feed = await parser.parseURL(link); diff --git a/lib/routes/qbittorrent/news.js b/lib/routes/qbittorrent/news.js index 26ff0170f48501..154405601d9078 100644 --- a/lib/routes/qbittorrent/news.js +++ b/lib/routes/qbittorrent/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.qbittorrent.org'; const response = await cache.tryGet( diff --git a/lib/routes/qbittorrent/router.js b/lib/routes/qbittorrent/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/qbittorrent/router.js +++ b/lib/routes/qbittorrent/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/qdu/houqin.js b/lib/routes/qdu/houqin.js index 70a487131b659f..d4cfa6792a1712 100644 --- a/lib/routes/qdu/houqin.js +++ b/lib/routes/qdu/houqin.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const base = 'https://houqin.qdu.edu.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: `${base}index/tzgg.htm`, diff --git a/lib/routes/qdu/jwc.js b/lib/routes/qdu/jwc.js index 3b0fa14bf399aa..b6bd78b6d5872e 100644 --- a/lib/routes/qdu/jwc.js +++ b/lib/routes/qdu/jwc.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const base = 'https://jwc.qdu.edu.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: `${base}jwtz.htm`, diff --git a/lib/routes/qdu/router.js b/lib/routes/qdu/router.js index c673847cb206b0..926e6fa0bbe695 100644 --- a/lib/routes/qdu/router.js +++ b/lib/routes/qdu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/houqin', './houqin'); router.get('/jwc', './jwc'); }; diff --git a/lib/routes/qianp/news.js b/lib/routes/qianp/news.js index 0dc2227bfff220..1a49816ea4707d 100644 --- a/lib/routes/qianp/news.js +++ b/lib/routes/qianp/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { getTokenAndSecret } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://qianp.com'; const { path = 'news/recommend' } = ctx.req.param(); const url = `${baseUrl}/${path}/`; diff --git a/lib/routes/qianp/router.js b/lib/routes/qianp/router.js index 9174b8479d8ce5..0b591ce95a2875 100644 --- a/lib/routes/qianp/router.js +++ b/lib/routes/qianp/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:path*', './news'); }; diff --git a/lib/routes/qianzhan/column.js b/lib/routes/qianzhan/column.js index 34accb7f9eccc0..30c5f8e382632a 100644 --- a/lib/routes/qianzhan/column.js +++ b/lib/routes/qianzhan/column.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { let rootUrl = 'https://www.qianzhan.com/analyst/'; const titles = { all: '最新文章', diff --git a/lib/routes/qianzhan/rank.js b/lib/routes/qianzhan/rank.js index 37b75fabdac505..a1018f4d491dda 100644 --- a/lib/routes/qianzhan/rank.js +++ b/lib/routes/qianzhan/rank.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') === 'week' ? 1 : 2; const rootUrl = 'https://www.qianzhan.com/analyst/'; diff --git a/lib/routes/qianzhan/router.js b/lib/routes/qianzhan/router.js index f3ee20f775fc97..cd36a2a6ea61ba 100644 --- a/lib/routes/qianzhan/router.js +++ b/lib/routes/qianzhan/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/analyst/column/:type?', './column'); router.get('/analyst/rank/:type?', './rank'); }; diff --git a/lib/routes/qidian/author.js b/lib/routes/qidian/author.js index f15d5d333bbc5c..98476f1f9ae479 100644 --- a/lib/routes/qidian/author.js +++ b/lib/routes/qidian/author.js @@ -5,7 +5,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://my.qidian.com'; const currentUrl = `${rootUrl}/author/${id}/`; diff --git a/lib/routes/qidian/chapter.js b/lib/routes/qidian/chapter.js index 02ebe0efe3e1f7..867f3c88264e64 100644 --- a/lib/routes/qidian/chapter.js +++ b/lib/routes/qidian/chapter.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got(`https://m.qidian.com/book/${id}.html`); diff --git a/lib/routes/qidian/forum.js b/lib/routes/qidian/forum.js index e6662c6a1a5ffe..685b433ed36f3e 100644 --- a/lib/routes/qidian/forum.js +++ b/lib/routes/qidian/forum.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const url = `https://forum.qidian.com/NewForum/List.aspx?BookId=${id}`; diff --git a/lib/routes/qidian/free-next.js b/lib/routes/qidian/free-next.js index 5b4c9660cf352b..2f4daaf10d5ebb 100644 --- a/lib/routes/qidian/free-next.js +++ b/lib/routes/qidian/free-next.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let link, title; diff --git a/lib/routes/qidian/free.js b/lib/routes/qidian/free.js index 2e93a8c1e8cb5c..34b00bf6d934f8 100644 --- a/lib/routes/qidian/free.js +++ b/lib/routes/qidian/free.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let link, title; diff --git a/lib/routes/qidian/router.js b/lib/routes/qidian/router.js index fd9ba1d404c302..09687ce210e3fa 100644 --- a/lib/routes/qidian/router.js +++ b/lib/routes/qidian/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/author/:id', './author'); router.get('/chapter/:id', './chapter'); router.get('/forum/:id', './forum'); diff --git a/lib/routes/qingting/channel.js b/lib/routes/qingting/channel.js index d35843a4e91be5..c47412e673e325 100644 --- a/lib/routes/qingting/channel.js +++ b/lib/routes/qingting/channel.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const channelUrl = `https://i.qingting.fm/capi/v3/channel/${ctx.req.param('id')}`; let response = await got(channelUrl); const title = response.data.data.title; diff --git a/lib/routes/qingting/podcast.js b/lib/routes/qingting/podcast.js index 1939e9dae43101..8d88c1560bb54d 100644 --- a/lib/routes/qingting/podcast.js +++ b/lib/routes/qingting/podcast.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const channelUrl = `https://i.qingting.fm/capi/v3/channel/${ctx.req.param('id')}`; let response = await got({ method: 'get', diff --git a/lib/routes/qingting/router.js b/lib/routes/qingting/router.js index 897058c8c3ac2d..f1f70e0e630fd2 100644 --- a/lib/routes/qingting/router.js +++ b/lib/routes/qingting/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/channel/:id', './channel'); router.get('/podcast/:id', './podcast'); }; diff --git a/lib/routes/qipamaijia/index.js b/lib/routes/qipamaijia/index.js index 23787e85c649e7..d5ed7f4ebeedda 100644 --- a/lib/routes/qipamaijia/index.js +++ b/lib/routes/qipamaijia/index.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const rootUrl = 'https://www.qipamaijia.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const cate = ctx.req.param('cate') ?? ''; const url = `${rootUrl}/${cate}`; diff --git a/lib/routes/qipamaijia/router.js b/lib/routes/qipamaijia/router.js index cf03ea449014b9..8d10a6f3bbe896 100644 --- a/lib/routes/qipamaijia/router.js +++ b/lib/routes/qipamaijia/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:cate?', './index'); }; diff --git a/lib/routes/qiyoujiage/price.js b/lib/routes/qiyoujiage/price.js index d486d2c17b3ed2..ed714aa8fbf012 100644 --- a/lib/routes/qiyoujiage/price.js +++ b/lib/routes/qiyoujiage/price.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import md5 from '@/utils/md5'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = ctx.req.param('path'); const link = `http://www.qiyoujiage.com/${path}.shtml`; diff --git a/lib/routes/qiyoujiage/router.js b/lib/routes/qiyoujiage/router.js index 8e1bc0f39a2a89..dc4c588f1756cb 100644 --- a/lib/routes/qiyoujiage/router.js +++ b/lib/routes/qiyoujiage/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:path+', './price'); }; diff --git a/lib/routes/qlu/notice.js b/lib/routes/qlu/notice.js index d40d26fbe543b2..6d64549cf066ee 100644 --- a/lib/routes/qlu/notice.js +++ b/lib/routes/qlu/notice.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'https://www.qlu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: `${host}/tzggsh/list1.htm`, diff --git a/lib/routes/qlu/router.js b/lib/routes/qlu/router.js index f23ddaad77c382..542a85d08ce2fc 100644 --- a/lib/routes/qlu/router.js +++ b/lib/routes/qlu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/notice', './notice'); }; diff --git a/lib/routes/qm120/news.js b/lib/routes/qm120/news.js index 6b425931efa613..2645a18ce42a60 100644 --- a/lib/routes/qm120/news.js +++ b/lib/routes/qm120/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'jdxw'; const rootUrl = 'http://www.qm120.com'; diff --git a/lib/routes/qm120/router.js b/lib/routes/qm120/router.js index 07a7a2990cfb44..ec7c5eda5bf4b4 100644 --- a/lib/routes/qm120/router.js +++ b/lib/routes/qm120/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:category?', './news'); }; diff --git a/lib/routes/qoo-app/apps/card.js b/lib/routes/qoo-app/apps/card.js index f4c79be13fc075..f3e32c73c7d396 100644 --- a/lib/routes/qoo-app/apps/card.js +++ b/lib/routes/qoo-app/apps/card.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { appsUrl } = require('../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, lang = '' } = ctx.req.param(); const link = `${appsUrl}${lang ? `/${lang}` : ''}/app-card/${id}`; diff --git a/lib/routes/qoo-app/apps/comment.js b/lib/routes/qoo-app/apps/comment.js index 30dcc8b250f2db..050980f8275e0a 100644 --- a/lib/routes/qoo-app/apps/comment.js +++ b/lib/routes/qoo-app/apps/comment.js @@ -6,7 +6,7 @@ const { appsUrl } = require('../utils'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id, lang = '' } = ctx.req.param(); const link = `${appsUrl}${lang ? `/${lang}` : ''}/app-comment/${id}`; diff --git a/lib/routes/qoo-app/apps/note.js b/lib/routes/qoo-app/apps/note.js index c93f0e33b56863..14797cace7106a 100644 --- a/lib/routes/qoo-app/apps/note.js +++ b/lib/routes/qoo-app/apps/note.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { appsUrl } = require('../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, lang = '' } = ctx.req.param(); const link = `${appsUrl}${lang ? `/${lang}` : ''}/app-note/${id}`; diff --git a/lib/routes/qoo-app/apps/post.js b/lib/routes/qoo-app/apps/post.js index 6727a021c11f77..e863215c196b43 100644 --- a/lib/routes/qoo-app/apps/post.js +++ b/lib/routes/qoo-app/apps/post.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { appsUrl, newsUrl, fixImg } = require('../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, lang = '' } = ctx.req.param(); const link = `${appsUrl}${lang ? `/${lang}` : ''}/app-post/${id}`; diff --git a/lib/routes/qoo-app/news.js b/lib/routes/qoo-app/news.js index e67500d695b7fd..3d5265dde39032 100644 --- a/lib/routes/qoo-app/news.js +++ b/lib/routes/qoo-app/news.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const { newsUrl, siteIcon, fixImg } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { lang = '' } = ctx.req.param(); const apiUrl = `${newsUrl}${lang ? `/${lang}` : ''}/wp-json/wp/v2/posts`; diff --git a/lib/routes/qoo-app/notes/note.js b/lib/routes/qoo-app/notes/note.js index 3c1f323eaedec5..d0d92f1c1e3820 100644 --- a/lib/routes/qoo-app/notes/note.js +++ b/lib/routes/qoo-app/notes/note.js @@ -5,7 +5,7 @@ const { ssoUrl, notesUrl } = require('../utils'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const api = `${ssoUrl}/api/v1/comments`; const link = `${notesUrl}/note/${id}`; diff --git a/lib/routes/qoo-app/notes/topic.js b/lib/routes/qoo-app/notes/topic.js index f7bd183d63879f..919335c80dcf4c 100644 --- a/lib/routes/qoo-app/notes/topic.js +++ b/lib/routes/qoo-app/notes/topic.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { notesUrl, extractNotes } = require('../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { topic, lang } = ctx.req.param(); const link = `${notesUrl}${lang ? `/${lang}` : ''}/topic/${topic}`; diff --git a/lib/routes/qoo-app/notes/user.js b/lib/routes/qoo-app/notes/user.js index a64a3b10249c5d..2df80216230ed3 100644 --- a/lib/routes/qoo-app/notes/user.js +++ b/lib/routes/qoo-app/notes/user.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { notesUrl, extractNotes } = require('../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { uid, lang } = ctx.req.param(); const link = `${notesUrl}${lang ? `/${lang}` : ''}/user/${uid}`; diff --git a/lib/routes/qoo-app/router.js b/lib/routes/qoo-app/router.js index dd4e0b33c32ad0..fc39d0e260105d 100644 --- a/lib/routes/qoo-app/router.js +++ b/lib/routes/qoo-app/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/apps/:lang?/card/:id', './apps/card'); router.get('/apps/:lang?/comment/:id', './apps/comment'); router.get('/apps/:lang?/note/:id', './apps/note'); diff --git a/lib/routes/qoo-app/user/app-comment.js b/lib/routes/qoo-app/user/app-comment.js index e169f496bf1758..d54f069dec9053 100644 --- a/lib/routes/qoo-app/user/app-comment.js +++ b/lib/routes/qoo-app/user/app-comment.js @@ -6,7 +6,7 @@ const { userUrl, appsUrl } = require('../utils'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { uid, lang = '' } = ctx.req.param(); const link = `${userUrl}${lang ? `/${lang}` : ''}/${uid}`; diff --git a/lib/routes/qq/ac/comic.js b/lib/routes/qq/ac/comic.js index 12dc5233e0bff9..313cae3db04463 100644 --- a/lib/routes/qq/ac/comic.js +++ b/lib/routes/qq/ac/comic.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const { rootUrl, mobileRootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const currentUrl = `${rootUrl}/Comic/comicInfo/id/${id}`; diff --git a/lib/routes/qq/ac/rank.js b/lib/routes/qq/ac/rank.js index b1bfb61ffead5a..473d1e16943ef9 100644 --- a/lib/routes/qq/ac/rank.js +++ b/lib/routes/qq/ac/rank.js @@ -1,6 +1,6 @@ const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const titles = { mt: '月票榜', rise: '飙升榜', diff --git a/lib/routes/qq/fact/index.js b/lib/routes/qq/fact/index.js index d33189cbdf6b12..50d69a6db7fca3 100644 --- a/lib/routes/qq/fact/index.js +++ b/lib/routes/qq/fact/index.js @@ -14,7 +14,7 @@ const getRequestToken = () => { const baseUrl = 'https://vp.fact.qq.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got(`${baseUrl}/api/article/list`, { headers: { Referer: `${baseUrl}/home`, diff --git a/lib/routes/qq/kg/reply.js b/lib/routes/qq/kg/reply.js index 78909cb301ec0a..527c6ad1d3457d 100644 --- a/lib/routes/qq/kg/reply.js +++ b/lib/routes/qq/kg/reply.js @@ -1,7 +1,7 @@ const cache = require('./cache'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const playId = ctx.req.param('playId'); const url = `https://node.kg.qq.com/play?s=${playId}`; const play_item = await cache.getPlayInfo(ctx, playId, ''); diff --git a/lib/routes/qq/kg/user.js b/lib/routes/qq/kg/user.js index caac932c31514a..fd303a0c7f533a 100644 --- a/lib/routes/qq/kg/user.js +++ b/lib/routes/qq/kg/user.js @@ -3,7 +3,7 @@ const { JSDOM } = require('jsdom'); const cache = require('./cache'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const userId = ctx.req.param('userId'); const url = `https://node.kg.qq.com/personal?uid=${userId}`; const response = await got(url); diff --git a/lib/routes/qq/router.js b/lib/routes/qq/router.js index 483f337f8b6693..18aa5a6236c557 100644 --- a/lib/routes/qq/router.js +++ b/lib/routes/qq/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/ac/comic/:id?', './ac/comic'); router.get('/ac/rank/:type?/:time?', './ac/rank'); router.get('/fact', './fact'); diff --git a/lib/routes/qq88/index.js b/lib/routes/qq88/index.js index cac2ff0f1215aa..1d8a9de9e37e13 100644 --- a/lib/routes/qq88/index.js +++ b/lib/routes/qq88/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://qq88.info'; diff --git a/lib/routes/qq88/router.js b/lib/routes/qq88/router.js index b610024188e52a..74ed533fca356e 100644 --- a/lib/routes/qq88/router.js +++ b/lib/routes/qq88/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './'); }; diff --git a/lib/routes/qqorw/index.js b/lib/routes/qqorw/index.js index 12bc6bdb3ee37d..fd0b6de8deff61 100644 --- a/lib/routes/qqorw/index.js +++ b/lib/routes/qqorw/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/qqorw/router.js b/lib/routes/qqorw/router.js index 87213a9062eabd..74ed533fca356e 100644 --- a/lib/routes/qqorw/router.js +++ b/lib/routes/qqorw/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './'); }; diff --git a/lib/routes/questmobile/report.js b/lib/routes/questmobile/report.js index 7e223f1060568a..f93afaf082b261 100644 --- a/lib/routes/questmobile/report.js +++ b/lib/routes/questmobile/report.js @@ -25,7 +25,7 @@ const parseTree = (tree, result = []) => { return result; }; -module.exports = async (ctx) => { +export default async (ctx) => { const { industry, label } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/questmobile/router.js b/lib/routes/questmobile/router.js index dd748664d1a397..7a9858a9336e40 100644 --- a/lib/routes/questmobile/router.js +++ b/lib/routes/questmobile/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/report/:industry?/:label?', './report'); }; diff --git a/lib/routes/quicker/qa.js b/lib/routes/quicker/qa.js index 42d98aa5b7d16d..36d8c1059b79e1 100644 --- a/lib/routes/quicker/qa.js +++ b/lib/routes/quicker/qa.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'all'; const state = ctx.req.param('state') ?? ''; diff --git a/lib/routes/quicker/router.js b/lib/routes/quicker/router.js index 60471bea905439..19703281f89af7 100644 --- a/lib/routes/quicker/router.js +++ b/lib/routes/quicker/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/qa/:category?/:state?', './qa'); router.get('/share/:category?', './share'); router.get('/update', './versions'); diff --git a/lib/routes/quicker/share.js b/lib/routes/quicker/share.js index a05d68c5d68e27..d845d5f435d203 100644 --- a/lib/routes/quicker/share.js +++ b/lib/routes/quicker/share.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'Recent'; const rootUrl = 'https://getquicker.net'; diff --git a/lib/routes/quicker/user.js b/lib/routes/quicker/user.js index 8c11b31c9d2781..7ca03a24c418b8 100644 --- a/lib/routes/quicker/user.js +++ b/lib/routes/quicker/user.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const id = ctx.req.param('id'); diff --git a/lib/routes/quicker/versions.js b/lib/routes/quicker/versions.js index 1f4e4533d64c24..05192b02498d62 100644 --- a/lib/routes/quicker/versions.js +++ b/lib/routes/quicker/versions.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://getquicker.net'; const currentUrl = `${rootUrl}/Help/Versions`; diff --git a/lib/routes/qweather/3days.js b/lib/routes/qweather/3days.js index 37b4349f5f9533..855416e9f2b49c 100644 --- a/lib/routes/qweather/3days.js +++ b/lib/routes/qweather/3days.js @@ -9,7 +9,7 @@ const AIR_QUALITY_API = 'https://devapi.qweather.com/v7/air/5d'; const CIRY_LOOKUP_API = 'https://geoapi.qweather.com/v2/city/lookup'; const author = 'QWeather'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.hefeng.key) { throw new Error('QWeather RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/qweather/now.js b/lib/routes/qweather/now.js index dfbb471ce9f75f..ee6ce6877713e1 100644 --- a/lib/routes/qweather/now.js +++ b/lib/routes/qweather/now.js @@ -5,7 +5,7 @@ import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; const rootUrl = 'https://devapi.qweather.com/v7/weather/now?'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = await cache.tryGet(ctx.req.param('location') + '_id', async () => { const response = await got(`https://geoapi.qweather.com/v2/city/lookup?location=${ctx.req.param('location')}&key=${config.hefeng.key}`); const data = []; diff --git a/lib/routes/qweather/router.js b/lib/routes/qweather/router.js index d4521621555572..2e05629ac9c513 100644 --- a/lib/routes/qweather/router.js +++ b/lib/routes/qweather/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/3days/:location', './3days'); router.get('/now/:location', './now'); }; diff --git a/lib/routes/radio-canada/latest.js b/lib/routes/radio-canada/latest.js index 4a7bb731f185a9..804319d2a02493 100644 --- a/lib/routes/radio-canada/latest.js +++ b/lib/routes/radio-canada/latest.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? 'en'; const rootUrl = 'https://ici.radio-canada.ca'; diff --git a/lib/routes/radio-canada/router.js b/lib/routes/radio-canada/router.js index 7d2d8b7ea466ca..1c11d39d503f72 100644 --- a/lib/routes/radio-canada/router.js +++ b/lib/routes/radio-canada/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/latest/:language?', './latest'); }; diff --git a/lib/routes/radio/album.js b/lib/routes/radio/album.js index b290e447817f6f..3fc1fec741e6ed 100644 --- a/lib/routes/radio/album.js +++ b/lib/routes/radio/album.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const CryptoJS = require('crypto-js'); -module.exports = async (ctx) => { +export default async (ctx) => { const KEY = 'f0fc4c668392f9f9a447e48584c214ee'; const id = ctx.req.param('id'); diff --git a/lib/routes/radio/index.js b/lib/routes/radio/index.js index 57a27331dfde74..e51bb20a69c844 100644 --- a/lib/routes/radio/index.js +++ b/lib/routes/radio/index.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const size = ctx.req.query('limit') ?? '100'; diff --git a/lib/routes/radio/router.js b/lib/routes/radio/router.js index 4580042e0409a5..d71b6870b9ec84 100644 --- a/lib/routes/radio/router.js +++ b/lib/routes/radio/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/album/:id', './album'); router.get('/zhibo/:id', './zhibo'); router.get('/:id', './index'); diff --git a/lib/routes/radio/zhibo.js b/lib/routes/radio/zhibo.js index b277d59977c51d..8a1996760d4648 100644 --- a/lib/routes/radio/zhibo.js +++ b/lib/routes/radio/zhibo.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const CryptoJS = require('crypto-js'); -module.exports = async (ctx) => { +export default async (ctx) => { const KEY = 'f0fc4c668392f9f9a447e48584c214ee'; const id = ctx.req.param('id'); diff --git a/lib/routes/rarehistoricalphotos/index.js b/lib/routes/rarehistoricalphotos/index.js index 7587a37e954777..64b0319be9078d 100644 --- a/lib/routes/rarehistoricalphotos/index.js +++ b/lib/routes/rarehistoricalphotos/index.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://rarehistoricalphotos.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got(`${baseUrl}/wp-json/wp/v2/posts`, { searchParams: { per_page: ctx.req.query('limit') ? Number(ctx.req.query('limit')) : undefined, diff --git a/lib/routes/rarehistoricalphotos/router.js b/lib/routes/rarehistoricalphotos/router.js index d7756988faf502..b84c130aa1d81f 100644 --- a/lib/routes/rarehistoricalphotos/router.js +++ b/lib/routes/rarehistoricalphotos/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/rattibha/router.js b/lib/routes/rattibha/router.js index cca99a3720b444..db66760a376631 100644 --- a/lib/routes/rattibha/router.js +++ b/lib/routes/rattibha/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/user/:user', './user'); }; diff --git a/lib/routes/rattibha/user.js b/lib/routes/rattibha/user.js index 631bc5b68bc1b6..9d3f900c80cb63 100644 --- a/lib/routes/rattibha/user.js +++ b/lib/routes/rattibha/user.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://rattibha.com'; const { user: twitterUser } = ctx.req.param(); diff --git a/lib/routes/rawkuma/manga.js b/lib/routes/rawkuma/manga.js index 53690f69e0f9f9..aefd7e0a2e7c64 100644 --- a/lib/routes/rawkuma/manga.js +++ b/lib/routes/rawkuma/manga.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/rawkuma/router.js b/lib/routes/rawkuma/router.js index 74f53423e37f8f..747da842cdaad0 100644 --- a/lib/routes/rawkuma/router.js +++ b/lib/routes/rawkuma/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/manga/:id', './manga'); }; diff --git a/lib/routes/reactnewsletter/reactnewsletter.js b/lib/routes/reactnewsletter/reactnewsletter.js index 2433949851da13..6b687169a4e9c8 100644 --- a/lib/routes/reactnewsletter/reactnewsletter.js +++ b/lib/routes/reactnewsletter/reactnewsletter.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const currentURL = 'https://reactnewsletter.com/issues'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const resp = await got(currentURL); const $ = load(resp.data); const text = $('script#__NEXT_DATA__').text(); diff --git a/lib/routes/reactnewsletter/router.js b/lib/routes/reactnewsletter/router.js index 3415305915c65f..6aefc032e61ed0 100644 --- a/lib/routes/reactnewsletter/router.js +++ b/lib/routes/reactnewsletter/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './reactnewsletter'); }; diff --git a/lib/routes/readhub/daily.js b/lib/routes/readhub/daily.js index 78109abc5c7429..2213dac1e07298 100644 --- a/lib/routes/readhub/daily.js +++ b/lib/routes/readhub/daily.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const { rootUrl, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 11; const currentUrl = new URL('daily', rootUrl).href; diff --git a/lib/routes/readhub/index.js b/lib/routes/readhub/index.js index b458c2fa38d007..8204b6f6641cab 100644 --- a/lib/routes/readhub/index.js +++ b/lib/routes/readhub/index.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; const { rootUrl, apiTopicUrl, art, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/readhub/router.js b/lib/routes/readhub/router.js index c3c097f6644ce1..b1b3fc27704520 100644 --- a/lib/routes/readhub/router.js +++ b/lib/routes/readhub/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/daily', './daily'); router.get('/:category?', './'); }; diff --git a/lib/routes/remnote/changelog.js b/lib/routes/remnote/changelog.js index 7090ca52907f3a..8b52d6ff2dbf12 100644 --- a/lib/routes/remnote/changelog.js +++ b/lib/routes/remnote/changelog.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const FQDN = 'feedback.remnote.com'; const apiGateway = 'https://gateway.hellonext.co'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got(`${apiGateway}/api/v2/changelogs`, { headers: { 'x-organization': FQDN, diff --git a/lib/routes/remnote/router.js b/lib/routes/remnote/router.js index fcebef04ec99b3..697b95cbdea2b4 100644 --- a/lib/routes/remnote/router.js +++ b/lib/routes/remnote/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/changelog', './changelog'); }; diff --git a/lib/routes/researchgate/publications.js b/lib/routes/researchgate/publications.js index 4205204848dd4b..aa9e0d6c0c315b 100644 --- a/lib/routes/researchgate/publications.js +++ b/lib/routes/researchgate/publications.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://www.researchgate.net'; diff --git a/lib/routes/researchgate/router.js b/lib/routes/researchgate/router.js index 6d88b77e824cfc..e591369ddc7f8d 100644 --- a/lib/routes/researchgate/router.js +++ b/lib/routes/researchgate/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/publications/:id', './publications'); }; diff --git a/lib/routes/reuters/common.js b/lib/routes/reuters/common.js index 2efa76ca1aa0cd..a9039829ff88ae 100644 --- a/lib/routes/reuters/common.js +++ b/lib/routes/reuters/common.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const MUST_FETCH_BY_TOPICS = new Set(['authors']); const CAN_USE_SOPHI = ['world']; diff --git a/lib/routes/reuters/investigates.js b/lib/routes/reuters/investigates.js index 344a191dc50384..a4bdfe3bfec8ba 100644 --- a/lib/routes/reuters/investigates.js +++ b/lib/routes/reuters/investigates.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.reuters.com'; const currentUrl = `${rootUrl}/investigates/`; const response = await got(currentUrl); diff --git a/lib/routes/reuters/router.js b/lib/routes/reuters/router.js index f1d3e64aa13499..c8354005793049 100644 --- a/lib/routes/reuters/router.js +++ b/lib/routes/reuters/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/investigates', './investigates'); router.get('/:category/:topic?', './common'); }; diff --git a/lib/routes/rfa/index.js b/lib/routes/rfa/index.js index 0c1d559590e638..e68be85e4ab3a2 100644 --- a/lib/routes/rfa/index.js +++ b/lib/routes/rfa/index.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { let url = 'https://www.rfa.org/' + (ctx.req.param('language') ?? 'english'); if (ctx.req.param('channel')) { diff --git a/lib/routes/rfa/router.js b/lib/routes/rfa/router.js index 71b22634c07206..d242b9ffe81da9 100644 --- a/lib/routes/rfa/router.js +++ b/lib/routes/rfa/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:language?/:channel?/:subChannel?', './index'); }; diff --git a/lib/routes/rfi/news.js b/lib/routes/rfi/news.js index 936fcb687b157c..3e1602cde1156c 100644 --- a/lib/routes/rfi/news.js +++ b/lib/routes/rfi/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.rfi.fr/'; const path = ctx.req.param('path') ?? 'en'; const currentUrl = `${rootUrl}${path.endsWith('/') ? path : `${path}/`}`; diff --git a/lib/routes/rfi/router.js b/lib/routes/rfi/router.js index 06e0aa59a61e93..93410ef3779fa3 100644 --- a/lib/routes/rfi/router.js +++ b/lib/routes/rfi/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:path*', './news'); }; diff --git a/lib/routes/right/forum.js b/lib/routes/right/forum.js index 012eae3fa3e92c..760007a32a0ddc 100644 --- a/lib/routes/right/forum.js +++ b/lib/routes/right/forum.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '31'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; diff --git a/lib/routes/right/router.js b/lib/routes/right/router.js index 48862b0f0c5c59..fbe01a2d755e6c 100644 --- a/lib/routes/right/router.js +++ b/lib/routes/right/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/forum/:id?', './forum'); }; diff --git a/lib/routes/rodong/news.js b/lib/routes/rodong/news.js index 5e51baf3eb22c3..5209278538f2ad 100644 --- a/lib/routes/rodong/news.js +++ b/lib/routes/rodong/news.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'http://www.rodong.rep.kp'; -module.exports = async (ctx) => { +export default async (ctx) => { const { language = 'ko' } = ctx.req.param(); const link = `${host}/${language}/index.php?MkBAMkAxQA==`; const { data: response } = await got(link); diff --git a/lib/routes/rodong/router.js b/lib/routes/rodong/router.js index 6e81c22e9f0886..5b0be5e7a721c7 100644 --- a/lib/routes/rodong/router.js +++ b/lib/routes/rodong/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:language?', './news'); }; diff --git a/lib/routes/routledge/book-series.js b/lib/routes/routledge/book-series.js index b7ea372f6014c7..34d116eb180986 100644 --- a/lib/routes/routledge/book-series.js +++ b/lib/routes/routledge/book-series.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { bookName, bookId } = ctx.req.param(); const baseUrl = 'https://www.routledge.com'; const pageUrl = `${baseUrl}/${bookName}/book-series/${bookId}`; diff --git a/lib/routes/routledge/router.js b/lib/routes/routledge/router.js index 45127ce4dc78fb..818aef1c716265 100644 --- a/lib/routes/routledge/router.js +++ b/lib/routes/routledge/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:bookName/book-series/:bookId', './book-series'); }; diff --git a/lib/routes/rsc/journal.js b/lib/routes/rsc/journal.js index ebfef0f14d6e7f..7724b8feb19e5a 100644 --- a/lib/routes/rsc/journal.js +++ b/lib/routes/rsc/journal.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id, category = 'allrecentarticles' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/rsc/router.js b/lib/routes/rsc/router.js index d39d9e296c0c41..87fb6e33d62f30 100644 --- a/lib/routes/rsc/router.js +++ b/lib/routes/rsc/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/journal/:id/:category?', './journal'); }; diff --git a/lib/routes/rsshub/media.js b/lib/routes/rsshub/media.js index 5984b5639fb01b..91db71e6127770 100644 --- a/lib/routes/rsshub/media.js +++ b/lib/routes/rsshub/media.js @@ -3,7 +3,7 @@ import { config } from '@/config'; const { getDomain } = require('tldts'); const { refererMap } = require('./referer-map'); -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.feature.mediaProxyKey) { throw new Error('Internal media proxy is disabled.'); } diff --git a/lib/routes/rsshub/router.js b/lib/routes/rsshub/router.js index ef2d75f909b913..10920163756158 100644 --- a/lib/routes/rsshub/router.js +++ b/lib/routes/rsshub/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/m/:key/:url', './media'); router.get('/routes/:lang?', './routes'); router.get('/transform/html/:url/:routeParams', './transform/html'); diff --git a/lib/routes/rsshub/routes.js b/lib/routes/rsshub/routes.js index 6cff1e5483490e..0b679cf00766e8 100644 --- a/lib/routes/rsshub/routes.js +++ b/lib/routes/rsshub/routes.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const isEnglish = ctx.req.param('lang') !== 'zh'; const lang = isEnglish ? '' : 'zh/'; diff --git a/lib/routes/rsshub/transform/html.js b/lib/routes/rsshub/transform/html.js index 37749e042dd74c..0ee1d89c5ea547 100644 --- a/lib/routes/rsshub/transform/html.js +++ b/lib/routes/rsshub/transform/html.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.feature.allow_user_supply_unsafe_domain) { throw new Error(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`); } diff --git a/lib/routes/rsshub/transform/json.js b/lib/routes/rsshub/transform/json.js index 0b1df80794db73..4d8b82f38fdc16 100644 --- a/lib/routes/rsshub/transform/json.js +++ b/lib/routes/rsshub/transform/json.js @@ -14,7 +14,7 @@ function jsonGet(obj, attr) { return obj; } -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.feature.allow_user_supply_unsafe_domain) { throw new Error(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`); } diff --git a/lib/routes/rsshub/transform/sitemap.js b/lib/routes/rsshub/transform/sitemap.js index 1b8ef5503039cc..482454a33cdc7c 100644 --- a/lib/routes/rsshub/transform/sitemap.js +++ b/lib/routes/rsshub/transform/sitemap.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.feature.allow_user_supply_unsafe_domain) { throw new Error(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`); } diff --git a/lib/routes/ruancan/category.js b/lib/routes/ruancan/category.js index d4143c4720e75b..9d3444e4da5cda 100644 --- a/lib/routes/ruancan/category.js +++ b/lib/routes/ruancan/category.js @@ -1,6 +1,6 @@ const fetchFeed = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const currentUrl = `/cat/${category}`; diff --git a/lib/routes/ruancan/index.js b/lib/routes/ruancan/index.js index 77998f6e3b9297..5afc7dc5db3340 100644 --- a/lib/routes/ruancan/index.js +++ b/lib/routes/ruancan/index.js @@ -1,6 +1,6 @@ const fetchFeed = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = ''; ctx.set('data', await fetchFeed(ctx, currentUrl)); diff --git a/lib/routes/ruancan/router.js b/lib/routes/ruancan/router.js index bc355fc083d8d7..9bb955a1787be8 100644 --- a/lib/routes/ruancan/router.js +++ b/lib/routes/ruancan/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/category/:category?', './category'); router.get('/search/:keyword?', './search'); router.get('/user/:id', './user'); diff --git a/lib/routes/ruancan/search.js b/lib/routes/ruancan/search.js index 87f1ecef7d00a8..87e983cff90980 100644 --- a/lib/routes/ruancan/search.js +++ b/lib/routes/ruancan/search.js @@ -1,6 +1,6 @@ const fetchFeed = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const currentUrl = `/?s=${keyword}`; diff --git a/lib/routes/ruancan/user.js b/lib/routes/ruancan/user.js index 49d8a6c78b731f..8eda3f97173108 100644 --- a/lib/routes/ruancan/user.js +++ b/lib/routes/ruancan/user.js @@ -1,6 +1,6 @@ const fetchFeed = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const currentUrl = `/i/${id}`; diff --git a/lib/routes/ruc/hr.js b/lib/routes/ruc/hr.js index 5d4eefdc40b5cb..fa2a5250c82daa 100644 --- a/lib/routes/ruc/hr.js +++ b/lib/routes/ruc/hr.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category')?.replace(/-/g, '/') ?? 'tzgg'; const rootUrl = 'http://hr.ruc.edu.cn'; diff --git a/lib/routes/ruc/router.js b/lib/routes/ruc/router.js index 2506d401405af0..82d438e8cb4bab 100644 --- a/lib/routes/ruc/router.js +++ b/lib/routes/ruc/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/hr/:category?', './hr'); }; diff --git a/lib/routes/runtrail/posts.js b/lib/routes/runtrail/posts.js index eb558dca1c2e8a..49f2ac85db42c6 100644 --- a/lib/routes/runtrail/posts.js +++ b/lib/routes/runtrail/posts.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://runtrail.cn'; const { data: response } = await got(`${baseUrl}/wp-json/wp/v2/posts`, { searchParams: { diff --git a/lib/routes/runtrail/router.js b/lib/routes/runtrail/router.js index e51016ca9a9535..59494d73ce0dca 100644 --- a/lib/routes/runtrail/router.js +++ b/lib/routes/runtrail/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './posts'); }; diff --git a/lib/routes/rustcc/jobs.js b/lib/routes/rustcc/jobs.js index 607453aa1ee965..b2d99026552ede 100644 --- a/lib/routes/rustcc/jobs.js +++ b/lib/routes/rustcc/jobs.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; const base_url = 'https://rustcc.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const jobs_url = 'https://rustcc.cn/section?id=fed6b7de-0a74-48eb-8988-1978858c9b35'; const response = await got({ diff --git a/lib/routes/rustcc/router.js b/lib/routes/rustcc/router.js index 90090d76d9521d..9c69a9e5096e14 100644 --- a/lib/routes/rustcc/router.js +++ b/lib/routes/rustcc/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/jobs', './jobs'); }; diff --git a/lib/routes/sakurazaka46/blog.js b/lib/routes/sakurazaka46/blog.js index a2713f6da0c8e7..8bc20073b1e9ee 100644 --- a/lib/routes/sakurazaka46/blog.js +++ b/lib/routes/sakurazaka46/blog.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'all'; const page = ctx.req.param('page') ?? '0'; diff --git a/lib/routes/sakurazaka46/news.js b/lib/routes/sakurazaka46/news.js index 7a841e088d25cb..bb737212e6bf50 100644 --- a/lib/routes/sakurazaka46/news.js +++ b/lib/routes/sakurazaka46/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://sakurazaka46.com'; const currentUrl = `${rootUrl}/s/s46/news/list`; diff --git a/lib/routes/sakurazaka46/router.js b/lib/routes/sakurazaka46/router.js index 8dd5b096e2007b..98134845b7e600 100644 --- a/lib/routes/sakurazaka46/router.js +++ b/lib/routes/sakurazaka46/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:id?/:page?', './blog'); router.get('/news', './news'); }; diff --git a/lib/routes/samsung/research/blog.js b/lib/routes/samsung/research/blog.js index ad9a51e3f29722..9f840498bde28a 100644 --- a/lib/routes/samsung/research/blog.js +++ b/lib/routes/samsung/research/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://research.samsung.com'; const currentUrl = `${rootUrl}/blogMain/list.json`; diff --git a/lib/routes/samsung/router.js b/lib/routes/samsung/router.js index 5d86ce749de32f..74ac3f8eba2d71 100644 --- a/lib/routes/samsung/router.js +++ b/lib/routes/samsung/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/research/blog', './research/blog'); }; diff --git a/lib/routes/saraba1st/digest.js b/lib/routes/saraba1st/digest.js index 034a3726b9618e..3c346ff8b0a1dc 100644 --- a/lib/routes/saraba1st/digest.js +++ b/lib/routes/saraba1st/digest.js @@ -7,7 +7,7 @@ import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const tid = ctx.req.param('tid'); const cookieString = config.saraba1st.cookie ?? ''; const res = await got('https://bbs.saraba1st.com/2b/' + tid + '.html', { diff --git a/lib/routes/saraba1st/router.js b/lib/routes/saraba1st/router.js index 40c4169537cba2..0bde67f48f63b1 100644 --- a/lib/routes/saraba1st/router.js +++ b/lib/routes/saraba1st/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/thread/:tid', './thread'); router.get('/digest/:tid', './digest'); }; diff --git a/lib/routes/saraba1st/thread.js b/lib/routes/saraba1st/thread.js index 386b590091ac5a..722a65337dfffb 100644 --- a/lib/routes/saraba1st/thread.js +++ b/lib/routes/saraba1st/thread.js @@ -5,7 +5,7 @@ import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const tid = ctx.req.param('tid'); const cookieString = config.saraba1st.cookie ?? ''; diff --git a/lib/routes/sass/gs/index.js b/lib/routes/sass/gs/index.js index fe0396afd1a04b..a5def11c937fbb 100644 --- a/lib/routes/sass/gs/index.js +++ b/lib/routes/sass/gs/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const host = 'https://gs.sass.org.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const url = `${host}/${type}/list.htm`; diff --git a/lib/routes/sass/router.js b/lib/routes/sass/router.js index fb6bcb4209314d..a338f3b188b9af 100644 --- a/lib/routes/sass/router.js +++ b/lib/routes/sass/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/gs/:type', './gs/index'); }; diff --git a/lib/routes/scau/router.js b/lib/routes/scau/router.js index d7921d23fb38bf..b0781951a26db5 100644 --- a/lib/routes/scau/router.js +++ b/lib/routes/scau/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/yzb', './yjs'); router.get('/yjsy', './yjsy'); }; diff --git a/lib/routes/scau/yjs.js b/lib/routes/scau/yjs.js index 539aeff910c40b..1c2756e6a0594f 100644 --- a/lib/routes/scau/yjs.js +++ b/lib/routes/scau/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://yzb.scau.edu.cn/2136/list1.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/scau/yjsy.js b/lib/routes/scau/yjsy.js index 95742e08226b7b..510089aaf5dae8 100644 --- a/lib/routes/scau/yjsy.js +++ b/lib/routes/scau/yjsy.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://yjsy.scau.edu.cn/208/list1.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/science/blogs.js b/lib/routes/science/blogs.js index 70d97e750e6f79..a105b9f541dbb7 100644 --- a/lib/routes/science/blogs.js +++ b/lib/routes/science/blogs.js @@ -5,7 +5,7 @@ const { baseUrl } = require('./utils'); import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const { name = 'pipeline' } = ctx.req.param(); const link = `${baseUrl}/blogs/${name}/feed`; diff --git a/lib/routes/science/cover.js b/lib/routes/science/cover.js index ccdcb470b107b2..3c7af34ee461aa 100644 --- a/lib/routes/science/cover.js +++ b/lib/routes/science/cover.js @@ -14,7 +14,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { baseUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const pageURL = `${baseUrl}/journals`; const { data: pageResponse } = await got(pageURL, { diff --git a/lib/routes/science/current.js b/lib/routes/science/current.js index e98fd14b009bad..4cef4c2e8c63b4 100644 --- a/lib/routes/science/current.js +++ b/lib/routes/science/current.js @@ -13,7 +13,7 @@ import got from '@/utils/got'; const { baseUrl, fetchDesc, getItem } = require('./utils'); import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const { journal = 'science' } = ctx.req.param(); const pageURL = `${baseUrl}/toc/${journal}/current`; diff --git a/lib/routes/science/early.js b/lib/routes/science/early.js index 2b931a24e99d80..92e478c84b17af 100644 --- a/lib/routes/science/early.js +++ b/lib/routes/science/early.js @@ -5,7 +5,7 @@ import puppeteer from '@/utils/puppeteer'; const { baseUrl, fetchDesc, getItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { journal = 'science' } = ctx.req.param(); const pageUrl = `${baseUrl}/toc/${journal}/0/0`; diff --git a/lib/routes/science/router.js b/lib/routes/science/router.js index 997f340e862d30..c4e549275d8049 100644 --- a/lib/routes/science/router.js +++ b/lib/routes/science/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/blogs/:name?', './blogs'); router.get('/cover', './cover'); router.get('/current/:journal?', './current'); diff --git a/lib/routes/sciencedirect/journal.js b/lib/routes/sciencedirect/journal.js index 1762d8efcd8b02..5b9440440b8e88 100644 --- a/lib/routes/sciencedirect/journal.js +++ b/lib/routes/sciencedirect/journal.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { decodeCFEmail } = require('./cf-email'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://www.sciencedirect.com'; diff --git a/lib/routes/sciencedirect/router.js b/lib/routes/sciencedirect/router.js index 63454f2c6149db..7026d3b4da3538 100644 --- a/lib/routes/sciencedirect/router.js +++ b/lib/routes/sciencedirect/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/journal/:id', './journal'); }; diff --git a/lib/routes/sciencenet/blog.js b/lib/routes/sciencenet/blog.js index c681eb7b733936..abb7634e3ddc62 100644 --- a/lib/routes/sciencenet/blog.js +++ b/lib/routes/sciencenet/blog.js @@ -5,7 +5,7 @@ const iconv = require('iconv-lite'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'recommend'; const time = ctx.req.param('time') ?? '5'; const sort = ctx.req.param('sort') ?? '1'; diff --git a/lib/routes/sciencenet/router.js b/lib/routes/sciencenet/router.js index c2153343405fb2..b9a93d117c07f8 100644 --- a/lib/routes/sciencenet/router.js +++ b/lib/routes/sciencenet/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:type?/:time?/:sort?', './blog'); router.get('/user/:id', './user'); }; diff --git a/lib/routes/sciencenet/user.js b/lib/routes/sciencenet/user.js index e716f6047ca20b..b4ba161d6e066d 100644 --- a/lib/routes/sciencenet/user.js +++ b/lib/routes/sciencenet/user.js @@ -5,7 +5,7 @@ const iconv = require('iconv-lite'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://blog.sciencenet.cn'; diff --git a/lib/routes/scmp/coronavirus.js b/lib/routes/scmp/coronavirus.js index 125bb2cc3669c5..91452f7f4a3be8 100644 --- a/lib/routes/scmp/coronavirus.js +++ b/lib/routes/scmp/coronavirus.js @@ -1,3 +1,3 @@ -module.exports = (ctx) => { +export default (ctx) => { ctx.redirect('/scmp/topics/coronavirus-pandemic-all-stories'); }; diff --git a/lib/routes/scmp/index.js b/lib/routes/scmp/index.js index 68de9f42459628..4d029b2573851c 100644 --- a/lib/routes/scmp/index.js +++ b/lib/routes/scmp/index.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const categoryId = ctx.req.param('category_id'); const rssUrl = `https://www.scmp.com/rss/${categoryId}/feed`; const { data: response } = await got(rssUrl); diff --git a/lib/routes/scmp/router.js b/lib/routes/scmp/router.js index 8e96c204bee4ac..8dce8942f4e72a 100644 --- a/lib/routes/scmp/router.js +++ b/lib/routes/scmp/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/coronavirus', './coronavirus'); router.get('/:category_id', './index'); router.get('/topics/:topic', './topic'); diff --git a/lib/routes/scmp/topic.js b/lib/routes/scmp/topic.js index a0afcfa306df3a..f4df43ec430881 100644 --- a/lib/routes/scmp/topic.js +++ b/lib/routes/scmp/topic.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const topic = ctx.req.param('topic'); const limit = Number.parseInt(ctx.req.query('limit'), 10) || 30; const pageUrl = `https://www.scmp.com/topics/${topic}`; diff --git a/lib/routes/scnu/cs/match.js b/lib/routes/scnu/cs/match.js index 7f1fa92645d9ee..16db6bc98c2dc0 100644 --- a/lib/routes/scnu/cs/match.js +++ b/lib/routes/scnu/cs/match.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://cs.scnu.edu.cn'; const url = `${baseUrl}/xueshenggongzuo/chengchangfazhan/kejichuangxin/`; const res = await got({ diff --git a/lib/routes/scnu/jw.js b/lib/routes/scnu/jw.js index df1272e3393b48..7006cd4fac27fb 100644 --- a/lib/routes/scnu/jw.js +++ b/lib/routes/scnu/jw.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://jw.scnu.edu.cn'; const url = `${baseUrl}/ann/index.html`; const res = await got({ diff --git a/lib/routes/scnu/library.js b/lib/routes/scnu/library.js index e36cf95ff0b4fa..e791b8b3a5544a 100644 --- a/lib/routes/scnu/library.js +++ b/lib/routes/scnu/library.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://lib.scnu.edu.cn'; const url = `${baseUrl}/news/zuixingonggao/`; const res = await got({ diff --git a/lib/routes/scnu/router.js b/lib/routes/scnu/router.js index 17eaf697b6c256..e770d7535fde25 100644 --- a/lib/routes/scnu/router.js +++ b/lib/routes/scnu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/cs/match', './cs/match'); router.get('/jw', './jw'); router.get('/library', './library'); diff --git a/lib/routes/scnu/ss.js b/lib/routes/scnu/ss.js index 56cadfcd4a1ae4..ed09f72d17cc8c 100644 --- a/lib/routes/scnu/ss.js +++ b/lib/routes/scnu/ss.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://ss.scnu.edu.cn/tongzhigonggao/'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/scnu/yjs.js b/lib/routes/scnu/yjs.js index 068e1d88f59f29..3122134d48c4f4 100644 --- a/lib/routes/scnu/yjs.js +++ b/lib/routes/scnu/yjs.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://yz.scnu.edu.cn/tongzhigonggao/ssgg/'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/sctv/programme.js b/lib/routes/sctv/programme.js index 51971cceb522ec..7497234294c837 100644 --- a/lib/routes/sctv/programme.js +++ b/lib/routes/sctv/programme.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '1'; const limit = ctx.req.param('limit') ? Number.parseInt(ctx.req.param('limit')) : 15; const isFull = /t|y/i.test(ctx.req.param('isFull') ?? 'true'); diff --git a/lib/routes/sctv/router.js b/lib/routes/sctv/router.js index 9ec671b251effe..f725a95de0c3bb 100644 --- a/lib/routes/sctv/router.js +++ b/lib/routes/sctv/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/programme/:id?/:limit?/:isFull?', './programme'); }; diff --git a/lib/routes/scut/jwc/news.js b/lib/routes/scut/jwc/news.js index ddda6b1b761c5e..7041e18f8aba12 100644 --- a/lib/routes/scut/jwc/news.js +++ b/lib/routes/scut/jwc/news.js @@ -46,7 +46,7 @@ const generateArticleLink = (id) => `

链接: resolveRelativeUrl(data.content) + generateArticleLink(data.id); -module.exports = async (ctx) => { +export default async (ctx) => { const categoryName = ctx.req.param('category') || 'all'; const categoryMeta = categoryMap[categoryName]; diff --git a/lib/routes/scut/jwc/school.js b/lib/routes/scut/jwc/school.js index a0315104aaca46..58b502278fffbd 100644 --- a/lib/routes/scut/jwc/school.js +++ b/lib/routes/scut/jwc/school.js @@ -51,7 +51,7 @@ const generateArticleLink = (id) => `

链接:(.+?)<\/a><\/h5>\s*

(.+?)<\/p>/g)].map((item) => ({ title: item[2], diff --git a/lib/routes/secrss/author.js b/lib/routes/secrss/author.js index 302c0debbc77e7..02744641b59d89 100644 --- a/lib/routes/secrss/author.js +++ b/lib/routes/secrss/author.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const api = 'https://www.secrss.com/api/articles/group?author='; const author = ctx.req.param('author'); const host = 'https://www.secrss.com'; diff --git a/lib/routes/secrss/category.js b/lib/routes/secrss/category.js index 719ff3ff98a981..0b1ccb8304c8ae 100644 --- a/lib/routes/secrss/category.js +++ b/lib/routes/secrss/category.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const api = 'https://www.secrss.com/api/articles?tag='; const { category = '' } = ctx.req.param(); const host = 'https://www.secrss.com'; diff --git a/lib/routes/secrss/router.js b/lib/routes/secrss/router.js index 9aa1e26974002a..9315f80fe8b3e2 100644 --- a/lib/routes/secrss/router.js +++ b/lib/routes/secrss/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/author/:author', './author'); router.get('/category/:category?', './category'); }; diff --git a/lib/routes/seekingalpha/index.js b/lib/routes/seekingalpha/index.js index 39dfde15a99dbb..06ef5bc7543ccf 100644 --- a/lib/routes/seekingalpha/index.js +++ b/lib/routes/seekingalpha/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const dayjs = require('dayjs'); const baseUrl = 'https://seekingalpha.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'news', symbol } = ctx.req.param(); const pageUrl = `${baseUrl}/symbol/${symbol.toUpperCase()}/${category === 'transcripts' ? `earnings/${category}` : category}`; diff --git a/lib/routes/seekingalpha/router.js b/lib/routes/seekingalpha/router.js index 03def4ae1f5220..951f253e8fc480 100644 --- a/lib/routes/seekingalpha/router.js +++ b/lib/routes/seekingalpha/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:symbol/:category?', './index'); }; diff --git a/lib/routes/segmentfault/blogs.js b/lib/routes/segmentfault/blogs.js index c0574b829dcbaa..0fd30cf9df7503 100644 --- a/lib/routes/segmentfault/blogs.js +++ b/lib/routes/segmentfault/blogs.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { host, acw_sc__v2, parseList, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const apiURL = `${host}/gateway/tag/${tag}/articles?loadMoreType=pagination&initData=true&page=1&sort=newest&pageSize=30`; const response = await got(apiURL); diff --git a/lib/routes/segmentfault/channel.js b/lib/routes/segmentfault/channel.js index 1a721b9b5f888a..9fcd76423b08cb 100644 --- a/lib/routes/segmentfault/channel.js +++ b/lib/routes/segmentfault/channel.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { host, acw_sc__v2, parseList, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const link = `${host}/channel/${name}`; diff --git a/lib/routes/segmentfault/router.js b/lib/routes/segmentfault/router.js index 2a9eab9a509a1f..366423adbca30a 100644 --- a/lib/routes/segmentfault/router.js +++ b/lib/routes/segmentfault/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/blogs/:tag', './blogs'); router.get('/channel/:name', './channel'); router.get('/user/:name', './user'); diff --git a/lib/routes/segmentfault/user.js b/lib/routes/segmentfault/user.js index 16295527b2f0aa..a56359d665af65 100644 --- a/lib/routes/segmentfault/user.js +++ b/lib/routes/segmentfault/user.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { host, acw_sc__v2, parseList, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const apiURL = `${host}/gateway/homepage/${name}/timeline?size=20&offset=`; diff --git a/lib/routes/sehuatang/index.js b/lib/routes/sehuatang/index.js index 5c6cfe4f60d6c8..4d38ae01ad2791 100644 --- a/lib/routes/sehuatang/index.js +++ b/lib/routes/sehuatang/index.js @@ -38,7 +38,7 @@ const forumIdMaps = { hrxazp: '98', // 华人性爱自拍 }; -module.exports = async (ctx) => { +export default async (ctx) => { const subformName = ctx.req.param('subforumid') ?? 'gqzwzm'; const subformId = subformName in forumIdMaps ? forumIdMaps[subformName] : subformName; const type = ctx.req.param('type'); diff --git a/lib/routes/sehuatang/router.js b/lib/routes/sehuatang/router.js index cc202f40814bfb..ada03ff2f044e5 100644 --- a/lib/routes/sehuatang/router.js +++ b/lib/routes/sehuatang/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/bt/:subforumid?', './index'); router.get('/picture/:subforumid', './index'); router.get('/user/:uid', './user'); diff --git a/lib/routes/sehuatang/user.js b/lib/routes/sehuatang/user.js index 51f403cb5546ae..a23e92262bce52 100644 --- a/lib/routes/sehuatang/user.js +++ b/lib/routes/sehuatang/user.js @@ -7,7 +7,7 @@ import { config } from '@/config'; const baseUrl = 'https://sehuatang.org/'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.sehuatang.cookie) { throw new Error('Sehuatang RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/sensortower/blog.js b/lib/routes/sensortower/blog.js index 19122b5f32c54a..757c9e492b32bb 100644 --- a/lib/routes/sensortower/blog.js +++ b/lib/routes/sensortower/blog.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? ''; const rootUrl = 'https://sensortower.com'; diff --git a/lib/routes/sensortower/router.js b/lib/routes/sensortower/router.js index d4fdc9516d3bfb..46410d3d1cff91 100644 --- a/lib/routes/sensortower/router.js +++ b/lib/routes/sensortower/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:language?', './blog'); }; diff --git a/lib/routes/setn/index.js b/lib/routes/setn/index.js index 0d08a56ef6c8d1..3c61d0cad8bb5d 100644 --- a/lib/routes/setn/index.js +++ b/lib/routes/setn/index.js @@ -42,7 +42,7 @@ const getCurrentUrl = (category) => { return `${rootUrl}/viewall`; }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '即時'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 42; diff --git a/lib/routes/setn/router.js b/lib/routes/setn/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/setn/router.js +++ b/lib/routes/setn/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/seu/cse/index.js b/lib/routes/seu/cse/index.js index 59c5266c110384..2e932d8a949506 100644 --- a/lib/routes/seu/cse/index.js +++ b/lib/routes/seu/cse/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://cse.seu.edu.cn'; const map = { diff --git a/lib/routes/seu/radio/academic.js b/lib/routes/seu/radio/academic.js index 2e3f1e66949e87..c4f6d20c532f5a 100644 --- a/lib/routes/seu/radio/academic.js +++ b/lib/routes/seu/radio/academic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://radio.seu.edu.cn'; const link = new URL('_s29/15986/list.psp', host).href; const response = await got(link); diff --git a/lib/routes/seu/router.js b/lib/routes/seu/router.js index 37b8155e80f92a..0007ce6047d219 100644 --- a/lib/routes/seu/router.js +++ b/lib/routes/seu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/cse/:type?', './cse'); router.get('/radio/academic', './radio/academic'); router.get('/yjs', './yjs'); diff --git a/lib/routes/seu/yjs.js b/lib/routes/seu/yjs.js index 665ad4b0dd0c00..383cae80657eaa 100644 --- a/lib/routes/seu/yjs.js +++ b/lib/routes/seu/yjs.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const url = 'https://seugs.seu.edu.cn/26671/list.htm'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(url); const $ = load(response.data); const list = $('.news') diff --git a/lib/routes/seu/yzb/index.js b/lib/routes/seu/yzb/index.js index 201586fa53be05..8957cc10e2bfd3 100644 --- a/lib/routes/seu/yzb/index.js +++ b/lib/routes/seu/yzb/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://yzb.seu.edu.cn'; const map = { diff --git a/lib/routes/sfacg/novel-chapter.js b/lib/routes/sfacg/novel-chapter.js index f11f2fcb8d488f..e033bffe9f002b 100644 --- a/lib/routes/sfacg/novel-chapter.js +++ b/lib/routes/sfacg/novel-chapter.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param.get('id'); const limit = Number.parseInt(ctx.req.query('limit')) || 20; diff --git a/lib/routes/sfacg/router.js b/lib/routes/sfacg/router.js index ce44237afc2a33..151935db563465 100644 --- a/lib/routes/sfacg/router.js +++ b/lib/routes/sfacg/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/novel/chapter/:id', require('./novel-chapter')); }; diff --git a/lib/routes/shcstheatre/programs.js b/lib/routes/shcstheatre/programs.js index c039b55dac07ff..c60b89e14101a4 100644 --- a/lib/routes/shcstheatre/programs.js +++ b/lib/routes/shcstheatre/programs.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { load } from 'cheerio'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.shcstheatre.com/Program/programList.aspx'; const res = await got.get(url); const $ = load(res.data); diff --git a/lib/routes/shcstheatre/router.js b/lib/routes/shcstheatre/router.js index e9a8d7c51a39db..119388dd63b050 100644 --- a/lib/routes/shcstheatre/router.js +++ b/lib/routes/shcstheatre/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/programs', './programs'); }; diff --git a/lib/routes/shiep/index.js b/lib/routes/shiep/index.js index 7efcf075a8d1e9..4fb5f8d2b32272 100644 --- a/lib/routes/shiep/index.js +++ b/lib/routes/shiep/index.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; const { config } = require('./config'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); if (!Object.keys(config).includes(type)) { diff --git a/lib/routes/shiep/router.js b/lib/routes/shiep/router.js index 64b6dd359f26d3..f1f031a956d3d6 100644 --- a/lib/routes/shiep/router.js +++ b/lib/routes/shiep/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type/:id?', './index'); }; diff --git a/lib/routes/shisu/news.js b/lib/routes/shisu/news.js index 1c2bb2027f88ad..dd0c9ca544ba96 100644 --- a/lib/routes/shisu/news.js +++ b/lib/routes/shisu/news.js @@ -7,7 +7,7 @@ import timezone from '@/utils/timezone'; const url = 'https://news.shisu.edu.cn'; const banner = 'https://news.shisu.edu.cn/news/index/39adf3d9ae414bc39c6d3b9316ae531f.png'; -module.exports = async (ctx) => { +export default async (ctx) => { const { section = 'news' } = ctx.req.param(); const { data: r } = await got(`${url}/${section}/index.html`); const $ = load(r); diff --git a/lib/routes/shisu/router.js b/lib/routes/shisu/router.js index 0dc3963f08d651..cc284c6f1d29ca 100644 --- a/lib/routes/shisu/router.js +++ b/lib/routes/shisu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:category', './news'); }; diff --git a/lib/routes/shmeea/index.js b/lib/routes/shmeea/index.js index 6f2a502e7a3b76..cf84b1e27d2a94 100644 --- a/lib/routes/shmeea/index.js +++ b/lib/routes/shmeea/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '08000'; const baseURL = 'https://www.shmeea.edu.cn'; const link = `${baseURL}/page/${id}/index.html`; diff --git a/lib/routes/shmeea/router.js b/lib/routes/shmeea/router.js index 28fdc0e8ef139a..570ab1677326c5 100644 --- a/lib/routes/shmeea/router.js +++ b/lib/routes/shmeea/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/self-study', './self-study'); router.get('/:id?', './index'); }; diff --git a/lib/routes/shmeea/self-study.js b/lib/routes/shmeea/self-study.js index 82b71578b97bf5..ba9e164e5e7865 100644 --- a/lib/routes/shmeea/self-study.js +++ b/lib/routes/shmeea/self-study.js @@ -38,7 +38,7 @@ function load_detail(list, cache) { ); } -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'http://www.shmeea.edu.cn/page/04000/index.html', diff --git a/lib/routes/shmtu/jwc.js b/lib/routes/shmtu/jwc.js index 77a0a1236a41ee..742a89106a797f 100644 --- a/lib/routes/shmtu/jwc.js +++ b/lib/routes/shmtu/jwc.js @@ -22,7 +22,7 @@ const ProcessFeed = (list, caches) => ) ); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const info = type === 'jwgg' ? '教务公告' : '教务新闻'; diff --git a/lib/routes/shmtu/portal.js b/lib/routes/shmtu/portal.js index ae23232c950db2..aa08f9e03f335b 100644 --- a/lib/routes/shmtu/portal.js +++ b/lib/routes/shmtu/portal.js @@ -38,7 +38,7 @@ const processFeed = (list, caches) => ) ); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let info; switch (type) { diff --git a/lib/routes/shmtu/router.js b/lib/routes/shmtu/router.js index 453ac52d48fc5c..330fc3569bf12d 100644 --- a/lib/routes/shmtu/router.js +++ b/lib/routes/shmtu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/jwc/:type', './jwc'); router.get('/portal/:type', './portal'); router.get('/www/:type', './www'); diff --git a/lib/routes/shmtu/www.js b/lib/routes/shmtu/www.js index 0918b8b228bd69..18e6159ffae16d 100644 --- a/lib/routes/shmtu/www.js +++ b/lib/routes/shmtu/www.js @@ -22,7 +22,7 @@ const ProcessFeed = (list, caches) => ) ); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const info = type === 'notes' ? '通知公告' : '学术讲座'; diff --git a/lib/routes/shoac/recent-show.js b/lib/routes/shoac/recent-show.js index 6908a1f52bda54..fa9ef635626a00 100644 --- a/lib/routes/shoac/recent-show.js +++ b/lib/routes/shoac/recent-show.js @@ -4,7 +4,7 @@ import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.shoac.com.cn'; const headers = { diff --git a/lib/routes/shoac/router.js b/lib/routes/shoac/router.js index 8f6ddcdf43217e..7f3d9721c62220 100644 --- a/lib/routes/shoac/router.js +++ b/lib/routes/shoac/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/recent-show', './recent-show'); }; diff --git a/lib/routes/shopback/router.js b/lib/routes/shopback/router.js index 0da1e5ddbc93af..1dfaf4d85d574c 100644 --- a/lib/routes/shopback/router.js +++ b/lib/routes/shopback/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:store', './store'); }; diff --git a/lib/routes/shopback/store.js b/lib/routes/shopback/store.js index fb1a4d2fd72691..d0853b60c2e130 100644 --- a/lib/routes/shopback/store.js +++ b/lib/routes/shopback/store.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const store = ctx.req.param('store'); const rootUrl = 'https://www.shopback.com.tw'; diff --git a/lib/routes/shoppingdesign/posts.js b/lib/routes/shoppingdesign/posts.js index e42305c859675a..5035632ab37797 100644 --- a/lib/routes/shoppingdesign/posts.js +++ b/lib/routes/shoppingdesign/posts.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const asyncPool = require('tiny-async-pool'); -module.exports = async (ctx) => { +export default async (ctx) => { // sn_f parameter is required to prevent redirection const currentUrl = 'https://www.shoppingdesign.com.tw/post?sn_f=1'; const response = await got(currentUrl); diff --git a/lib/routes/shoppingdesign/router.js b/lib/routes/shoppingdesign/router.js index 8fa3d21ef28cbc..38d28718fcb042 100644 --- a/lib/routes/shoppingdesign/router.js +++ b/lib/routes/shoppingdesign/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/posts', './posts'); }; diff --git a/lib/routes/showstart/artist.js b/lib/routes/showstart/artist.js index 124fb3df764473..6eb0545d938aa2 100644 --- a/lib/routes/showstart/artist.js +++ b/lib/routes/showstart/artist.js @@ -1,7 +1,7 @@ const { TITLE, HOST } = require('./const'); const { fetchPerformerInfo } = require('./service'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const artist = await fetchPerformerInfo({ performerId: id, diff --git a/lib/routes/showstart/brand.js b/lib/routes/showstart/brand.js index 56623e59833dbf..acf01c343d947b 100644 --- a/lib/routes/showstart/brand.js +++ b/lib/routes/showstart/brand.js @@ -1,7 +1,7 @@ const { TITLE, HOST } = require('./const'); const { fetchBrandInfo } = require('./service'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const brand = await fetchBrandInfo({ brandId: id, diff --git a/lib/routes/showstart/event.js b/lib/routes/showstart/event.js index 9b01cecba3634e..15a5a2c8b6ad29 100644 --- a/lib/routes/showstart/event.js +++ b/lib/routes/showstart/event.js @@ -1,7 +1,7 @@ const { TITLE, HOST } = require('./const'); const { fetchActivityList, fetchDictionary } = require('./service'); -module.exports = async (ctx) => { +export default async (ctx) => { const cityCode = Number.parseInt(ctx.req.param('cityCode')); const showStyle = Number.parseInt(ctx.req.param('showStyle')); const items = await fetchActivityList({ diff --git a/lib/routes/showstart/router.js b/lib/routes/showstart/router.js index 5f088745c34bfa..38c1e21bdb3c49 100644 --- a/lib/routes/showstart/router.js +++ b/lib/routes/showstart/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/artist/:id', './artist'); router.get('/brand/:id', './brand'); router.get('/event/:cityCode/:showStyle?', './event'); diff --git a/lib/routes/showstart/search.js b/lib/routes/showstart/search.js index 213b2de015ec66..f52953765159e9 100644 --- a/lib/routes/showstart/search.js +++ b/lib/routes/showstart/search.js @@ -1,7 +1,7 @@ const { TITLE, HOST } = require('./const'); const { fetchActivityList, fetchPerformerList, fetchBrandList, fetchCityList, fetchStyleList } = require('./service'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || ''; const keyword = ctx.req.param('keyword') || ''; diff --git a/lib/routes/shu/index.js b/lib/routes/shu/index.js index 456bb7e8952e0b..5f3a337fc59e58 100644 --- a/lib/routes/shu/index.js +++ b/lib/routes/shu/index.js @@ -12,7 +12,7 @@ const alias = new Map([ ['important', 'zyxw'], // 重要新闻 ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'news'; const link = `https://www.shu.edu.cn/${alias.get(type) || type}.htm`; const respond = await got.get(link); diff --git a/lib/routes/shu/jwb.js b/lib/routes/shu/jwb.js index 3f8e1b65477a40..bb3e7971ec21fa 100644 --- a/lib/routes/shu/jwb.js +++ b/lib/routes/shu/jwb.js @@ -10,7 +10,7 @@ const alias = new Map([ ['policy', 'zcwj'], // 政策文件 ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'notice'; const link = `https://jwb.shu.edu.cn/index/${alias.get(type) || type}.htm`; const respond = await got.get(link); diff --git a/lib/routes/shu/router.js b/lib/routes/shu/router.js index 31485062cae1d5..1faa752d430387 100644 --- a/lib/routes/shu/router.js +++ b/lib/routes/shu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:type?', './index'); router.get('/jwc/:type?', './jwb'); // TODO: deprecated, remove this line when someone update this file next time router.get('/jwb/:type?', './jwb'); diff --git a/lib/routes/shuiguopai/index.js b/lib/routes/shuiguopai/index.js index 66696ee9733687..2d3718243ace79 100644 --- a/lib/routes/shuiguopai/index.js +++ b/lib/routes/shuiguopai/index.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://sgptv.vip'; const apiRootUrl = 'https://api.cbbee0.com'; const listUrl = `${apiRootUrl}/v1_2/homePage`; diff --git a/lib/routes/shuiguopai/router.js b/lib/routes/shuiguopai/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/shuiguopai/router.js +++ b/lib/routes/shuiguopai/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/sicau/dky.js b/lib/routes/sicau/dky.js index a3e119104d3a62..deaed62e880694 100644 --- a/lib/routes/sicau/dky.js +++ b/lib/routes/sicau/dky.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'tzgg'; const rootUrl = 'https://dky.sicau.edu.cn'; diff --git a/lib/routes/sicau/router.js b/lib/routes/sicau/router.js index 6fe097f5955767..0b74ca1db9b107 100644 --- a/lib/routes/sicau/router.js +++ b/lib/routes/sicau/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/dky/:category?', './dky'); router.get('/yan/:category?', './yan'); router.get('/zsjy/:category?', './zsjy'); diff --git a/lib/routes/sicau/yan.js b/lib/routes/sicau/yan.js index 7b1d16f2bd885c..da96d503a6c682 100644 --- a/lib/routes/sicau/yan.js +++ b/lib/routes/sicau/yan.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'xwgg'; const rootUrl = 'https://yan.sicau.edu.cn'; diff --git a/lib/routes/sicau/zsjy.js b/lib/routes/sicau/zsjy.js index d5252c6506401c..f2ac1e62744e18 100644 --- a/lib/routes/sicau/zsjy.js +++ b/lib/routes/sicau/zsjy.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'bkszs'; const rootUrl = 'https://dky.sicau.edu.cn'; diff --git a/lib/routes/sigsac/ccs.js b/lib/routes/sigsac/ccs.js index 7f14f14b85ddcb..8bb350dbdc5a2e 100644 --- a/lib/routes/sigsac/ccs.js +++ b/lib/routes/sigsac/ccs.js @@ -4,7 +4,7 @@ const url = 'https://www.sigsac.org/'; import { parseDate } from '@/utils/parse-date'; // https://www.sigsac.org/ccs/CCS2022/program/accepted-papers.html -module.exports = async (ctx) => { +export default async (ctx) => { const last = new Date().getFullYear() + 1; const yearList = Array.from({ length: last - 2020 }, (_, v) => `${url}ccs/CCS${v + 2020}/`); const yearResponses = await got.all(yearList.map((url) => got(url))); diff --git a/lib/routes/sigsac/router.js b/lib/routes/sigsac/router.js index 2f2dd42035912d..5b63e9fa91bf98 100644 --- a/lib/routes/sigsac/router.js +++ b/lib/routes/sigsac/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/ccs', './ccs'); }; diff --git a/lib/routes/simpleinfo/index.js b/lib/routes/simpleinfo/index.js index bece6dc010e056..37e524f0b56edd 100644 --- a/lib/routes/simpleinfo/index.js +++ b/lib/routes/simpleinfo/index.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const rootUrl = 'https://blog.simpleinfo.cc'; const link = `${rootUrl}${category ? (category === 'work' || category === 'talk' ? `/blog/${category}` : `/shasha77?category=${category}`) : '/shasha77'}`; diff --git a/lib/routes/simpleinfo/router.js b/lib/routes/simpleinfo/router.js index 5db50869af4b34..0bcd82a5c2aa19 100644 --- a/lib/routes/simpleinfo/router.js +++ b/lib/routes/simpleinfo/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/sina/chuangshiji.js b/lib/routes/sina/chuangshiji.js index ca5b90d143e836..3ac7d537d85ee6 100644 --- a/lib/routes/sina/chuangshiji.js +++ b/lib/routes/sina/chuangshiji.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getRollNewsList, parseRollNewsList, parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const pageid = '402'; const lid = '2559'; const { limit = '50' } = ctx.req.query(); diff --git a/lib/routes/sina/discovery.js b/lib/routes/sina/discovery.js index b94e5306391f35..990585835ece5b 100644 --- a/lib/routes/sina/discovery.js +++ b/lib/routes/sina/discovery.js @@ -13,7 +13,7 @@ const map = new Map([ ['kjqy', { title: '科技前沿', id: '1802' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const lid = map.get(type).id; const title = map.get(type).title; diff --git a/lib/routes/sina/finance/china.js b/lib/routes/sina/finance/china.js index 1559d1fd41308e..92bb28ef5f6583 100644 --- a/lib/routes/sina/finance/china.js +++ b/lib/routes/sina/finance/china.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getRollNewsList, parseRollNewsList, parseArticle } = require('../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const map = { 1686: '国内滚动', 1687: '宏观经济', diff --git a/lib/routes/sina/finance/stock/usstock.js b/lib/routes/sina/finance/stock/usstock.js index e54d1b0b87f942..9edf6ab2d93c7c 100644 --- a/lib/routes/sina/finance/stock/usstock.js +++ b/lib/routes/sina/finance/stock/usstock.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseArticle } = require('../../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { cids = '57045' } = ctx.req.param(); const { limit = '50' } = ctx.req.query(); const { data: response } = await got('https://interface.sina.cn/pc_api/public_news_data.d.json', { diff --git a/lib/routes/sina/rollnews.js b/lib/routes/sina/rollnews.js index eb2fd7b1002c36..164ae44ec088c1 100644 --- a/lib/routes/sina/rollnews.js +++ b/lib/routes/sina/rollnews.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getRollNewsList, parseRollNewsList, parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const map = { 2509: '全部', 2510: '国内', diff --git a/lib/routes/sina/router.js b/lib/routes/sina/router.js index 904be8e6b5e68e..61f838bbd5e122 100644 --- a/lib/routes/sina/router.js +++ b/lib/routes/sina/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/csj', './chuangshiji'); router.get('/discovery/:type', './discovery'); router.get('/finance/china/:lid?', './finance/china'); diff --git a/lib/routes/sina/sports.js b/lib/routes/sina/sports.js index 830a77ffa71ed0..9dfe5beaa2b4a0 100644 --- a/lib/routes/sina/sports.js +++ b/lib/routes/sina/sports.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); let currentUrl = `https://sports.sina.com.cn/others/${type}.shtml`; diff --git a/lib/routes/sinchew/index.js b/lib/routes/sinchew/index.js index 5e5893e62f1482..bca9a7c7895c8c 100644 --- a/lib/routes/sinchew/index.js +++ b/lib/routes/sinchew/index.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.sinchew.com.my'; const currentUrl = `${rootUrl}${getSubPath(ctx) === '/' ? '' : getSubPath(ctx)}`; diff --git a/lib/routes/sinchew/router.js b/lib/routes/sinchew/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/sinchew/router.js +++ b/lib/routes/sinchew/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/sis001/forum.js b/lib/routes/sis001/forum.js index 23534dafcfaa48..7f2b06aeb45059 100644 --- a/lib/routes/sis001/forum.js +++ b/lib/routes/sis001/forum.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const baseUrl = 'https://www.sis001.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = 76 } = ctx.req.param(); const url = `${baseUrl}/forum/forum-${id}-1.html`; diff --git a/lib/routes/sis001/router.js b/lib/routes/sis001/router.js index 71de63f97f3e07..fbe01a2d755e6c 100644 --- a/lib/routes/sis001/router.js +++ b/lib/routes/sis001/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/forum/:id?', './forum'); }; diff --git a/lib/routes/sjtu/gs.js b/lib/routes/sjtu/gs.js index 56bd37f0ccdbd7..d0cbee929b8de5 100644 --- a/lib/routes/sjtu/gs.js +++ b/lib/routes/sjtu/gs.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { fetchArticle } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const num = ctx.req.param('num') ?? ''; diff --git a/lib/routes/sjtu/jwc.js b/lib/routes/sjtu/jwc.js index d7599148d33f3c..0c764f4429e5e6 100644 --- a/lib/routes/sjtu/jwc.js +++ b/lib/routes/sjtu/jwc.js @@ -26,7 +26,7 @@ async function getFullArticle(link) { return content.html() + ($('.Newslist2').length ? $('.Newslist2').html() : ''); } -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'notice'; const config = { all: { diff --git a/lib/routes/sjtu/router.js b/lib/routes/sjtu/router.js index 272b728a97fd64..1b9204bc48ffc1 100644 --- a/lib/routes/sjtu/router.js +++ b/lib/routes/sjtu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/gs/:type/:num?', './gs'); router.get('/jwc/:type?', './jwc'); router.get('/seiee/academic', './seiee/academic'); diff --git a/lib/routes/sjtu/tongqu/activity.js b/lib/routes/sjtu/tongqu/activity.js index 6522fa2df6f4c9..4c637da36dd575 100644 --- a/lib/routes/sjtu/tongqu/activity.js +++ b/lib/routes/sjtu/tongqu/activity.js @@ -4,7 +4,7 @@ import * as path from 'node:path'; const urlRoot = 'https://tongqu.sjtu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'all'; const config = { all: 0, diff --git a/lib/routes/sjtu/yzb/zkxx.js b/lib/routes/sjtu/yzb/zkxx.js index d6626d8b765abf..b17bea1e6180c2 100644 --- a/lib/routes/sjtu/yzb/zkxx.js +++ b/lib/routes/sjtu/yzb/zkxx.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseTitle = '上海交通大学研究生招生网招考信息'; const baseUrl = 'https://yzb.sjtu.edu.cn/index/zkxx/'; -module.exports = async (ctx) => { +export default async (ctx) => { const pageUrl = `${baseUrl}${ctx.req.param('type')}.htm`; const response = await got({ diff --git a/lib/routes/skysports/news.js b/lib/routes/skysports/news.js index b881ab7046fb79..32a85f360d727c 100644 --- a/lib/routes/skysports/news.js +++ b/lib/routes/skysports/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const team = ctx.req.param('team'); const rootUrl = 'https://www.skysports.com'; diff --git a/lib/routes/skysports/router.js b/lib/routes/skysports/router.js index 3af029f6f5a80f..9f0512b64e4ba2 100644 --- a/lib/routes/skysports/router.js +++ b/lib/routes/skysports/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:team', './news'); }; diff --git a/lib/routes/slowmist/router.js b/lib/routes/slowmist/router.js index 0dd3ae3c939b5b..adf4cfbfa8e2ae 100644 --- a/lib/routes/slowmist/router.js +++ b/lib/routes/slowmist/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?', './slowmist'); }; diff --git a/lib/routes/slowmist/slowmist.js b/lib/routes/slowmist/slowmist.js index 421c1f24b20e0c..4683b7804e43dc 100644 --- a/lib/routes/slowmist/slowmist.js +++ b/lib/routes/slowmist/slowmist.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.slowmist.com'; import { finishArticleItem } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { let type = ctx.req.param('type'); let title = '慢雾科技 - '; diff --git a/lib/routes/smashingmagazine/category.js b/lib/routes/smashingmagazine/category.js index ca3929c7a3fc13..e8d2669326132b 100644 --- a/lib/routes/smashingmagazine/category.js +++ b/lib/routes/smashingmagazine/category.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const baseUrl = 'https://www.smashingmagazine.com'; const route = category ? `/category/${category}` : '/articles'; diff --git a/lib/routes/smashingmagazine/router.js b/lib/routes/smashingmagazine/router.js index 29f238038caec0..22dfff62dde7e4 100644 --- a/lib/routes/smashingmagazine/router.js +++ b/lib/routes/smashingmagazine/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './category'); }; diff --git a/lib/routes/smzdm/article.js b/lib/routes/smzdm/article.js index c44532a2034501..21b48710de2cc8 100644 --- a/lib/routes/smzdm/article.js +++ b/lib/routes/smzdm/article.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `https://zhiyou.smzdm.com/member/${ctx.req.param('uid')}/article/`; const response = await got(link); diff --git a/lib/routes/smzdm/baoliao.js b/lib/routes/smzdm/baoliao.js index 171b49a700c55a..3b4a9b0bcc3cdb 100644 --- a/lib/routes/smzdm/baoliao.js +++ b/lib/routes/smzdm/baoliao.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `https://zhiyou.smzdm.com/member/${ctx.req.param('uid')}/baoliao/`; const response = await got(link); diff --git a/lib/routes/smzdm/haowen-fenlei.js b/lib/routes/smzdm/haowen-fenlei.js index f8727ef64da55d..aafd0467f953f7 100644 --- a/lib/routes/smzdm/haowen-fenlei.js +++ b/lib/routes/smzdm/haowen-fenlei.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const name = ctx.req.param('name'); const sort = ctx.req.param('sort') || '0'; diff --git a/lib/routes/smzdm/haowen.js b/lib/routes/smzdm/haowen.js index 27b9774a96f437..48264b0f77476b 100644 --- a/lib/routes/smzdm/haowen.js +++ b/lib/routes/smzdm/haowen.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const day = ctx.req.param('day') ?? 'all'; const link = `https://post.smzdm.com/hot_${day}/`; diff --git a/lib/routes/smzdm/keyword.js b/lib/routes/smzdm/keyword.js index 1b931fd2d147ae..9664789e0baffa 100644 --- a/lib/routes/smzdm/keyword.js +++ b/lib/routes/smzdm/keyword.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const response = await got(`https://search.smzdm.com`, { diff --git a/lib/routes/smzdm/ranking.js b/lib/routes/smzdm/ranking.js index 005206caf02c16..665db0fccc4105 100644 --- a/lib/routes/smzdm/ranking.js +++ b/lib/routes/smzdm/ranking.js @@ -12,7 +12,7 @@ const getTrueHour = (rank_type, rank_id, hour) => { } }; -module.exports = async (ctx) => { +export default async (ctx) => { const { rank_type, rank_id, hour } = ctx.req.param(); // When the hour is 3, some special rank_id require a special hour num diff --git a/lib/routes/smzdm/router.js b/lib/routes/smzdm/router.js index e34c6281bd8624..bc1cab07c3cd32 100644 --- a/lib/routes/smzdm/router.js +++ b/lib/routes/smzdm/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/article/:uid', './article'); router.get('/baoliao/:uid', './baoliao'); router.get('/haowen/:day?', './haowen'); diff --git a/lib/routes/snowpeak/router.js b/lib/routes/snowpeak/router.js index 3191a60dab3df5..b81754ec869e88 100644 --- a/lib/routes/snowpeak/router.js +++ b/lib/routes/snowpeak/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/us/new-arrivals', './us-new-arrivals'); }; diff --git a/lib/routes/snowpeak/us-new-arrivals.js b/lib/routes/snowpeak/us-new-arrivals.js index c45f1f1ebf0a33..17ba3f8c681a78 100644 --- a/lib/routes/snowpeak/us-new-arrivals.js +++ b/lib/routes/snowpeak/us-new-arrivals.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.snowpeak.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${host}/collections/new-arrivals`; const response = await got({ method: 'get', diff --git a/lib/routes/sobooks/date.js b/lib/routes/sobooks/date.js index d1c453b5638e42..f4ffd41745c40a 100644 --- a/lib/routes/sobooks/date.js +++ b/lib/routes/sobooks/date.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const date = ctx.req.param('date') ?? `${new Date().getFullYear()}/${new Date().getMonth()}`; ctx.set('data', await utils(ctx, `books/date/${date.replace('-', '/')}`)); diff --git a/lib/routes/sobooks/index.js b/lib/routes/sobooks/index.js index 78ce2497f4c24f..d941bb5621fde1 100644 --- a/lib/routes/sobooks/index.js +++ b/lib/routes/sobooks/index.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; ctx.set('data', await utils(ctx, category)); diff --git a/lib/routes/sobooks/router.js b/lib/routes/sobooks/router.js index 6819d5d7035af9..648d1ab024ae28 100644 --- a/lib/routes/sobooks/router.js +++ b/lib/routes/sobooks/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/tag/:id?', './tag'); router.get('/date/:date?', './date'); router.get('/:category?', './index'); diff --git a/lib/routes/sobooks/tag.js b/lib/routes/sobooks/tag.js index 1a30b5c3561ce9..06cffbd4aa837f 100644 --- a/lib/routes/sobooks/tag.js +++ b/lib/routes/sobooks/tag.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '小说'; ctx.set('data', await utils(ctx, `books/tag/${id}`)); diff --git a/lib/routes/sogou/doodles.js b/lib/routes/sogou/doodles.js index 69b3b79e6fac91..a43dbc2876afc7 100644 --- a/lib/routes/sogou/doodles.js +++ b/lib/routes/sogou/doodles.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'http://help.sogou.com/logo/doodle_logo_list.html', diff --git a/lib/routes/sogou/router.js b/lib/routes/sogou/router.js index cdfe06a4ec52ce..a07db9d91fbd37 100644 --- a/lib/routes/sogou/router.js +++ b/lib/routes/sogou/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/doodles', './doodles'); router.get('/search/:keyword', './search'); }; diff --git a/lib/routes/sogou/search.js b/lib/routes/sogou/search.js index 175015fa47c222..16409db0c1550b 100644 --- a/lib/routes/sogou/search.js +++ b/lib/routes/sogou/search.js @@ -8,7 +8,7 @@ import { config } from '@/config'; const renderDescription = (description, images) => art(path.join(__dirname, './templates/description.art'), { description, images }); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const url = `https://www.sogou.com/web?query=${encodeURIComponent(keyword)}`; const key = `sogou-search:${url}`; diff --git a/lib/routes/sohu/mp.js b/lib/routes/sohu/mp.js index ea9ba517a72701..166c440926ec5d 100644 --- a/lib/routes/sohu/mp.js +++ b/lib/routes/sohu/mp.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import * as path from 'node:path'; import { art } from '@/utils/render'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const authorArticleAPI = `https://v2.sohu.com/author-page-api/author-articles/pc/${id}`; diff --git a/lib/routes/sohu/router.js b/lib/routes/sohu/router.js index 1b2793f318cc39..bebc1228666113 100644 --- a/lib/routes/sohu/router.js +++ b/lib/routes/sohu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/mp/:id', './mp'); }; diff --git a/lib/routes/solidot/main.js b/lib/routes/solidot/main.js index 489b978598ce68..56c2c9562017ec 100644 --- a/lib/routes/solidot/main.js +++ b/lib/routes/solidot/main.js @@ -9,7 +9,7 @@ import { load } from 'cheerio'; // html parser const get_article = require('./_article'); import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'www'; if (!isValidHost(type)) { throw new Error('Invalid type'); diff --git a/lib/routes/solidot/router.js b/lib/routes/solidot/router.js index 4a8bb1f2a93f51..227d20a1cb389a 100644 --- a/lib/routes/solidot/router.js +++ b/lib/routes/solidot/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?', './main'); }; diff --git a/lib/routes/sony/downloads.js b/lib/routes/sony/downloads.js index 484c26a51c8a95..8d05d9f96bba29 100644 --- a/lib/routes/sony/downloads.js +++ b/lib/routes/sony/downloads.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const host = 'https://www.sony.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { productType, productId } = ctx.req.param(); const url = `${host}/electronics/support/${productType}/${productId}/downloads`; const response = await got({ diff --git a/lib/routes/sony/router.js b/lib/routes/sony/router.js index 7d65623054e3b9..4a01f99dce0425 100644 --- a/lib/routes/sony/router.js +++ b/lib/routes/sony/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/downloads/:productType/:productId', './downloads'); }; diff --git a/lib/routes/soundofhope/channel.js b/lib/routes/soundofhope/channel.js index 83abc79fc575d6..c8033fc60741c8 100644 --- a/lib/routes/soundofhope/channel.js +++ b/lib/routes/soundofhope/channel.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const host = 'https://www.soundofhope.org'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const id = ctx.req.param('id'); const url = `${host}/${channel}/${id}`; diff --git a/lib/routes/soundofhope/router.js b/lib/routes/soundofhope/router.js index f86b87397503ad..2ab074810c0b34 100644 --- a/lib/routes/soundofhope/router.js +++ b/lib/routes/soundofhope/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:channel/:id', './channel'); }; diff --git a/lib/routes/sourceforge/index.js b/lib/routes/sourceforge/index.js index 676a095a706b21..b638b446423ada 100644 --- a/lib/routes/sourceforge/index.js +++ b/lib/routes/sourceforge/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const routeParams = ctx.req.param('routeParams'); const baseURL = 'https://sourceforge.net'; diff --git a/lib/routes/sourceforge/router.js b/lib/routes/sourceforge/router.js index 5a03f9f86ca321..1c2aa31e1addc2 100644 --- a/lib/routes/sourceforge/router.js +++ b/lib/routes/sourceforge/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:routeParams?', './index'); }; diff --git a/lib/routes/southcn/nfapp/column.js b/lib/routes/southcn/nfapp/column.js index e3bea43ec2b700..d7d3b5462f72c8 100644 --- a/lib/routes/southcn/nfapp/column.js +++ b/lib/routes/southcn/nfapp/column.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const columnId = ctx.req.param('column') ?? 38; const getColumnDetail = `https://api.nfapp.southcn.com/nanfang_if/getColumn?columnId=${columnId}`; diff --git a/lib/routes/southcn/nfapp/reporter.js b/lib/routes/southcn/nfapp/reporter.js index 90486ec1b0e023..ac7fdac5e5e038 100644 --- a/lib/routes/southcn/nfapp/reporter.js +++ b/lib/routes/southcn/nfapp/reporter.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; const { parseArticle } = require('./utils'); import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const reporterId = ctx.req.param('reporter'); const currentUrl = `https://api.nfapp.southcn.com/nanfang_if/reporter/list?reporterUuid=${reporterId}&pageSize=20&pageNo=1&origin=0`; diff --git a/lib/routes/southcn/router.js b/lib/routes/southcn/router.js index c80bc19d6eb467..c4a77f8fbcb2fe 100644 --- a/lib/routes/southcn/router.js +++ b/lib/routes/southcn/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/nfapp/column/:column?', './nfapp/column'); router.get('/nfapp/reporter/:reporter', './nfapp/reporter'); }; diff --git a/lib/routes/spotify/artist.js b/lib/routes/spotify/artist.js index 709c7d07028086..d9a4140556681e 100644 --- a/lib/routes/spotify/artist.js +++ b/lib/routes/spotify/artist.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const token = await utils.getPublicToken(); const id = ctx.req.param('id'); const meta = await got diff --git a/lib/routes/spotify/artists-top.js b/lib/routes/spotify/artists-top.js index 014121bde107a0..5480a50b03fb5c 100644 --- a/lib/routes/spotify/artists-top.js +++ b/lib/routes/spotify/artists-top.js @@ -1,7 +1,7 @@ const utils = require('./utils'); import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const token = await utils.getPrivateToken(); const itemsResponse = await got .get(`https://api.spotify.com/v1/me/top/artists`, { diff --git a/lib/routes/spotify/playlist.js b/lib/routes/spotify/playlist.js index d3a76d1259973a..a69e2e0c7cd318 100644 --- a/lib/routes/spotify/playlist.js +++ b/lib/routes/spotify/playlist.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const token = await utils.getPublicToken(); const id = ctx.req.param('id'); const meta = await got diff --git a/lib/routes/spotify/router.js b/lib/routes/spotify/router.js index 417a4dc84d0638..ecc2c3112f367d 100644 --- a/lib/routes/spotify/router.js +++ b/lib/routes/spotify/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/artist/:id', './artist'); router.get('/playlist/:id', './playlist'); router.get('/saved/:limit?', './saved'); diff --git a/lib/routes/spotify/saved.js b/lib/routes/spotify/saved.js index 06570120e284b0..fe2a8c0b13eb3f 100644 --- a/lib/routes/spotify/saved.js +++ b/lib/routes/spotify/saved.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const token = await utils.getPrivateToken(); const limit = ctx.req.param('limit'); diff --git a/lib/routes/spotify/show.js b/lib/routes/spotify/show.js index 9b9429dddc22e1..32a5fc2bb70f27 100644 --- a/lib/routes/spotify/show.js +++ b/lib/routes/spotify/show.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const token = await utils.getPublicToken(); const id = ctx.req.param('id'); diff --git a/lib/routes/spotify/tracks-top.js b/lib/routes/spotify/tracks-top.js index 86fe4507d137f2..74eeb224707a31 100644 --- a/lib/routes/spotify/tracks-top.js +++ b/lib/routes/spotify/tracks-top.js @@ -1,7 +1,7 @@ const utils = require('./utils'); import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const token = await utils.getPrivateToken(); const itemsResponse = await got .get(`https://api.spotify.com/v1/me/top/tracks`, { diff --git a/lib/routes/springer/journal.js b/lib/routes/springer/journal.js index ba5b4fd1f91145..d4d3ce9b2c9aea 100644 --- a/lib/routes/springer/journal.js +++ b/lib/routes/springer/journal.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://www.springer.com'; const journal = ctx.req.param('journal'); const jrnlUrl = `${host}/journal/${journal}`; diff --git a/lib/routes/springer/router.js b/lib/routes/springer/router.js index ee48a34e2aff1e..d88a348378e32e 100755 --- a/lib/routes/springer/router.js +++ b/lib/routes/springer/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/journal/:journal', './journal'); }; diff --git a/lib/routes/sputniknews/index.js b/lib/routes/sputniknews/index.js index 34cb509938c291..93e5624a4cafba 100644 --- a/lib/routes/sputniknews/index.js +++ b/lib/routes/sputniknews/index.js @@ -36,7 +36,7 @@ const languages = { portuguese: 'https://br.sputniknews.com', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'news'; const language = ctx.req.param('language') ?? 'english'; diff --git a/lib/routes/sputniknews/router.js b/lib/routes/sputniknews/router.js index 2e5224320f6e24..e569eccedcb225 100644 --- a/lib/routes/sputniknews/router.js +++ b/lib/routes/sputniknews/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?/:language?', './index'); }; diff --git a/lib/routes/sqmc/router.js b/lib/routes/sqmc/router.js index 13fa640533923e..1f8b3546d805b8 100644 --- a/lib/routes/sqmc/router.js +++ b/lib/routes/sqmc/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/www/:category?', './www'); }; diff --git a/lib/routes/sqmc/www.js b/lib/routes/sqmc/www.js index d57015dd757e21..a44a5b3b96da4f 100644 --- a/lib/routes/sqmc/www.js +++ b/lib/routes/sqmc/www.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') || '3157'; const rootUrl = 'https://www.sqmc.edu.cn'; diff --git a/lib/routes/sse/convert.js b/lib/routes/sse/convert.js index 0e75f93be795a9..0dd9c461f652dc 100644 --- a/lib/routes/sse/convert.js +++ b/lib/routes/sse/convert.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const query = ctx.req.param('query') ?? ''; // beginDate=2018-08-18&endDate=2019-08-18&companyCode=603283&title=股份 const pageUrl = 'https://bond.sse.com.cn/disclosure/announ/convertible/'; const host = 'https://www.sse.com.cn'; diff --git a/lib/routes/sse/disclosure.js b/lib/routes/sse/disclosure.js index 090f9af1461dc0..44bbb6295da8b9 100644 --- a/lib/routes/sse/disclosure.js +++ b/lib/routes/sse/disclosure.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const query = ctx.req.param('query') ?? ''; // beginDate=2018-08-18&endDate=2020-09-01&productId=600696 const queries = query.split('&').reduce((acc, cur) => { const [key, value] = cur.split('='); diff --git a/lib/routes/sse/inquire.js b/lib/routes/sse/inquire.js index 28d2ca9a2d1216..5c63dceab5dcc6 100644 --- a/lib/routes/sse/inquire.js +++ b/lib/routes/sse/inquire.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const refererUrl = 'https://www.sse.com.cn/disclosure/credibility/supervision/inquiries/'; const response = await got('https://query.sse.com.cn/commonSoaQuery.do', { searchParams: { diff --git a/lib/routes/sse/lawandrules.js b/lib/routes/sse/lawandrules.js index fffc79433419c5..fce7a7ac73033d 100644 --- a/lib/routes/sse/lawandrules.js +++ b/lib/routes/sse/lawandrules.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const slug = ctx.req.param('slug') ?? 'latest'; const rootUrl = 'https://www.sse.com.cn'; diff --git a/lib/routes/sse/renewal.js b/lib/routes/sse/renewal.js index 7e0777f6663304..7dae61605ad341 100644 --- a/lib/routes/sse/renewal.js +++ b/lib/routes/sse/renewal.js @@ -9,7 +9,7 @@ dayjs.extend(localizedFormat); const currStatusName = ['全部', '已受理', '已询问', '通过', '未通过', '提交注册', '补充审核', '注册结果', '中止', '终止']; -module.exports = async (ctx) => { +export default async (ctx) => { const pageUrl = 'https://kcb.sse.com.cn/renewal/'; const host = `https://kcb.sse.com.cn`; diff --git a/lib/routes/sse/router.js b/lib/routes/sse/router.js index 0bdcce64f12d4f..8d94a30fb1b108 100644 --- a/lib/routes/sse/router.js +++ b/lib/routes/sse/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/convert/:query?', './convert'); router.get('/disclosure/:query?', './disclosure'); router.get('/inquire', './inquire'); diff --git a/lib/routes/ssm/news.js b/lib/routes/ssm/news.js index 2e5e170677a4c2..610d5cec5dacc9 100644 --- a/lib/routes/ssm/news.js +++ b/lib/routes/ssm/news.js @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; 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`; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got.get(newsUrl); const $ = load(response.data); const list = $('body > div > div > ul > li'); diff --git a/lib/routes/ssm/router.js b/lib/routes/ssm/router.js index bd25c22a2fd87b..3c9877e17cb637 100644 --- a/lib/routes/ssm/router.js +++ b/lib/routes/ssm/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/sspai/activity.js b/lib/routes/sspai/activity.js index 76be341eea448c..a411e78501d048 100644 --- a/lib/routes/sspai/activity.js +++ b/lib/routes/sspai/activity.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const slug = ctx.req.param('slug'); const link = `https://sspai.com/u/${slug}/updates`; diff --git a/lib/routes/sspai/author.js b/lib/routes/sspai/author.js index 00a9d4d878043e..e57ad2bd0ca713 100644 --- a/lib/routes/sspai/author.js +++ b/lib/routes/sspai/author.js @@ -18,7 +18,7 @@ async function getUserId(slug) { return response.data.data.id; } -module.exports = async (ctx) => { +export default async (ctx) => { const id = /^\d+$/.test(ctx.req.param('id')) ? ctx.req.param('id') : await getUserId(ctx.req.param('id')); const api_url = `https://sspai.com/api/v1/articles?offset=0&limit=20&author_ids=${id}&include_total=false`; const resp = await got({ diff --git a/lib/routes/sspai/bookmarks.js b/lib/routes/sspai/bookmarks.js index d467d54c9c1945..d185bffb553e03 100644 --- a/lib/routes/sspai/bookmarks.js +++ b/lib/routes/sspai/bookmarks.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const slug = ctx.req.param('slug'); const link = `https://sspai.com/u/${slug}/bookmark_posts`; diff --git a/lib/routes/sspai/column.js b/lib/routes/sspai/column.js index 5f8ecb356cf74b..d3df7b3fcdd632 100644 --- a/lib/routes/sspai/column.js +++ b/lib/routes/sspai/column.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `https://sspai.com/column/${id}`; diff --git a/lib/routes/sspai/index.js b/lib/routes/sspai/index.js index aa3b9e01d448d2..8b1b7ad67e7b50 100644 --- a/lib/routes/sspai/index.js +++ b/lib/routes/sspai/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const api_url = 'https://sspai.com/api/v1/article/index/page/get?limit=10&offset=0&created_at=0'; const resp = await got({ method: 'get', diff --git a/lib/routes/sspai/matrix.js b/lib/routes/sspai/matrix.js index 742e8b4b038362..0c8a3750820a3a 100644 --- a/lib/routes/sspai/matrix.js +++ b/lib/routes/sspai/matrix.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const api_url = 'https://sspai.com/api/v1/articles?offset=0&limit=20&is_matrix=1&sort=matrix_at&include_total=false'; const resp = await got({ method: 'get', diff --git a/lib/routes/sspai/router.js b/lib/routes/sspai/router.js index 28634e43aec668..2b6b2e36ee407a 100644 --- a/lib/routes/sspai/router.js +++ b/lib/routes/sspai/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/activity/:slug', './activity'); router.get('/author/:id', './author'); router.get('/bookmarks/:slug', './bookmarks'); diff --git a/lib/routes/sspai/series-update.js b/lib/routes/sspai/series-update.js index 56b37eda83957a..3fabb9b1a79831 100644 --- a/lib/routes/sspai/series-update.js +++ b/lib/routes/sspai/series-update.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const seriesInfo = await got.get(`https://sspai.com/api/v1/series/info/get?id=${id}&view=second`); diff --git a/lib/routes/sspai/series.js b/lib/routes/sspai/series.js index abe6adfcf9215b..c2201716df6188 100644 --- a/lib/routes/sspai/series.js +++ b/lib/routes/sspai/series.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://sspai.com/api/v1/series/tag/all/get'); const products = response.data.data.reduce((acc, cate) => { diff --git a/lib/routes/sspai/shortcuts-gallery.js b/lib/routes/sspai/shortcuts-gallery.js index 128df48d40d251..641d23d6eb0a39 100644 --- a/lib/routes/sspai/shortcuts-gallery.js +++ b/lib/routes/sspai/shortcuts-gallery.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: { data: categories }, } = await got('https://shortcuts.sspai.com/api/v1/user/workflow/all/get'); diff --git a/lib/routes/sspai/tag.js b/lib/routes/sspai/tag.js index 8a15d71331fc47..fa4f5f59fc7c32 100644 --- a/lib/routes/sspai/tag.js +++ b/lib/routes/sspai/tag.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const keyword_encode = encodeURIComponent(decodeURIComponent(keyword)); const api_url = `https://sspai.com/api/v1/articles?offset=0&limit=50&has_tag=1&tag=${keyword_encode}&include_total=false`; diff --git a/lib/routes/sspai/topic.js b/lib/routes/sspai/topic.js index a724cb8c6e6190..e36a7f0ac36ef4 100644 --- a/lib/routes/sspai/topic.js +++ b/lib/routes/sspai/topic.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const api_url = `https://sspai.com/api/v1/articles?offset=0&limit=20&topic_id=${id}&sort=created_at&include_total=false`; const response = await got({ diff --git a/lib/routes/sspai/topics.js b/lib/routes/sspai/topics.js index 77e2cd571653b2..2fb2466e056092 100644 --- a/lib/routes/sspai/topics.js +++ b/lib/routes/sspai/topics.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const api_url = `https://sspai.com/api/v1/topics?offset=0&limit=20&include_total=false`; const resp = await got({ method: 'get', diff --git a/lib/routes/sspu/jwc.js b/lib/routes/sspu/jwc.js index f8ee94bb81eb01..475645b4bce892 100644 --- a/lib/routes/sspu/jwc.js +++ b/lib/routes/sspu/jwc.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const listId = ctx.req.param('listId'); const baseUrl = 'https://jwc.sspu.edu.cn'; diff --git a/lib/routes/sspu/pe.js b/lib/routes/sspu/pe.js index e0c1faa0842224..41563374780950 100644 --- a/lib/routes/sspu/pe.js +++ b/lib/routes/sspu/pe.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = '342' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/sspu/router.js b/lib/routes/sspu/router.js index 834483354843ab..d5480369908943 100644 --- a/lib/routes/sspu/router.js +++ b/lib/routes/sspu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/jwc/:listId', './jwc'); router.get('/pe/:id?', './pe'); }; diff --git a/lib/routes/startuplatte/index.js b/lib/routes/startuplatte/index.js index af9ddf4b53e733..29783c283ebada 100644 --- a/lib/routes/startuplatte/index.js +++ b/lib/routes/startuplatte/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://startuplatte.com'; diff --git a/lib/routes/startuplatte/router.js b/lib/routes/startuplatte/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/startuplatte/router.js +++ b/lib/routes/startuplatte/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/stbu/jsjxy.js b/lib/routes/stbu/jsjxy.js index 5aa1e945fd3026..0936ce2d3439e8 100644 --- a/lib/routes/stbu/jsjxy.js +++ b/lib/routes/stbu/jsjxy.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const gbk2utf8 = (s) => iconv.decode(s, 'gbk'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://jsjxy.stbu.edu.cn/news/'; const { data: response } = await got(baseUrl, { responseType: 'buffer', diff --git a/lib/routes/stbu/router.js b/lib/routes/stbu/router.js index 6c66cfe0ccc4a4..67db2e22dc8898 100644 --- a/lib/routes/stbu/router.js +++ b/lib/routes/stbu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/jsjxy', './jsjxy'); router.get('/xyxw', './xyxw'); }; diff --git a/lib/routes/stbu/xyxw.js b/lib/routes/stbu/xyxw.js index e51c2dc514257a..9a45d796f848b7 100644 --- a/lib/routes/stbu/xyxw.js +++ b/lib/routes/stbu/xyxw.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const gbk2utf8 = (s) => iconv.decode(s, 'gbk'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.stbu.edu.cn'; const requestUrl = `${baseUrl}/html/news/xueyuan/`; const { data: response } = await got(requestUrl, { diff --git a/lib/routes/stcn/index.js b/lib/routes/stcn/index.js index b903f0b84f5d03..c47f0828e5df0f 100644 --- a/lib/routes/stcn/index.js +++ b/lib/routes/stcn/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'yw'; const rootUrl = 'https://www.stcn.com'; diff --git a/lib/routes/stcn/router.js b/lib/routes/stcn/router.js index c34676efd9b9eb..28cef7111ec14a 100644 --- a/lib/routes/stcn/router.js +++ b/lib/routes/stcn/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id?', './index'); }; diff --git a/lib/routes/stdaily/digitalpaper.js b/lib/routes/stdaily/digitalpaper.js index 378db8f257a4e3..02daad34edf329 100644 --- a/lib/routes/stdaily/digitalpaper.js +++ b/lib/routes/stdaily/digitalpaper.js @@ -93,7 +93,7 @@ const getListArticles = async (list, cache) => { return items; }; -module.exports = async (ctx) => { +export default async (ctx) => { const date = new Date(); const dateStr = date.toLocaleDateString('zh-CN', { year: 'numeric', diff --git a/lib/routes/stdaily/router.js b/lib/routes/stdaily/router.js index 91ee3274c20fd7..b21ecddfabd52e 100644 --- a/lib/routes/stdaily/router.js +++ b/lib/routes/stdaily/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/digitalpaper', './digitalpaper'); }; diff --git a/lib/routes/stheadline/router.js b/lib/routes/stheadline/router.js index 70a96d44f85697..a9d9a43c63c748 100644 --- a/lib/routes/stheadline/router.js +++ b/lib/routes/stheadline/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/std/realtime/:category*', './std/realtime'); }; diff --git a/lib/routes/stheadline/std/realtime.js b/lib/routes/stheadline/std/realtime.js index 3c9fd78ef00b7e..88ac8f443f8410 100644 --- a/lib/routes/stheadline/std/realtime.js +++ b/lib/routes/stheadline/std/realtime.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'https://std.stheadline.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '即時' } = ctx.req.param(); const url = `${baseUrl}/realtime/${category}`; const { data: response } = await got(url); diff --git a/lib/routes/stockedge/daily-news.js b/lib/routes/stockedge/daily-news.js index aaac0c54944cc9..89a43bcc28f38b 100644 --- a/lib/routes/stockedge/daily-news.js +++ b/lib/routes/stockedge/daily-news.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getData, getList } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://web.stockedge.com/daily-updates?section=news'; const apiPath = 'https://api.stockedge.com/Api/DailyDashboardApi/GetLatestNewsItems'; const apiInfo = 'https://api.stockedge.com/Api/SecurityDashboardApi/GetSecurityOverview'; diff --git a/lib/routes/stockedge/router.js b/lib/routes/stockedge/router.js index 60026e0fab3f64..e2e08619408cae 100644 --- a/lib/routes/stockedge/router.js +++ b/lib/routes/stockedge/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/daily-updates/news', './daily-news'); }; diff --git a/lib/routes/storm/index.js b/lib/routes/storm/index.js index 8b2965d1d86bf5..c4f12355ee0faa 100644 --- a/lib/routes/storm/index.js +++ b/lib/routes/storm/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'articles'; const id = ctx.req.param('id') ?? ''; diff --git a/lib/routes/storm/router.js b/lib/routes/storm/router.js index 56b183011a03d5..053ae4cee08413 100644 --- a/lib/routes/storm/router.js +++ b/lib/routes/storm/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?/:id?', './index'); }; diff --git a/lib/routes/storyfm/episodes.js b/lib/routes/storyfm/episodes.js index 617fbc60acc4a6..62024429b139e6 100644 --- a/lib/routes/storyfm/episodes.js +++ b/lib/routes/storyfm/episodes.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://storyfm.cn'; const currentUrl = `${rootUrl}/episodes-list/`; diff --git a/lib/routes/storyfm/index.js b/lib/routes/storyfm/index.js index d99d6c6e8dfe40..29bab8b8c2890d 100644 --- a/lib/routes/storyfm/index.js +++ b/lib/routes/storyfm/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'http://storyfm.cn'; const response = await got(url); const $ = load(response.data); diff --git a/lib/routes/storyfm/router.js b/lib/routes/storyfm/router.js index b9a99dd47b4330..9c140dea92367f 100644 --- a/lib/routes/storyfm/router.js +++ b/lib/routes/storyfm/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/episodes', './episodes'); router.get('/index', './index'); }; diff --git a/lib/routes/stratechery/index.js b/lib/routes/stratechery/index.js index 61c4dcddc02126..0939b8880c0cca 100644 --- a/lib/routes/stratechery/index.js +++ b/lib/routes/stratechery/index.js @@ -1,6 +1,6 @@ import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://stratechery.com/'; ctx.set( diff --git a/lib/routes/stratechery/router.js b/lib/routes/stratechery/router.js index 41fdea4bd1bbfe..34ce5b45cfa1bb 100644 --- a/lib/routes/stratechery/router.js +++ b/lib/routes/stratechery/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', '.'); }; diff --git a/lib/routes/studygolang/go.js b/lib/routes/studygolang/go.js index a87becc00c77dd..5fa17cdbb56f80 100644 --- a/lib/routes/studygolang/go.js +++ b/lib/routes/studygolang/go.js @@ -1,5 +1,5 @@ const { FetchGoItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { ctx.set('data', await FetchGoItems(ctx)); }; diff --git a/lib/routes/studygolang/jobs.js b/lib/routes/studygolang/jobs.js index eac05c9c6ee1a2..8fb2f899546af5 100644 --- a/lib/routes/studygolang/jobs.js +++ b/lib/routes/studygolang/jobs.js @@ -1,5 +1,5 @@ const { FetchGoItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { ctx.set('data', await FetchGoItems(ctx, 'jobs')); }; diff --git a/lib/routes/studygolang/router.js b/lib/routes/studygolang/router.js index 24377bd03fc08a..c4943130b6430d 100644 --- a/lib/routes/studygolang/router.js +++ b/lib/routes/studygolang/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/go/:id?', './go'); router.get('/jobs', './jobs'); router.get('/weekly', './weekly'); diff --git a/lib/routes/studygolang/weekly.js b/lib/routes/studygolang/weekly.js index 4e5c71235b6873..a2760af03a6e4d 100644 --- a/lib/routes/studygolang/weekly.js +++ b/lib/routes/studygolang/weekly.js @@ -1,5 +1,5 @@ const { FetchGoItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { ctx.set('data', await FetchGoItems(ctx, 'weekly')); }; diff --git a/lib/routes/subhd/index.js b/lib/routes/subhd/index.js index 56d23ce817d194..dba7e2be8cbb71 100644 --- a/lib/routes/subhd/index.js +++ b/lib/routes/subhd/index.js @@ -18,7 +18,7 @@ const config = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'sub'; const category = ctx.req.param('category') ?? config[type].category; diff --git a/lib/routes/subhd/router.js b/lib/routes/subhd/router.js index c57b4b9b661e8a..8591b506201fae 100644 --- a/lib/routes/subhd/router.js +++ b/lib/routes/subhd/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?/:category?', './index'); }; diff --git a/lib/routes/supchina/index.js b/lib/routes/supchina/index.js index e96eaeb75402db..829117ecbcdf7f 100644 --- a/lib/routes/supchina/index.js +++ b/lib/routes/supchina/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://supchina.com'; const currentUrl = `${rootUrl}/feed/`; diff --git a/lib/routes/supchina/podcasts.js b/lib/routes/supchina/podcasts.js index cb3ef67c7d912a..52abf75ffeaa24 100644 --- a/lib/routes/supchina/podcasts.js +++ b/lib/routes/supchina/podcasts.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://supchina.com'; const currentUrl = `${rootUrl}/feed/podcast`; diff --git a/lib/routes/supchina/router.js b/lib/routes/supchina/router.js index 7f573146f161f0..87b28bab077206 100644 --- a/lib/routes/supchina/router.js +++ b/lib/routes/supchina/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/podcasts', './podcasts'); router.get('/', './index'); }; diff --git a/lib/routes/surfshark/blog.js b/lib/routes/surfshark/blog.js index 67627080fead96..9132415163f0a0 100644 --- a/lib/routes/surfshark/blog.js +++ b/lib/routes/surfshark/blog.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 15; diff --git a/lib/routes/surfshark/router.js b/lib/routes/surfshark/router.js index 1f1092baf74743..77c97e32a86b74 100644 --- a/lib/routes/surfshark/router.js +++ b/lib/routes/surfshark/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog/:category*', './blog'); }; diff --git a/lib/routes/sustech/bidding.js b/lib/routes/sustech/bidding.js index 5c19999a5671ae..6d4b102033bd9c 100644 --- a/lib/routes/sustech/bidding.js +++ b/lib/routes/sustech/bidding.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://biddingoffice.sustech.edu.cn'; const response = await got({ method: 'get', diff --git a/lib/routes/sustech/newshub-zh.js b/lib/routes/sustech/newshub-zh.js index 830f639829f1e0..d0d147792e7bb0 100644 --- a/lib/routes/sustech/newshub-zh.js +++ b/lib/routes/sustech/newshub-zh.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://newshub.sustech.edu.cn'; const link = `${baseUrl}/news`; const response = await got({ diff --git a/lib/routes/sustech/router.js b/lib/routes/sustech/router.js index 4348ab7bf40687..11514d5f5c6d65 100644 --- a/lib/routes/sustech/router.js +++ b/lib/routes/sustech/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/bidding', './bidding'); router.get('/newshub-zh', './newshub-zh'); router.get('/yjs', './yjs'); diff --git a/lib/routes/sustech/yjs.js b/lib/routes/sustech/yjs.js index ad3f2964f35335..522c668abc3a88 100644 --- a/lib/routes/sustech/yjs.js +++ b/lib/routes/sustech/yjs.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://gs.sustech.edu.cn'; const link = `${baseUrl}/#/common/index?current_id=99&id=99`; const response = await got(`${baseUrl}/api/www/v1/article/list`, { diff --git a/lib/routes/swissinfo/index.js b/lib/routes/swissinfo/index.js index a98ac5343e6388..2e488f3cf7ae22 100644 --- a/lib/routes/swissinfo/index.js +++ b/lib/routes/swissinfo/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? 'eng'; const category = ctx.req.param('category') ?? 'latest-news'; diff --git a/lib/routes/swissinfo/router.js b/lib/routes/swissinfo/router.js index d4d2fb71759dc6..58669f6d5a38d0 100644 --- a/lib/routes/swissinfo/router.js +++ b/lib/routes/swissinfo/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:language?/:category?', './index'); }; diff --git a/lib/routes/swjtu/jtys/yjs.js b/lib/routes/swjtu/jtys/yjs.js index 379cafe324d756..b26aaf0d593d79 100644 --- a/lib/routes/swjtu/jtys/yjs.js +++ b/lib/routes/swjtu/jtys/yjs.js @@ -31,7 +31,7 @@ const getItem = (item, cache) => { }); }; -module.exports = async (ctx) => { +export default async (ctx) => { const resp = await got({ method: 'get', url: url_addr, diff --git a/lib/routes/swjtu/jwc.js b/lib/routes/swjtu/jwc.js index 754209431c9d2c..b6fab24688b8aa 100644 --- a/lib/routes/swjtu/jwc.js +++ b/lib/routes/swjtu/jwc.js @@ -43,7 +43,7 @@ const getItem = (item, cache) => { }); }; -module.exports = async (ctx) => { +export default async (ctx) => { const resp = await got({ method: 'get', url: pageURL, diff --git a/lib/routes/swjtu/jyzpxx.js b/lib/routes/swjtu/jyzpxx.js index 133ca5ab4ca8a6..2538444eb5a59b 100644 --- a/lib/routes/swjtu/jyzpxx.js +++ b/lib/routes/swjtu/jyzpxx.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; const rootURL = 'https://jiuye.swjtu.edu.cn/career'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = Math.min(ctx.req.query('limit') ?? 10, 50); const resp = await got({ method: 'post', diff --git a/lib/routes/swjtu/router.js b/lib/routes/swjtu/router.js index e077d39e8524e5..87f3690c598c7f 100644 --- a/lib/routes/swjtu/router.js +++ b/lib/routes/swjtu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/jtys/yjs', './jtys/yjs'); router.get('/jyzpxx', './jyzpxx'); router.get('/jwc', './jwc'); diff --git a/lib/routes/swjtu/xg.js b/lib/routes/swjtu/xg.js index d56467de16f121..3110124998b8a0 100644 --- a/lib/routes/swjtu/xg.js +++ b/lib/routes/swjtu/xg.js @@ -48,7 +48,7 @@ const getItem = (item, cache) => { }); }; -module.exports = async (ctx) => { +export default async (ctx) => { const code = ctx.req.param('code') ?? 'tzgg'; const pageURL = listURL[code]; diff --git a/lib/routes/swpu/bgw.js b/lib/routes/swpu/bgw.js index 8ea6672fa3e844..cb4ad56aba63dc 100644 --- a/lib/routes/swpu/bgw.js +++ b/lib/routes/swpu/bgw.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://www.swpu.edu.cn/bgw2/${ctx.req.param('code')}.htm`; const res = await got.get(url); diff --git a/lib/routes/swpu/cjxy.js b/lib/routes/swpu/cjxy.js index 389a24728444fb..649966d3da7bc7 100644 --- a/lib/routes/swpu/cjxy.js +++ b/lib/routes/swpu/cjxy.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://www.swpu.edu.cn/nccjxy/xydt/${ctx.req.param('code')}.htm`; const res = await got(url); diff --git a/lib/routes/swpu/dean.js b/lib/routes/swpu/dean.js index 55768e37a1e7aa..201bbb39cdafa5 100644 --- a/lib/routes/swpu/dean.js +++ b/lib/routes/swpu/dean.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://www.swpu.edu.cn/dean/${ctx.req.param('code')}.htm`; const res = await got.get(url); diff --git a/lib/routes/swpu/dxy.js b/lib/routes/swpu/dxy.js index f0fde8fa0f80cc..92df9d0631c7ba 100644 --- a/lib/routes/swpu/dxy.js +++ b/lib/routes/swpu/dxy.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { // 移除 urltype=tree.TreeTempUrl 虽然也能顺利访问页面, // 但标题会缺失,而且在其他地方定位提取标题也比较麻烦。 const url = `https://www.swpu.edu.cn/dxy/list1.jsp?urltype=tree.TreeTempUrl&wbtreeid=${ctx.req.param('code')}`; diff --git a/lib/routes/swpu/is.js b/lib/routes/swpu/is.js index ce9f8e3d88a05c..2707d43703d56f 100644 --- a/lib/routes/swpu/is.js +++ b/lib/routes/swpu/is.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://www.swpu.edu.cn/is/xydt/${ctx.req.param('code')}.htm`; const res = await got(url); diff --git a/lib/routes/swpu/router.js b/lib/routes/swpu/router.js index f62c1c3869e8f3..ecb8f062fad917 100644 --- a/lib/routes/swpu/router.js +++ b/lib/routes/swpu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/bgw/:code', './bgw'); router.get('/cjxy/:code', './cjxy'); router.get('/dean/:code', './dean'); diff --git a/lib/routes/swpu/scs.js b/lib/routes/swpu/scs.js index 5eb509774ac6ee..4f054a6049cbdc 100644 --- a/lib/routes/swpu/scs.js +++ b/lib/routes/swpu/scs.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://www.swpu.edu.cn/scs/index/${ctx.req.param('code')}.htm`; const res = await got.get(url); diff --git a/lib/routes/syosetu/chapter.js b/lib/routes/syosetu/chapter.js index 8dfbb13f861e1b..6ef0cc09f3c78c 100644 --- a/lib/routes/syosetu/chapter.js +++ b/lib/routes/syosetu/chapter.js @@ -8,7 +8,7 @@ const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); cookieJar.setCookieSync('over18=yes', 'https://novel18.syosetu.com/'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = Number.parseInt(ctx.req.query('limit')) || 5; const link = `https://ncode.syosetu.com/${id}`; diff --git a/lib/routes/syosetu/router.js b/lib/routes/syosetu/router.js index 898eab712bdc63..da9b4fd23547ee 100644 --- a/lib/routes/syosetu/router.js +++ b/lib/routes/syosetu/router.js @@ -1 +1 @@ -module.exports = (router) => router.get('/chapter/:id', './chapter.js'); +export default (router) => router.get('/chapter/:id', './chapter.js'); diff --git a/lib/routes/sysu/cse.js b/lib/routes/sysu/cse.js index 9a562ee29cd91e..00b129d0c73f11 100644 --- a/lib/routes/sysu/cse.js +++ b/lib/routes/sysu/cse.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'http://cse.sysu.edu.cn/', diff --git a/lib/routes/sysu/router.js b/lib/routes/sysu/router.js index f064e40f052257..bcf348ae662177 100644 --- a/lib/routes/sysu/router.js +++ b/lib/routes/sysu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/cse', './cse'); router.get('/ygafz/:type?', './ygafz'); }; diff --git a/lib/routes/sysu/ygafz.js b/lib/routes/sysu/ygafz.js index 0f99c034dda360..00a28cb9a7fa0e 100644 --- a/lib/routes/sysu/ygafz.js +++ b/lib/routes/sysu/ygafz.js @@ -6,7 +6,7 @@ import logger from '@/utils/logger'; const { CookieJar } = require('tough-cookie'); import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'notice' } = ctx.req.param(); const baseUrl = 'https://ygafz.sysu.edu.cn'; const url = `${baseUrl}/${type}`; diff --git a/lib/routes/szse/inquire.js b/lib/routes/szse/inquire.js index fb45c47e30f5ed..fdaf97e7339418 100644 --- a/lib/routes/szse/inquire.js +++ b/lib/routes/szse/inquire.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? '0'; const select = ctx.req.param('select') ?? '全部函件类别'; const keyword = ctx.req.param('keyword') ?? ''; diff --git a/lib/routes/szse/notice.js b/lib/routes/szse/notice.js index 230781fbb60344..702f7c71abecc8 100644 --- a/lib/routes/szse/notice.js +++ b/lib/routes/szse/notice.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const url = require('url'); const host = 'http://www.szse.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'http://www.szse.cn/disclosure/notice/company/index.html'; const response = await got.get(link, { Referer: host, diff --git a/lib/routes/szse/projectdynamic.js b/lib/routes/szse/projectdynamic.js index 3a561238be7ea3..22edb102a79700 100644 --- a/lib/routes/szse/projectdynamic.js +++ b/lib/routes/szse/projectdynamic.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const typeMap = { 1: 'IPO', 2: '再融资', diff --git a/lib/routes/szse/router.js b/lib/routes/szse/router.js index b59718fcf79bdb..1569f521b84dbe 100644 --- a/lib/routes/szse/router.js +++ b/lib/routes/szse/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/inquire/:category?/:select?/:keyword?', './inquire'); router.get('/notice', './notice'); router.get('/projectdynamic/:type?/:stage?/:status?', './projectdynamic'); diff --git a/lib/routes/szse/rule.js b/lib/routes/szse/rule.js index 97cdfa9d0a7916..e2b4ab75798e48 100644 --- a/lib/routes/szse/rule.js +++ b/lib/routes/szse/rule.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://www.szse.cn'; const currentUrl = `${rootUrl}/api/search/content`; diff --git a/lib/routes/szu/router.js b/lib/routes/szu/router.js index 9a96550888ab84..9127a78656dae1 100644 --- a/lib/routes/szu/router.js +++ b/lib/routes/szu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/yz/:type?', './yz'); }; diff --git a/lib/routes/szu/yz/index.js b/lib/routes/szu/yz/index.js index b26efb4c9bb4a4..16f4540c1de301 100644 --- a/lib/routes/szu/yz/index.js +++ b/lib/routes/szu/yz/index.js @@ -8,7 +8,7 @@ const map = new Map([ [2, { title: '博士招生 - 深圳大学研究生招生网' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { let type = Number.parseInt(ctx.req.param('type')); const struct = { 1: { diff --git a/lib/routes/tableau/router.js b/lib/routes/tableau/router.js index 1c708b0eebba52..3076fe3f4211d1 100644 --- a/lib/routes/tableau/router.js +++ b/lib/routes/tableau/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/viz-of-the-day', './viz-of-the-day'); }; diff --git a/lib/routes/tableau/viz-of-the-day.js b/lib/routes/tableau/viz-of-the-day.js index 03b671d3809aa5..8dfa559d073607 100644 --- a/lib/routes/tableau/viz-of-the-day.js +++ b/lib/routes/tableau/viz-of-the-day.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; // import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { // Your logic here const rootUrl = 'https://public.tableau.com/api/gallery?page=0&count=20&galleryType=viz-of-the-day'; const { data: response } = await got(rootUrl); diff --git a/lib/routes/taiwannews/hot.js b/lib/routes/taiwannews/hot.js index 394a6f6550df42..14dd0bc2c1d72e 100644 --- a/lib/routes/taiwannews/hot.js +++ b/lib/routes/taiwannews/hot.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.taiwannews.com.tw'; const { lang = 'en' } = ctx.req.param(); const url = `${baseUrl}/${lang}/index`; diff --git a/lib/routes/taiwannews/router.js b/lib/routes/taiwannews/router.js index f6dae6753a7145..f382bd3df781ca 100644 --- a/lib/routes/taiwannews/router.js +++ b/lib/routes/taiwannews/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/hot/:lang?', './hot'); }; diff --git a/lib/routes/tangshufang/index.js b/lib/routes/tangshufang/index.js index 7723944cbdaba0..92368c7b217477 100644 --- a/lib/routes/tangshufang/index.js +++ b/lib/routes/tangshufang/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10; diff --git a/lib/routes/tangshufang/router.js b/lib/routes/tangshufang/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/tangshufang/router.js +++ b/lib/routes/tangshufang/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/taobao/router.js b/lib/routes/taobao/router.js index df1ef3e0dd900b..47537d54e205e3 100644 --- a/lib/routes/taobao/router.js +++ b/lib/routes/taobao/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/zhongchou/:type?', './zhongchou'); }; diff --git a/lib/routes/taobao/zhongchou.js b/lib/routes/taobao/zhongchou.js index f6898bcbec3800..72bc366cafc128 100644 --- a/lib/routes/taobao/zhongchou.js +++ b/lib/routes/taobao/zhongchou.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'all' } = ctx.req.param(); const map = { all: '', diff --git a/lib/routes/taoguba/blog.js b/lib/routes/taoguba/blog.js index c0cfc1b8f78639..43b4690e17aa92 100644 --- a/lib/routes/taoguba/blog.js +++ b/lib/routes/taoguba/blog.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://www.taoguba.com.cn'; diff --git a/lib/routes/taoguba/index.js b/lib/routes/taoguba/index.js index ca5aa6f212d583..67f8349c17367a 100644 --- a/lib/routes/taoguba/index.js +++ b/lib/routes/taoguba/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'zongban'; const rootUrl = 'https://www.taoguba.com.cn'; diff --git a/lib/routes/taoguba/router.js b/lib/routes/taoguba/router.js index b53bd5302d1467..79b04389a7fd70 100644 --- a/lib/routes/taoguba/router.js +++ b/lib/routes/taoguba/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:id', './blog'); router.get('/index', './index'); router.get('/user/:id', './blog'); diff --git a/lib/routes/taptap/changelog.js b/lib/routes/taptap/changelog.js index b54c758da36884..f3167485fd6920 100644 --- a/lib/routes/taptap/changelog.js +++ b/lib/routes/taptap/changelog.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { getRootUrl, appDetail, X_UA } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const is_intl = ctx.req.url.indexOf('/intl/') === 0; const id = ctx.req.param('id'); const lang = ctx.req.param('lang') ?? (is_intl ? 'en_US' : 'zh_CN'); diff --git a/lib/routes/taptap/review.js b/lib/routes/taptap/review.js index 037cbd3c2d7329..6f174da1bbc3bc 100644 --- a/lib/routes/taptap/review.js +++ b/lib/routes/taptap/review.js @@ -103,7 +103,7 @@ const fetchIntlItems = async (params) => { }); }; -module.exports = async (ctx) => { +export default async (ctx) => { const is_intl = ctx.req.url.indexOf('/intl/') === 0; const id = ctx.req.param('id'); const order = ctx.req.param('order') ?? 'default'; diff --git a/lib/routes/taptap/router.js b/lib/routes/taptap/router.js index eb642b81ed833c..e9573ad18edf26 100644 --- a/lib/routes/taptap/router.js +++ b/lib/routes/taptap/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/changelog/:id/:lang?', './changelog'); router.get('/review/:id/:order?/:lang?', './review'); router.get('/topic/:id/:type?/:sort?/:lang?', './topic'); diff --git a/lib/routes/taptap/topic.js b/lib/routes/taptap/topic.js index 1f6cbb064b565c..743a474e903132 100644 --- a/lib/routes/taptap/topic.js +++ b/lib/routes/taptap/topic.js @@ -22,7 +22,7 @@ const typeMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const lang = ctx.req.param('lang') ?? 'zh_CN'; const appId = ctx.req.param('id'); const appData = await appDetail(appId, lang); diff --git a/lib/routes/tass/news.js b/lib/routes/tass/news.js index 25434f5a619416..22d62f19e4760f 100644 --- a/lib/routes/tass/news.js +++ b/lib/routes/tass/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'politics' } = ctx.req.param(); const { data: categoryPage, url: link } = await got(`https://tass.com/${category}`); diff --git a/lib/routes/tass/router.js b/lib/routes/tass/router.js index c5d037377b264a..009a87867aaf07 100644 --- a/lib/routes/tass/router.js +++ b/lib/routes/tass/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './news'); }; diff --git a/lib/routes/techcrunch/news.js b/lib/routes/techcrunch/news.js index d8af4b1bd8cf34..ca0697bb0489bf 100644 --- a/lib/routes/techcrunch/news.js +++ b/lib/routes/techcrunch/news.js @@ -3,7 +3,7 @@ import parser from '@/utils/rss-parser'; import got from '@/utils/got'; import { load } from 'cheerio'; const host = 'https://techcrunch.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const rssUrl = `${host}/feed/`; const feed = await parser.parseURL(rssUrl); const items = await Promise.all( diff --git a/lib/routes/techcrunch/router.js b/lib/routes/techcrunch/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/techcrunch/router.js +++ b/lib/routes/techcrunch/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/techflowpost/express.js b/lib/routes/techflowpost/express.js index fbf18a80253640..76efb371526750 100644 --- a/lib/routes/techflowpost/express.js +++ b/lib/routes/techflowpost/express.js @@ -3,7 +3,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { unescapeAll } from 'markdown-it/lib/common/utils.mjs'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.techflowpost.com'; const apiRootUrl = 'https://data.techflowpost.com'; const currentUrl = `${rootUrl}/express`; diff --git a/lib/routes/techflowpost/index.js b/lib/routes/techflowpost/index.js index 7cdf32023b6863..b233173d9554f1 100644 --- a/lib/routes/techflowpost/index.js +++ b/lib/routes/techflowpost/index.js @@ -3,7 +3,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { unescapeAll } from 'markdown-it/lib/common/utils.mjs'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.techflowpost.com'; const apiRootUrl = 'https://data.techflowpost.com'; const apiUrl = `${apiRootUrl}/api/pc/home/more?pageIndex=0&pageSize=${ctx.req.query('limit') ?? 50}`; diff --git a/lib/routes/techflowpost/router.js b/lib/routes/techflowpost/router.js index ac9baeb924c54a..f4dd69e12072ef 100644 --- a/lib/routes/techflowpost/router.js +++ b/lib/routes/techflowpost/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/express', './express'); router.get('/newsflash', './express'); router.get('/', './index'); diff --git a/lib/routes/techpowerup/index.js b/lib/routes/techpowerup/index.js index a8833a2a6b8fc9..f95fe5bf9fea4c 100644 --- a/lib/routes/techpowerup/index.js +++ b/lib/routes/techpowerup/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, headers, fixImages, parseReviews } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got(baseUrl, { headers, }); diff --git a/lib/routes/techpowerup/review.js b/lib/routes/techpowerup/review.js index 8353715098517e..f85661a3a36a44 100644 --- a/lib/routes/techpowerup/review.js +++ b/lib/routes/techpowerup/review.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, headers, fixImages, parseReviews } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const url = new URL(`${baseUrl}/review/${keyword ? 'search/' : ''}`); diff --git a/lib/routes/techpowerup/router.js b/lib/routes/techpowerup/router.js index fe479108f466cb..d5f8ecaba696c6 100644 --- a/lib/routes/techpowerup/router.js +++ b/lib/routes/techpowerup/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/review/:keyword?', './review'); }; diff --git a/lib/routes/telecompaper/news.js b/lib/routes/telecompaper/news.js index fd17a19f0099d7..9fc93962f7c587 100644 --- a/lib/routes/telecompaper/news.js +++ b/lib/routes/telecompaper/news.js @@ -5,7 +5,7 @@ const tough = require('tough-cookie'); // eslint-disable-next-line n/no-extraneous-require const FormData = require('form-data'); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = `https://www.telecompaper.com/${ctx.req.param('caty') === 'industry-resources' ? ctx.req.param('caty') : 'international/news/' + ctx.req.param('caty')}`; const year = ctx.req.param('year') ?? 'all'; const country = ctx.req.param('country') ? ctx.req.param('country').split('-').join(' ') : 'all'; diff --git a/lib/routes/telecompaper/router.js b/lib/routes/telecompaper/router.js index a04ce149f06eba..0f40a16244863d 100644 --- a/lib/routes/telecompaper/router.js +++ b/lib/routes/telecompaper/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:caty/:year?/:country?/:type?', './news'); router.get('/search/:keyword?/:company?/:sort?/:period?', './search'); }; diff --git a/lib/routes/telecompaper/search.js b/lib/routes/telecompaper/search.js index ac4935304979f5..d8fb9beb647871 100644 --- a/lib/routes/telecompaper/search.js +++ b/lib/routes/telecompaper/search.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword') || ''; const company = ctx.req.param('company') || ''; const sort = ctx.req.param('sort') || '2'; diff --git a/lib/routes/telegram/blog.js b/lib/routes/telegram/blog.js index 9cc949a708b729..266ae5c59a5608 100644 --- a/lib/routes/telegram/blog.js +++ b/lib/routes/telegram/blog.js @@ -3,7 +3,7 @@ const cherrio = require('cheerio'); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://telegram.org/blog'; const res = await got(link); diff --git a/lib/routes/telegram/channel.js b/lib/routes/telegram/channel.js index eb54d36e50b985..6ef68a6ab01984 100644 --- a/lib/routes/telegram/channel.js +++ b/lib/routes/telegram/channel.js @@ -50,7 +50,7 @@ const mediaTagDict = { PARTIALLY_UNSUPPORTED: ['', ''], }; -module.exports = async (ctx) => { +export default async (ctx) => { const useWeb = ctx.req.param('routeParams') || !(config.telegram.session && config.feature.mediaProxyKey); if (!useWeb) { return require('./tglib/channel')(ctx); diff --git a/lib/routes/telegram/router.js b/lib/routes/telegram/router.js index f8904701cd56c5..ffe122a1feb545 100644 --- a/lib/routes/telegram/router.js +++ b/lib/routes/telegram/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/channel/:username/:routeParams?', './channel'); router.get('/stickerpack/:name', './stickerpack'); router.get('/blog', './blog'); diff --git a/lib/routes/telegram/stickerpack.js b/lib/routes/telegram/stickerpack.js index 8671324d2f25be..a06a61275836c3 100644 --- a/lib/routes/telegram/stickerpack.js +++ b/lib/routes/telegram/stickerpack.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.telegram || !config.telegram.token) { throw new Error('Telegram Sticker Pack RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/telegram/tglib/channel.js b/lib/routes/telegram/tglib/channel.js index 066a82a2c8a72c..5dae0456583daa 100644 --- a/lib/routes/telegram/tglib/channel.js +++ b/lib/routes/telegram/tglib/channel.js @@ -115,7 +115,7 @@ async function getMedia(ctx) { return ctx.res.end(); } -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.telegram.session) { return []; } diff --git a/lib/routes/tencent/news/author.js b/lib/routes/tencent/news/author.js index f4625185365075..444880c9eee1e7 100644 --- a/lib/routes/tencent/news/author.js +++ b/lib/routes/tencent/news/author.js @@ -6,7 +6,7 @@ import { config } from '@/config'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const mid = ctx.req.param('mid'); const homePageInfoUrl = `https://i.news.qq.com/i/getUserHomepageInfo?chlid=${mid}`; const userInfo = await cache.tryGet(homePageInfoUrl, async () => (await got(homePageInfoUrl)).data.userinfo); diff --git a/lib/routes/tencent/news/coronavirus/data.js b/lib/routes/tencent/news/coronavirus/data.js index a9ecb2f39298bd..45407731b66677 100644 --- a/lib/routes/tencent/news/coronavirus/data.js +++ b/lib/routes/tencent/news/coronavirus/data.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const province = ctx.req.param('province') || ''; const city = ctx.req.param('city') || ''; diff --git a/lib/routes/tencent/news/coronavirus/total.js b/lib/routes/tencent/news/coronavirus/total.js index 07d1ff3e36542d..95a4b56db3ce4f 100644 --- a/lib/routes/tencent/news/coronavirus/total.js +++ b/lib/routes/tencent/news/coronavirus/total.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const title = '腾讯新闻 - 新型冠状病毒肺炎疫情实时追踪'; const link = 'https://news.qq.com/zt2020/page/feiyan.htm#/'; const item = []; diff --git a/lib/routes/tencent/pvp/newsindex.js b/lib/routes/tencent/pvp/newsindex.js index 6ba7c6b6b55f30..59acf790c7bb53 100644 --- a/lib/routes/tencent/pvp/newsindex.js +++ b/lib/routes/tencent/pvp/newsindex.js @@ -36,7 +36,7 @@ const getPage = async (id, typeName) => { ); }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const OutName = map.get(type).name; const OutId = map.get(type).channelid; diff --git a/lib/routes/tencent/qq/sdk/changelog.js b/lib/routes/tencent/qq/sdk/changelog.js index b6d532180e5c0f..9ce6634619819e 100644 --- a/lib/routes/tencent/qq/sdk/changelog.js +++ b/lib/routes/tencent/qq/sdk/changelog.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const platform = ctx.req.param('platform'); let title = ''; diff --git a/lib/routes/tencent/router.js b/lib/routes/tencent/router.js index 87974f7639f13a..389e576b63f9c9 100644 --- a/lib/routes/tencent/router.js +++ b/lib/routes/tencent/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/author/:mid', './news/author'); router.get('/news/coronavirus/data/:province?/:city?', './news/coronavirus/data'); router.get('/news/coronavirus/total', './news/coronavirus/total'); diff --git a/lib/routes/tesla/cx.js b/lib/routes/tesla/cx.js index e18b3986757ed3..8c43f865f1823b 100644 --- a/lib/routes/tesla/cx.js +++ b/lib/routes/tesla/cx.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category, city } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/tesla/price/index.js b/lib/routes/tesla/price/index.js index fad4a460689784..0770b34a0af3ad 100644 --- a/lib/routes/tesla/price/index.js +++ b/lib/routes/tesla/price/index.js @@ -1,6 +1,6 @@ const { getTeslaPrice } = require('./get-price'); -module.exports = async (ctx) => { +export default async (ctx) => { const cars = [ { name: 'Model 3', diff --git a/lib/routes/tesla/router.js b/lib/routes/tesla/router.js index 867bab157b3e78..bd412c1fc14413 100644 --- a/lib/routes/tesla/router.js +++ b/lib/routes/tesla/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/cx/:category?/:city?', './cx'); router.get('/price', './price'); }; diff --git a/lib/routes/test/index.js b/lib/routes/test/index.js index 74ae2124585361..e5ed7801797dad 100644 --- a/lib/routes/test/index.js +++ b/lib/routes/test/index.js @@ -5,7 +5,7 @@ import cache from '@/utils/cache'; let cacheIndex = 0; -module.exports = async (ctx) => { +export default async (ctx) => { if (ctx.req.param('id') === 'error') { throw new Error('Error test'); } diff --git a/lib/routes/test/router.js b/lib/routes/test/router.js index de87b52670c7db..c79f907ed7d0b5 100644 --- a/lib/routes/test/router.js +++ b/lib/routes/test/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id', './index'); }; diff --git a/lib/routes/tfc-taiwan/index.js b/lib/routes/tfc-taiwan/index.js index c89c579a93bd0a..87aec2d2e66017 100644 --- a/lib/routes/tfc-taiwan/index.js +++ b/lib/routes/tfc-taiwan/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { baseUrl, parseList, parseItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const requestPath = ctx.req.path; const isTopic = requestPath.startsWith('/topic/'); let link = baseUrl; diff --git a/lib/routes/tfc-taiwan/router.js b/lib/routes/tfc-taiwan/router.js index 448b5302a05b23..1599d971e5ae5d 100644 --- a/lib/routes/tfc-taiwan/router.js +++ b/lib/routes/tfc-taiwan/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/category/:id+', './index'); router.get('/info', './index'); diff --git a/lib/routes/theatlantic/news.js b/lib/routes/theatlantic/news.js index 12976d99b67582..bac5ce16079b74 100644 --- a/lib/routes/theatlantic/news.js +++ b/lib/routes/theatlantic/news.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const { getArticleDetails } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://www.theatlantic.com'; const category = ctx.req.param('category'); const url = `${host}/${category}/`; diff --git a/lib/routes/theatlantic/router.js b/lib/routes/theatlantic/router.js index 800f89214197bc..3eb67b2b4e1295 100644 --- a/lib/routes/theatlantic/router.js +++ b/lib/routes/theatlantic/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category', './news'); }; diff --git a/lib/routes/theblockbeats/index.js b/lib/routes/theblockbeats/index.js index de7709a5007932..4055513c0e5a4c 100644 --- a/lib/routes/theblockbeats/index.js +++ b/lib/routes/theblockbeats/index.js @@ -20,7 +20,7 @@ const channelMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const { channel = 'newsflash' } = ctx.req.param(); const { data: response } = await got(channelMap[channel].api); diff --git a/lib/routes/theblockbeats/router.js b/lib/routes/theblockbeats/router.js index c5ea6ab21b96c9..0b562c0f7741c0 100644 --- a/lib/routes/theblockbeats/router.js +++ b/lib/routes/theblockbeats/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:channel?', './index'); }; diff --git a/lib/routes/thecatcity/index.js b/lib/routes/thecatcity/index.js index 0f837882270eda..ef0582f1eeeb1f 100644 --- a/lib/routes/thecatcity/index.js +++ b/lib/routes/thecatcity/index.js @@ -5,7 +5,7 @@ const { termsMap } = require('./terms-map'); const baseUrl = 'https://thecatcity.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const term = ctx.req.param('term'); const { data } = await got(`${baseUrl}/node_api/v1/articles/posts`, { searchParams: { diff --git a/lib/routes/thecatcity/router.js b/lib/routes/thecatcity/router.js index f784587525d722..7dadc4b850c4b1 100644 --- a/lib/routes/thecatcity/router.js +++ b/lib/routes/thecatcity/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:term?', './index'); }; diff --git a/lib/routes/thecover/channel.js b/lib/routes/thecover/channel.js index a0975eccc0dac3..87caf6c0f99512 100644 --- a/lib/routes/thecover/channel.js +++ b/lib/routes/thecover/channel.js @@ -23,7 +23,7 @@ const nodes = { 17: '封面号', }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '3892'; const targetUrl = rootUrl.concat(`/channel_${id}`); const resp = await got({ diff --git a/lib/routes/thecover/router.js b/lib/routes/thecover/router.js index 59ecbc2c6d8bb3..f067105bdbf5d1 100644 --- a/lib/routes/thecover/router.js +++ b/lib/routes/thecover/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/channel/:id?', './channel'); }; diff --git a/lib/routes/thehindu/router.js b/lib/routes/thehindu/router.js index f4261ff357c791..b90fa69a329abc 100644 --- a/lib/routes/thehindu/router.js +++ b/lib/routes/thehindu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/topic/:topic', './topic'); }; diff --git a/lib/routes/thehindu/topic.js b/lib/routes/thehindu/topic.js index fc5ecfb22657a6..913a322aadf67d 100644 --- a/lib/routes/thehindu/topic.js +++ b/lib/routes/thehindu/topic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.thehindu.com'; const topic = ctx.req.param('topic'); const link = `${baseUrl}/topic/${topic}/`; diff --git a/lib/routes/theinitium/full.js b/lib/routes/theinitium/full.js index 03e4d9b7295273..a762f7338eab00 100644 --- a/lib/routes/theinitium/full.js +++ b/lib/routes/theinitium/full.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const TOKEN = 'Basic YW5vbnltb3VzOkdpQ2VMRWp4bnFCY1ZwbnA2Y0xzVXZKaWV2dlJRY0FYTHY='; -module.exports = async (ctx) => { +export default async (ctx) => { // model是channel/tag/etc.,而type是latest/feature/quest-academy这些一级栏目/标签/作者名的slug名。如果是追踪的话,那就是model是follow,type是articles。 const model = ctx.req.param('model') ?? 'channel'; const type = ctx.req.param('type') ?? 'latest'; diff --git a/lib/routes/theinitium/router.js b/lib/routes/theinitium/router.js index 24f5f12fcbf8cc..82f55a4a71aa33 100644 --- a/lib/routes/theinitium/router.js +++ b/lib/routes/theinitium/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:model?/:type?/:language?', './full'); }; diff --git a/lib/routes/themoviedb/collection.js b/lib/routes/themoviedb/collection.js index 367c902df8b0cf..cdbab792795bca 100644 --- a/lib/routes/themoviedb/collection.js +++ b/lib/routes/themoviedb/collection.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const apiKey = require('./api-key'); const { handleMovieItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, lang } = ctx.req.param(); const { data } = await got(`https://api.themoviedb.org/3/collection/${id}`, { searchParams: { diff --git a/lib/routes/themoviedb/episodes.js b/lib/routes/themoviedb/episodes.js index bb204c316877fd..6123076e5263f4 100644 --- a/lib/routes/themoviedb/episodes.js +++ b/lib/routes/themoviedb/episodes.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const apiKey = require('./api-key'); const { handleDescription } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, seasonNumber, lang } = ctx.req.param(); const searchParams = { language: lang, diff --git a/lib/routes/themoviedb/router.js b/lib/routes/themoviedb/router.js index daf0dd0c7adbab..dc5151e5f547bf 100644 --- a/lib/routes/themoviedb/router.js +++ b/lib/routes/themoviedb/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/collection/:id/:lang?', './collection'); router.get('/trending/:mediaType/:timeWindow/:lang?', './trending'); router.get('/tv/:id/seasons/:lang?', './seasons'); diff --git a/lib/routes/themoviedb/seasons.js b/lib/routes/themoviedb/seasons.js index bc0b85f386232c..360a9eebdb2087 100644 --- a/lib/routes/themoviedb/seasons.js +++ b/lib/routes/themoviedb/seasons.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const apiKey = require('./api-key'); const { handleDescription } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { id, lang } = ctx.req.param(); const { data } = await got(`https://api.themoviedb.org/3/tv/${id}`, { searchParams: { diff --git a/lib/routes/themoviedb/sheet.js b/lib/routes/themoviedb/sheet.js index 0a935db69018ba..7df46f73568d58 100644 --- a/lib/routes/themoviedb/sheet.js +++ b/lib/routes/themoviedb/sheet.js @@ -28,7 +28,7 @@ const TITLE = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const { mediaType, sheet, lang } = ctx.req.param(); const { data } = await got(`https://api.themoviedb.org/3/${API_PATH[mediaType][sheet]}`, { searchParams: { diff --git a/lib/routes/themoviedb/trending.js b/lib/routes/themoviedb/trending.js index 6885fb53865140..fca2a690b54201 100644 --- a/lib/routes/themoviedb/trending.js +++ b/lib/routes/themoviedb/trending.js @@ -7,7 +7,7 @@ const MEDIA_TYPE_TO_TITLE = { movie: 'Movies', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { mediaType, timeWindow, lang } = ctx.req.param(); const { data } = await got(`https://api.themoviedb.org/3/trending/${mediaType}/${timeWindow}`, { searchParams: { diff --git a/lib/routes/thenewslens/index.js b/lib/routes/thenewslens/index.js index 760b9264696bf2..0f91ed818c0ea7 100644 --- a/lib/routes/thenewslens/index.js +++ b/lib/routes/thenewslens/index.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.thenewslens.com'; const currentUrl = `${rootUrl}${getSubPath(ctx) === '/' ? '/latest-article' : getSubPath(ctx)}`; diff --git a/lib/routes/thenewslens/router.js b/lib/routes/thenewslens/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/thenewslens/router.js +++ b/lib/routes/thenewslens/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/thepaper/839studio/category.js b/lib/routes/thepaper/839studio/category.js index 19a1132c4927c7..c9debbbc4ad5d3 100644 --- a/lib/routes/thepaper/839studio/category.js +++ b/lib/routes/thepaper/839studio/category.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `http://projects.thepaper.cn/thepaper-cases/839studio/?cat=${id}`; diff --git a/lib/routes/thepaper/839studio/studio.js b/lib/routes/thepaper/839studio/studio.js index 0fbffeb70ef62c..f1edd5ede88977 100644 --- a/lib/routes/thepaper/839studio/studio.js +++ b/lib/routes/thepaper/839studio/studio.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { // 发起 HTTP GET 请求 const response = await got({ method: 'get', diff --git a/lib/routes/thepaper/channel.js b/lib/routes/thepaper/channel.js index 2a3c9d6a884275..52c8caccdadbf4 100644 --- a/lib/routes/thepaper/channel.js +++ b/lib/routes/thepaper/channel.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import { load } from 'cheerio'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const channel_url = `https://m.thepaper.cn/channel/${id}`; const channel_url_resp = await got(channel_url); diff --git a/lib/routes/thepaper/factpaper.js b/lib/routes/thepaper/factpaper.js index 1f768f7a0686a5..b968ff59001e10 100644 --- a/lib/routes/thepaper/factpaper.js +++ b/lib/routes/thepaper/factpaper.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const status = Number.parseInt(ctx.req.param('status') ?? '1'); const rootUrl = 'https://www.factpaper.cn'; diff --git a/lib/routes/thepaper/featured.js b/lib/routes/thepaper/featured.js index 861ccd99828dfe..f0e507a50d3bb8 100644 --- a/lib/routes/thepaper/featured.js +++ b/lib/routes/thepaper/featured.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import { load } from 'cheerio'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://m.thepaper.cn'); const data = JSON.parse(load(response.data)('#__NEXT_DATA__').html()); const list = [...data.props.pageProps.data.list, ...data.props.pageProps.topData.recommendImg]; diff --git a/lib/routes/thepaper/list.js b/lib/routes/thepaper/list.js index ab6c9a4c0bb4fa..e784565bd9aaaf 100644 --- a/lib/routes/thepaper/list.js +++ b/lib/routes/thepaper/list.js @@ -2,7 +2,7 @@ const utils = require('./utils'); import { load } from 'cheerio'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const list_url = `https://m.thepaper.cn/list/${id}`; const list_url_resp = await got(list_url); diff --git a/lib/routes/thepaper/router.js b/lib/routes/thepaper/router.js index 9b274317e11324..fb498f89be1ae7 100644 --- a/lib/routes/thepaper/router.js +++ b/lib/routes/thepaper/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/839studio', './839studio/studio'); router.get('/839studio/:id', './839studio/category'); router.get('/channel/:id', './channel'); diff --git a/lib/routes/thepaper/sidebar.js b/lib/routes/thepaper/sidebar.js index f465ee884da43e..01998a0ec6589a 100644 --- a/lib/routes/thepaper/sidebar.js +++ b/lib/routes/thepaper/sidebar.js @@ -7,7 +7,7 @@ const sections = { morningEveningNews: '早晚报', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { sec = 'hotNews' } = ctx.req.param(); const sidebar_url = `https://cache.thepaper.cn/contentapi/wwwIndex/rightSidebar`; diff --git a/lib/routes/theverge/index.js b/lib/routes/theverge/index.js index dd55fad4eea951..a668168fb9607d 100644 --- a/lib/routes/theverge/index.js +++ b/lib/routes/theverge/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = ctx.req.param('hub') ? `https://www.theverge.com/${ctx.req.param('hub')}/rss/index.xml` : 'https://www.theverge.com/rss/index.xml'; const feed = await parser.parseURL(link); diff --git a/lib/routes/theverge/router.js b/lib/routes/theverge/router.js index 2fc2c2624590b9..11a64382a65c94 100644 --- a/lib/routes/theverge/router.js +++ b/lib/routes/theverge/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:hub?', './index'); }; diff --git a/lib/routes/thoughtco/index.js b/lib/routes/thoughtco/index.js index 6a178352ab57b9..dd0121d629d07d 100644 --- a/lib/routes/thoughtco/index.js +++ b/lib/routes/thoughtco/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = '' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/routes/thoughtco/router.js b/lib/routes/thoughtco/router.js index b610024188e52a..74ed533fca356e 100644 --- a/lib/routes/thoughtco/router.js +++ b/lib/routes/thoughtco/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './'); }; diff --git a/lib/routes/threads/index.js b/lib/routes/threads/index.js index 717a2c4929d297..1367ab1b4fd77f 100644 --- a/lib/routes/threads/index.js +++ b/lib/routes/threads/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { PROFILE_QUERY, REPLIES_QUERY, THREADS_QUERY, apiUrl, threadUrl, profileUrl, extractTokens, makeHeader, buildContent } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { user, routeParams } = ctx.req.param(); const { lsd, userId } = await extractTokens(user, ctx); diff --git a/lib/routes/threads/router.js b/lib/routes/threads/router.js index 5ec9df85e50fbe..4d67bf6f7f8af5 100644 --- a/lib/routes/threads/router.js +++ b/lib/routes/threads/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:user/:routeParams?', './index'); }; diff --git a/lib/routes/thwiki/index.js b/lib/routes/thwiki/index.js index 653fc51cf26ab9..6eb805e53e33bf 100644 --- a/lib/routes/thwiki/index.js +++ b/lib/routes/thwiki/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const dayjs = require('dayjs'); -module.exports = async (ctx) => { +export default async (ctx) => { const beforeDays = ctx.req.param('before') ? Number.parseInt(ctx.req.param('before')) : 30; const afterDays = ctx.req.param('after') ? Number.parseInt(ctx.req.param('after')) : 30; const before = dayjs().subtract(beforeDays, 'day').format('YYYY-MM-DD'); diff --git a/lib/routes/thwiki/router.js b/lib/routes/thwiki/router.js index 271e1fa779da68..acbb6a722100bc 100644 --- a/lib/routes/thwiki/router.js +++ b/lib/routes/thwiki/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/calendar/:before?/:after?', './index'); }; diff --git a/lib/routes/tiktok/router.js b/lib/routes/tiktok/router.js index a7b9bc11377563..0950e9e94fea0f 100644 --- a/lib/routes/tiktok/router.js +++ b/lib/routes/tiktok/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/user/:user/:iframe?', './user'); }; diff --git a/lib/routes/tiktok/user.js b/lib/routes/tiktok/user.js index 01322c28b44a53..0b77f185cf2933 100644 --- a/lib/routes/tiktok/user.js +++ b/lib/routes/tiktok/user.js @@ -8,7 +8,7 @@ import puppeteer from '@/utils/puppeteer'; const baseUrl = 'https://www.tiktok.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, iframe } = ctx.req.param(); const useIframe = queryToBoolean(iframe); diff --git a/lib/routes/timednews/news.js b/lib/routes/timednews/news.js index 17563cf74ee6f4..86d9e90f3ff1d2 100644 --- a/lib/routes/timednews/news.js +++ b/lib/routes/timednews/news.js @@ -52,7 +52,7 @@ const PATH_LIST = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'all'; const url = `${BASE}/${PATH_LIST[type].path}`; const res = await got({ diff --git a/lib/routes/timednews/router.js b/lib/routes/timednews/router.js index 4880153cca019a..eb19f8f1f67ba3 100644 --- a/lib/routes/timednews/router.js +++ b/lib/routes/timednews/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:type?', './news'); }; diff --git a/lib/routes/tingshuitz/changsha.js b/lib/routes/tingshuitz/changsha.js index 9482ed57b1b06a..3582c4946109c4 100644 --- a/lib/routes/tingshuitz/changsha.js +++ b/lib/routes/tingshuitz/changsha.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'http://www.supplywater.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { channelId = 78 } = ctx.req.param(); const listPage = await got('http://www.supplywater.com/tstz-' + channelId + '.aspx'); const $ = load(listPage.data); diff --git a/lib/routes/tingshuitz/dalian.js b/lib/routes/tingshuitz/dalian.js index 5c1938d441cea7..f1b047cda23365 100644 --- a/lib/routes/tingshuitz/dalian.js +++ b/lib/routes/tingshuitz/dalian.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://swj.dl.gov.cn/module/web/jpage/dataproxy.jsp?page=1&webid=28&path=https://swj.dl.gov.cn/&columnid=4296&unitid=31227&webname=%25E5%25A4%25A7%25E8%25BF%259E%25E5%25B8%2582%25E6%25B0%25B4%25E5%258A%25A1%25E5%25B1%2580&permissiontype=0'; const response = await got(url); diff --git a/lib/routes/tingshuitz/dongguan.js b/lib/routes/tingshuitz/dongguan.js index ac9f2ab0425421..c9ea88655439a3 100644 --- a/lib/routes/tingshuitz/dongguan.js +++ b/lib/routes/tingshuitz/dongguan.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'http://www.djsw.com.cn/news/tstz/index.html'; const response = await got({ method: 'get', diff --git a/lib/routes/tingshuitz/guangzhou.js b/lib/routes/tingshuitz/guangzhou.js index 8f2ec3a7428762..f37e25cee2d703 100644 --- a/lib/routes/tingshuitz/guangzhou.js +++ b/lib/routes/tingshuitz/guangzhou.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'post', url: `https://mp.weixin.qq.com/mp/homepage?__biz=MzA3MDE0NzAxMw%3D%3D&hid=15&sn=270abafdcf67ce4e2b52a049a0aa219a&scene=1&sharer_username=&clicktime=${Math.floor( diff --git a/lib/routes/tingshuitz/hangzhou.js b/lib/routes/tingshuitz/hangzhou.js index 16a1290ce3d96b..5163099f54a2ac 100644 --- a/lib/routes/tingshuitz/hangzhou.js +++ b/lib/routes/tingshuitz/hangzhou.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { // const area = ctx.req.param('area'); const url = 'http://www.hzwgc.com/public/stop_the_water/'; const response = await got({ diff --git a/lib/routes/tingshuitz/nanjing.js b/lib/routes/tingshuitz/nanjing.js index bf3cb14fdfa78b..0fa1b4598c3be0 100644 --- a/lib/routes/tingshuitz/nanjing.js +++ b/lib/routes/tingshuitz/nanjing.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const HOME_PAGE = 'http://www.jlwater.com/'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${HOME_PAGE}portal/10000013`; const response = await got(url); diff --git a/lib/routes/tingshuitz/router.js b/lib/routes/tingshuitz/router.js index 03a2fd17e5dfee..b396300a43930d 100644 --- a/lib/routes/tingshuitz/router.js +++ b/lib/routes/tingshuitz/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/changsha/:channelId?', './changsha'); router.get('/dalian', './dalian'); router.get('/dongguan', './dongguan'); diff --git a/lib/routes/tingshuitz/shenzhen.js b/lib/routes/tingshuitz/shenzhen.js index 288b350a0e16a9..0e93dbe6b623fd 100644 --- a/lib/routes/tingshuitz/shenzhen.js +++ b/lib/routes/tingshuitz/shenzhen.js @@ -4,7 +4,7 @@ import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://szgk.sz-water.com.cn/api/wechat/op/getStopWaterNotice'; const response = await got({ method: 'get', diff --git a/lib/routes/tingshuitz/wuhan.js b/lib/routes/tingshuitz/wuhan.js index 3523fe4887961c..2108ea0165a657 100644 --- a/lib/routes/tingshuitz/wuhan.js +++ b/lib/routes/tingshuitz/wuhan.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.whwater.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { channelId = 68 } = ctx.req.param(); const response = await got.post('https://manager.whwater.com:8900/website/article/findChannelArticle', { form: { diff --git a/lib/routes/tingshuitz/xian.js b/lib/routes/tingshuitz/xian.js index 0d2dc4e45f0ad1..60e445a271b3f3 100644 --- a/lib/routes/tingshuitz/xian.js +++ b/lib/routes/tingshuitz/xian.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const iconv = require('iconv-lite'); -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'http://www.xazls.com/tsgg/index.htm'; const response = await got(url, { responseType: 'buffer', diff --git a/lib/routes/tingshuitz/xiaoshan.js b/lib/routes/tingshuitz/xiaoshan.js index 251d23ba311c0d..f87285b2ea8d73 100644 --- a/lib/routes/tingshuitz/xiaoshan.js +++ b/lib/routes/tingshuitz/xiaoshan.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { // const area = ctx.req.param('area'); const url = 'https://www.xswater.com/gongshui/channels/227.html'; const response = await got({ diff --git a/lib/routes/tingshuitz/yangjiang.js b/lib/routes/tingshuitz/yangjiang.js index ecf6b1059562ca..0be09b1aebaf6c 100644 --- a/lib/routes/tingshuitz/yangjiang.js +++ b/lib/routes/tingshuitz/yangjiang.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.yjsswjt.com/zxdt_list.jsp?flbz=7'; const response = await got(url); diff --git a/lib/routes/tingtingfm/program.js b/lib/routes/tingtingfm/program.js index bd70d5e2bff8c9..c6b84202c70f64 100644 --- a/lib/routes/tingtingfm/program.js +++ b/lib/routes/tingtingfm/program.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const { getClientVal, sign } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const programId = ctx.req.param('programId'); const apiBaseUrl = 'https://api-v3.tingtingfm.com'; const mobileBaseUrl = 'https://mobile.tingtingfm.com'; diff --git a/lib/routes/tingtingfm/router.js b/lib/routes/tingtingfm/router.js index 904eb4c0c824fe..3cb597ede39d16 100644 --- a/lib/routes/tingtingfm/router.js +++ b/lib/routes/tingtingfm/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/program/:programId', './program'); }; diff --git a/lib/routes/tisi/index.js b/lib/routes/tisi/index.js index 7943d18727f667..1f1cba2b4e63c2 100644 --- a/lib/routes/tisi/index.js +++ b/lib/routes/tisi/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://www.tisi.org'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `${rootUrl}/?page_id=11151`; const response = await got(url); diff --git a/lib/routes/tisi/router.js b/lib/routes/tisi/router.js index d97bbb028282e3..d514945596b5e7 100644 --- a/lib/routes/tisi/router.js +++ b/lib/routes/tisi/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/latest', './index'); }; diff --git a/lib/routes/tju/cic/index.js b/lib/routes/tju/cic/index.js index 89cc4743af2b53..5280a3eebfb96d 100644 --- a/lib/routes/tju/cic/index.js +++ b/lib/routes/tju/cic/index.js @@ -15,7 +15,7 @@ const pageType = (href) => { return url.hostname === 'cic.tju.edu.cn' ? 'tju-cic' : 'unknown'; }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.params && ctx.req.param('type'); let path, subtitle; diff --git a/lib/routes/tju/news/index.js b/lib/routes/tju/news/index.js index 2c768374e536fe..1b3e733017c872 100644 --- a/lib/routes/tju/news/index.js +++ b/lib/routes/tju/news/index.js @@ -17,7 +17,7 @@ const pageType = (href) => { return url.hostname === 'news.tju.edu.cn' ? 'tju-news' : 'unknown'; }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.params && ctx.req.param('type'); let path, subtitle; diff --git a/lib/routes/tju/oaa/index.js b/lib/routes/tju/oaa/index.js index 62de6e1eade157..c06e6b151b1d7e 100644 --- a/lib/routes/tju/oaa/index.js +++ b/lib/routes/tju/oaa/index.js @@ -22,7 +22,7 @@ const pageType = (href) => { } }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.params && ctx.req.param('type'); let path, subtitle; diff --git a/lib/routes/tju/router.js b/lib/routes/tju/router.js index fb1283a64c7ac8..ec8f0b35136c9f 100644 --- a/lib/routes/tju/router.js +++ b/lib/routes/tju/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/cic/:type?', './cic'); router.get('/news/:type?', './news'); router.get('/oaa/:type?', './oaa'); diff --git a/lib/routes/tju/yzb/index.js b/lib/routes/tju/yzb/index.js index 7fae8aa74c8ea6..7683ad8db3c9bb 100644 --- a/lib/routes/tju/yzb/index.js +++ b/lib/routes/tju/yzb/index.js @@ -18,7 +18,7 @@ const pageType = (href) => { return url.hostname === 'yzb.tju.edu.cn' ? 'tju-yzb' : 'unknown'; }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.params && ctx.req.param('type'); let path, subtitle; diff --git a/lib/routes/tokeninsight/blog.js b/lib/routes/tokeninsight/blog.js index ae8178ebd103b3..d1dc5cfec396d5 100644 --- a/lib/routes/tokeninsight/blog.js +++ b/lib/routes/tokeninsight/blog.js @@ -6,7 +6,7 @@ const baseURL = 'https://www.tokeninsight.com/'; const title = 'TokenInsight'; const link = 'https://www.tokeninsight.com/'; -module.exports = async (ctx) => { +export default async (ctx) => { const lang = ctx.req.param('lang') ?? 'zh'; const getBlogs = async () => { diff --git a/lib/routes/tokeninsight/bulletin.js b/lib/routes/tokeninsight/bulletin.js index d742b8acd5d856..35d7d5ec8e4ba1 100644 --- a/lib/routes/tokeninsight/bulletin.js +++ b/lib/routes/tokeninsight/bulletin.js @@ -12,7 +12,7 @@ const get_articles = async () => { return data; }; -module.exports = async (ctx) => { +export default async (ctx) => { const lang = ctx.req.param('lang') ?? 'zh'; const get_article_info = async (article) => { diff --git a/lib/routes/tokeninsight/report.js b/lib/routes/tokeninsight/report.js index e1c224864ab3c0..3636d223ead6a4 100644 --- a/lib/routes/tokeninsight/report.js +++ b/lib/routes/tokeninsight/report.js @@ -6,7 +6,7 @@ const baseURL = 'https://www.tokeninsight.com/'; const title = 'TokenInsight'; const link = 'https://www.tokeninsight.com/'; -module.exports = async (ctx) => { +export default async (ctx) => { const lang = ctx.req.param('lang') ?? 'zh'; const getReports = async () => { diff --git a/lib/routes/tokeninsight/router.js b/lib/routes/tokeninsight/router.js index 45dc92f99ea732..642c0de63cd2b6 100644 --- a/lib/routes/tokeninsight/router.js +++ b/lib/routes/tokeninsight/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog/:lang?', './blog.js'); router.get('/bulletin/:lang?', './bulletin.js'); router.get('/report/:lang?', './report.js'); diff --git a/lib/routes/tongji/bks.js b/lib/routes/tongji/bks.js index 681d39cfd1b93e..7e5ae4db060c46 100644 --- a/lib/routes/tongji/bks.js +++ b/lib/routes/tongji/bks.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://bksy.tongji.edu.cn/30359/list.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/tongji/router.js b/lib/routes/tongji/router.js index 40e3e5b041febb..ac7b8624d7d91c 100644 --- a/lib/routes/tongji/router.js +++ b/lib/routes/tongji/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/bks', './bks'); router.get('/sse/:type?', './sse/notice'); router.get('/yjs', './yjs'); diff --git a/lib/routes/tongji/sse/notice.js b/lib/routes/tongji/sse/notice.js index d7f8bb4f1e3dda..f4daf7d9b0fa33 100644 --- a/lib/routes/tongji/sse/notice.js +++ b/lib/routes/tongji/sse/notice.js @@ -9,7 +9,7 @@ import { load } from 'cheerio'; // html parser const getArticle = require('./_article'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://sse.tongji.edu.cn'; const type = ctx.req.param('type') || 'xytz'; const subType = ['bkstz', 'yjstz', 'jgtz', 'qttz']; diff --git a/lib/routes/tongji/yjs.js b/lib/routes/tongji/yjs.js index c7eca7b77c7397..753172aeffccf3 100644 --- a/lib/routes/tongji/yjs.js +++ b/lib/routes/tongji/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://yz.tongji.edu.cn/zsxw/ggtz.htm'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/toodaylab/index.js b/lib/routes/toodaylab/index.js index 27412d4e172a41..9a7c328a0c0aff 100644 --- a/lib/routes/toodaylab/index.js +++ b/lib/routes/toodaylab/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { params = 'posts' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/toodaylab/router.js b/lib/routes/toodaylab/router.js index dbf301a7685537..82774a018b5458 100644 --- a/lib/routes/toodaylab/router.js +++ b/lib/routes/toodaylab/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:params*', './'); }; diff --git a/lib/routes/tophub/index.js b/lib/routes/tophub/index.js index b2f8c5a784f22e..97280bb8673245 100644 --- a/lib/routes/tophub/index.js +++ b/lib/routes/tophub/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `https://tophub.today/n/${id}`; diff --git a/lib/routes/tophub/list.js b/lib/routes/tophub/list.js index 48b291ef4d034e..36ec27b03f3fb7 100644 --- a/lib/routes/tophub/list.js +++ b/lib/routes/tophub/list.js @@ -4,7 +4,7 @@ import { config } from '@/config'; import * as path from 'node:path'; import { art } from '@/utils/render'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `https://tophub.today/n/${id}`; const response = await got.get(link, { diff --git a/lib/routes/tophub/router.js b/lib/routes/tophub/router.js index 7c5f6bf4b47ac7..143f5d833cfad5 100644 --- a/lib/routes/tophub/router.js +++ b/lib/routes/tophub/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id', './'); router.get('/list/:id', './list'); }; diff --git a/lib/routes/topys/index.js b/lib/routes/topys/index.js index 493ef07b95933d..f9f6d1968a1335 100644 --- a/lib/routes/topys/index.js +++ b/lib/routes/topys/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword') ?? ''; const rootUrl = 'https://www.topys.cn'; diff --git a/lib/routes/topys/router.js b/lib/routes/topys/router.js index 1d1f37335504b0..4d109716246741 100644 --- a/lib/routes/topys/router.js +++ b/lib/routes/topys/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:keyword?', './index'); }; diff --git a/lib/routes/tradingview/blog.js b/lib/routes/tradingview/blog.js index cf525abf8d7750..c960331ab2531f 100644 --- a/lib/routes/tradingview/blog.js +++ b/lib/routes/tradingview/blog.js @@ -6,7 +6,7 @@ const asyncPool = require('tiny-async-pool'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'en' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 22; diff --git a/lib/routes/tradingview/desktop.js b/lib/routes/tradingview/desktop.js index ca80361bd48488..5f1d0d3db7c149 100644 --- a/lib/routes/tradingview/desktop.js +++ b/lib/routes/tradingview/desktop.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; const rootUrl = 'https://www.tradingview.com'; diff --git a/lib/routes/tradingview/pine.js b/lib/routes/tradingview/pine.js index 7a20ac6b5c9d89..507aa32a72583a 100644 --- a/lib/routes/tradingview/pine.js +++ b/lib/routes/tradingview/pine.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { version = 'v5' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 100; diff --git a/lib/routes/tradingview/router.js b/lib/routes/tradingview/router.js index 31925711e183b3..d23cae06c2cb38 100644 --- a/lib/routes/tradingview/router.js +++ b/lib/routes/tradingview/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:category*', './blog'); router.get('/desktop', './desktop'); router.get('/pine/:version?', './pine'); diff --git a/lib/routes/transcriptforest/index.js b/lib/routes/transcriptforest/index.js index 1286b80f349a54..244b0937caacda 100644 --- a/lib/routes/transcriptforest/index.js +++ b/lib/routes/transcriptforest/index.js @@ -17,7 +17,7 @@ const bakeTimestamp = (seconds) => { return `${formattedHours}:${formattedMinutes}:${formattedSeconds}`; }; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/transcriptforest/router.js b/lib/routes/transcriptforest/router.js index 826c21ae93bad3..8c83b5062d6e94 100644 --- a/lib/routes/transcriptforest/router.js +++ b/lib/routes/transcriptforest/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:channel?', './'); }; diff --git a/lib/routes/trending/all-trending.js b/lib/routes/trending/all-trending.js index 6aca423ff42acb..1638fa1a6ef4eb 100644 --- a/lib/routes/trending/all-trending.js +++ b/lib/routes/trending/all-trending.js @@ -155,7 +155,7 @@ const createItem = ({ dateTime, data, count, newItemCount }, keywords, isToday) }; // Main -module.exports = async (ctx) => { +export default async (ctx) => { // Prevent making over 100 requests per invocation if (ctx.req.param('numberOfDays') > 14) { throw new Error('days must be less than 14'); diff --git a/lib/routes/trending/router.js b/lib/routes/trending/router.js index f72b34ed3bc5d3..bbc9d99def63dd 100644 --- a/lib/routes/trending/router.js +++ b/lib/routes/trending/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:keywords/:numberOfDays?', './all-trending'); }; diff --git a/lib/routes/trendingpapers/papers.js b/lib/routes/trendingpapers/papers.js index b781a5c1b454de..1dfd553d2f64a8 100644 --- a/lib/routes/trendingpapers/papers.js +++ b/lib/routes/trendingpapers/papers.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { time = 'Since beginning', cited = 'Cited and uncited papers', category = 'All categories' } = ctx.req.param(); const rootUrl = 'https://trendingpapers.com'; diff --git a/lib/routes/trendingpapers/router.js b/lib/routes/trendingpapers/router.js index 19fba46a1b9a31..fc53d7c674d071 100644 --- a/lib/routes/trendingpapers/router.js +++ b/lib/routes/trendingpapers/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/papers/:category?/:time?/:cited?', './papers.js'); }; diff --git a/lib/routes/tribalfootball/latest.js b/lib/routes/tribalfootball/latest.js index e6b198c729cc29..282540890fd8ca 100644 --- a/lib/routes/tribalfootball/latest.js +++ b/lib/routes/tribalfootball/latest.js @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; const rssUrl = 'https://www.tribalfootball.com/rss/mediafed/general/rss.xml'; -module.exports = async (ctx) => { +export default async (ctx) => { const rss = await got(rssUrl); const $ = load(rss.data, { xmlMode: true }); const items = $('rss > channel > item') diff --git a/lib/routes/tribalfootball/router.js b/lib/routes/tribalfootball/router.js index 5cc8cd41df7390..e1279c909729d5 100644 --- a/lib/routes/tribalfootball/router.js +++ b/lib/routes/tribalfootball/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './latest'); }; diff --git a/lib/routes/trow/portal.js b/lib/routes/trow/portal.js index 105c841195d8a6..edeb3796a59ded 100644 --- a/lib/routes/trow/portal.js +++ b/lib/routes/trow/portal.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { let data; const response = await got.extend({ followRedirect: false }).get({ url: `https://trow.cc`, diff --git a/lib/routes/trow/router.js b/lib/routes/trow/router.js index 3650c44ec916cd..1d18dbbab91e35 100644 --- a/lib/routes/trow/router.js +++ b/lib/routes/trow/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/portal', './portal'); }; diff --git a/lib/routes/tvb/news.js b/lib/routes/tvb/news.js index 67b8da07347ef7..61ae7ca22e8c2f 100644 --- a/lib/routes/tvb/news.js +++ b/lib/routes/tvb/news.js @@ -42,7 +42,7 @@ const titles = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'focus'; const language = ctx.req.param('language') ?? 'tc'; diff --git a/lib/routes/tvb/router.js b/lib/routes/tvb/router.js index f16a2c6f1c7a4b..9e60a8705d6e87 100644 --- a/lib/routes/tvb/router.js +++ b/lib/routes/tvb/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:category?/:language?', './news'); }; diff --git a/lib/routes/tvtropes/featured.js b/lib/routes/tvtropes/featured.js index 624afc04188e1e..af2681b11a78d1 100644 --- a/lib/routes/tvtropes/featured.js +++ b/lib/routes/tvtropes/featured.js @@ -8,7 +8,7 @@ const categories = { newest: 'right', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'today' } = ctx.req.param(); const rootUrl = 'https://tvtropes.org'; diff --git a/lib/routes/tvtropes/router.js b/lib/routes/tvtropes/router.js index 6c42358634edc7..85f49f95fa91ce 100644 --- a/lib/routes/tvtropes/router.js +++ b/lib/routes/tvtropes/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/featured/:category?', require('./featured')); }; diff --git a/lib/routes/twitch/live.js b/lib/routes/twitch/live.js index 88a9ea8a5df56b..ba62e95b5f7657 100644 --- a/lib/routes/twitch/live.js +++ b/lib/routes/twitch/live.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; // https://github.com/streamlink/streamlink/blob/master/src/streamlink/plugins/twitch.py#L286 const TWITCH_CLIENT_ID = 'kimne78kx3ncx6brgo4mv6wki5h1ko'; -module.exports = async (ctx) => { +export default async (ctx) => { const login = ctx.req.param('login'); const response = await got({ diff --git a/lib/routes/twitch/router.js b/lib/routes/twitch/router.js index 02171a7c9113ab..a03a61f4d510dc 100644 --- a/lib/routes/twitch/router.js +++ b/lib/routes/twitch/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/live/:login', './live'); router.get('/video/:login/:filter?', './video'); router.get('/schedule/:login', './schedule'); diff --git a/lib/routes/twitch/schedule.js b/lib/routes/twitch/schedule.js index f7b68e7cb98a38..2fd170511335fa 100644 --- a/lib/routes/twitch/schedule.js +++ b/lib/routes/twitch/schedule.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; // https://github.com/streamlink/streamlink/blob/master/src/streamlink/plugins/twitch.py#L286 const TWITCH_CLIENT_ID = 'kimne78kx3ncx6brgo4mv6wki5h1ko'; -module.exports = async (ctx) => { +export default async (ctx) => { const login = ctx.req.param('login'); const today = new Date(); diff --git a/lib/routes/twitch/video.js b/lib/routes/twitch/video.js index 960a842b1156ba..c434da3ecc8d90 100644 --- a/lib/routes/twitch/video.js +++ b/lib/routes/twitch/video.js @@ -10,7 +10,7 @@ const FILTER_NODE_TYPE_MAP = { all: 'ALL_VIDEOS', }; -module.exports = async (ctx) => { +export default async (ctx) => { const login = ctx.req.param('login'); const filter = ctx.req.param('filter')?.toLowerCase() || 'all'; if (!FILTER_NODE_TYPE_MAP[filter]) { diff --git a/lib/routes/twitter/collection.js b/lib/routes/twitter/collection.js index 8ff46a84ad5e2f..8aebe839054da6 100644 --- a/lib/routes/twitter/collection.js +++ b/lib/routes/twitter/collection.js @@ -4,7 +4,7 @@ const T = {}; const { TwitterApi } = require('twitter-api-v2'); import { fallback, queryToBoolean } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const collectionId = ctx.req.param('collectionId'); const cookie = config.twitter.tokens[uid]; diff --git a/lib/routes/twitter/developer-api/search.js b/lib/routes/twitter/developer-api/search.js index 5659fb25177cc9..468ec234b3ef00 100644 --- a/lib/routes/twitter/developer-api/search.js +++ b/lib/routes/twitter/developer-api/search.js @@ -1,6 +1,6 @@ const utils = require('../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const limit = ctx.req.query('limit') ?? 50; const client = await utils.getAppClient(); diff --git a/lib/routes/twitter/developer-api/user.js b/lib/routes/twitter/developer-api/user.js index ff7742eefd7e94..76126d2cc81957 100644 --- a/lib/routes/twitter/developer-api/user.js +++ b/lib/routes/twitter/developer-api/user.js @@ -1,6 +1,6 @@ const utils = require('../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); // For compatibility const { exclude_replies, include_rts, count } = utils.parseRouteParams(ctx.req.param('routeParams')); diff --git a/lib/routes/twitter/followings.js b/lib/routes/twitter/followings.js index 6e7baf6c6f787f..0658836e37187c 100644 --- a/lib/routes/twitter/followings.js +++ b/lib/routes/twitter/followings.js @@ -4,7 +4,7 @@ const T = {}; const { TwitterApi } = require('twitter-api-v2'); import { fallback, queryToBoolean } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const cookie = config.twitter.tokens[id]; if (!cookie) { diff --git a/lib/routes/twitter/likes.js b/lib/routes/twitter/likes.js index de5b1c5100093d..ec162b8ffe95ca 100644 --- a/lib/routes/twitter/likes.js +++ b/lib/routes/twitter/likes.js @@ -1,7 +1,7 @@ const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) { throw new Error('Twitter RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/twitter/list.js b/lib/routes/twitter/list.js index 6267aa0731f418..a552f99191676e 100644 --- a/lib/routes/twitter/list.js +++ b/lib/routes/twitter/list.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) { throw new Error('Twitter RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/twitter/router.js b/lib/routes/twitter/router.js index 1aa67b581436de..a5f629a8aadf8d 100644 --- a/lib/routes/twitter/router.js +++ b/lib/routes/twitter/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/collection/:uid/:collectionId/:routeParams?', './collection'); router.get('/followings/:id/:routeParams?', './followings'); router.get('/keyword/:keyword/:routeParams?', './keyword'); diff --git a/lib/routes/twitter/trends.js b/lib/routes/twitter/trends.js index 6c92469c778ee4..10a03c2171104b 100644 --- a/lib/routes/twitter/trends.js +++ b/lib/routes/twitter/trends.js @@ -1,7 +1,7 @@ const utils = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) { throw new Error('Twitter RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/twitter/tweet.js b/lib/routes/twitter/tweet.js index 629e5d13007bb8..d65d1e8ea0fe82 100644 --- a/lib/routes/twitter/tweet.js +++ b/lib/routes/twitter/tweet.js @@ -1,5 +1,5 @@ const webApiImpl = require('./web-api/tweet'); -module.exports = async (ctx) => { +export default async (ctx) => { await webApiImpl(ctx); }; diff --git a/lib/routes/twitter/web-api/media.js b/lib/routes/twitter/web-api/media.js index d600d7d583f25a..a6a8d0f6a9ea96 100644 --- a/lib/routes/twitter/web-api/media.js +++ b/lib/routes/twitter/web-api/media.js @@ -3,7 +3,7 @@ const utils = require('../utils'); const { getUser, getUserMedia } = require('./twitter-api'); const { initToken } = require('./token'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { count } = utils.parseRouteParams(ctx.req.param('routeParams')); const params = count ? { count } : {}; diff --git a/lib/routes/twitter/web-api/search.js b/lib/routes/twitter/web-api/search.js index 7fb71c8270b5c8..e6861df7d3cc8d 100644 --- a/lib/routes/twitter/web-api/search.js +++ b/lib/routes/twitter/web-api/search.js @@ -2,7 +2,7 @@ const utils = require('../utils'); const { getSearch } = require('./twitter-api'); const { initToken } = require('./token'); -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); await initToken(); const data = await getSearch(keyword); diff --git a/lib/routes/twitter/web-api/tweet.js b/lib/routes/twitter/web-api/tweet.js index 2659c39d1d5d5d..2740d2e79fbe8d 100644 --- a/lib/routes/twitter/web-api/tweet.js +++ b/lib/routes/twitter/web-api/tweet.js @@ -5,7 +5,7 @@ import { fallback, queryToBoolean } from '@/utils/readable-social'; import { config } from '@/config'; const { initToken } = require('./token'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const status = ctx.req.param('status'); const routeParams = new URLSearchParams(ctx.req.param('original')); diff --git a/lib/routes/twitter/web-api/user.js b/lib/routes/twitter/web-api/user.js index 1f7b410e1633f7..420f296775957e 100644 --- a/lib/routes/twitter/web-api/user.js +++ b/lib/routes/twitter/web-api/user.js @@ -2,7 +2,7 @@ const utils = require('../utils'); const { getUser, getUserTweets, getUserTweetsAndReplies, excludeRetweet } = require('./twitter-api'); const { initToken } = require('./token'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); // For compatibility diff --git a/lib/routes/twreporter/newest.js b/lib/routes/twreporter/newest.js index 40de9d0ad20002..fcc9d16d3cf31a 100644 --- a/lib/routes/twreporter/newest.js +++ b/lib/routes/twreporter/newest.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; const fetch = require('./fetch-article'); -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.twreporter.org'; const res = await got(url); const $ = load(res.data); diff --git a/lib/routes/twreporter/router.js b/lib/routes/twreporter/router.js index b164668ac55bbd..89baddaeb296c0 100644 --- a/lib/routes/twreporter/router.js +++ b/lib/routes/twreporter/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/newest', './newest'); }; diff --git a/lib/routes/txrjy/fornumtopic.js b/lib/routes/txrjy/fornumtopic.js index 4df506b0978286..5aafa3860bbbc9 100644 --- a/lib/routes/txrjy/fornumtopic.js +++ b/lib/routes/txrjy/fornumtopic.js @@ -9,7 +9,7 @@ import * as path from 'node:path'; const rootUrl = 'https://www.txrjy.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel') ?? '1'; const url = `${rootUrl}/c114-listnewtopic.php?typeid=${channel}`; diff --git a/lib/routes/txrjy/router.js b/lib/routes/txrjy/router.js index 819d0478baa95e..777e27f22a728c 100644 --- a/lib/routes/txrjy/router.js +++ b/lib/routes/txrjy/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/fornumtopic/:channel?', './fornumtopic'); }; diff --git a/lib/routes/tynu/router.js b/lib/routes/tynu/router.js index 1ee8a9afb001b5..c703e2a3068d9b 100644 --- a/lib/routes/tynu/router.js +++ b/lib/routes/tynu/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './tynu'); }; diff --git a/lib/routes/tynu/tynu.js b/lib/routes/tynu/tynu.js index 07750031351177..23cb7c785578d7 100644 --- a/lib/routes/tynu/tynu.js +++ b/lib/routes/tynu/tynu.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'http://www.tynu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `${baseUrl}/index/tzgg.htm`; const response = await got(link); const data = response.data; diff --git a/lib/routes/typora/changelog-dev.js b/lib/routes/typora/changelog-dev.js index fb5fccb1a09c0b..06402805be1555 100644 --- a/lib/routes/typora/changelog-dev.js +++ b/lib/routes/typora/changelog-dev.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = 'https://typora.io/releases/dev'; const response = await got(currentUrl); diff --git a/lib/routes/typora/changelog.js b/lib/routes/typora/changelog.js index ad77c4522038e7..3b550b297d7db0 100644 --- a/lib/routes/typora/changelog.js +++ b/lib/routes/typora/changelog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://support.typora.io'; const { data } = await got(`${host}/store/`); diff --git a/lib/routes/typora/router.js b/lib/routes/typora/router.js index 92ce19b161413e..845c16dc3f66eb 100644 --- a/lib/routes/typora/router.js +++ b/lib/routes/typora/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/changelog', './changelog'); router.get('/changelog/dev', './changelog-dev'); }; diff --git a/lib/routes/u3c3/index.js b/lib/routes/u3c3/index.js index f3ce55a45b95da..acd41d53971f0b 100644 --- a/lib/routes/u3c3/index.js +++ b/lib/routes/u3c3/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type, keywoard, preview } = ctx.req.param(); // should be: // undefined diff --git a/lib/routes/u3c3/router.js b/lib/routes/u3c3/router.js index e869fda230c1ef..d0a800a1297676 100644 --- a/lib/routes/u3c3/router.js +++ b/lib/routes/u3c3/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/search/:keyword/:preview?', './index'); router.get('/:type?/:preview?', './index'); }; diff --git a/lib/routes/u9a9/index.js b/lib/routes/u9a9/index.js index e605406cae0220..4e078337754af9 100644 --- a/lib/routes/u9a9/index.js +++ b/lib/routes/u9a9/index.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'https://u9a9.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { preview, keyword } = ctx.req.param(); let link; diff --git a/lib/routes/u9a9/router.js b/lib/routes/u9a9/router.js index 89e2831951dc14..7c6709e0d3e391 100644 --- a/lib/routes/u9a9/router.js +++ b/lib/routes/u9a9/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:preview?', './index'); router.get('/search/:keyword/:preview?', './index'); }; diff --git a/lib/routes/uber/blog.js b/lib/routes/uber/blog.js index 2fbfa9721b637b..379544b555b2b6 100644 --- a/lib/routes/uber/blog.js +++ b/lib/routes/uber/blog.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootURL = 'https://www.uber.com'; const apiURL = 'https://blogapi.uber.com'; -module.exports = async (ctx) => { +export default async (ctx) => { let maxPage = Number(ctx.req.param('maxPage')); if (Number.isNaN(maxPage)) { maxPage = 1; diff --git a/lib/routes/uber/router.js b/lib/routes/uber/router.js index e65b61bd368d89..45a3c44218a8b3 100644 --- a/lib/routes/uber/router.js +++ b/lib/routes/uber/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog/:maxPage?', './blog'); }; diff --git a/lib/routes/ucas/ai.js b/lib/routes/ucas/ai.js index 4574117b6f040e..dda5af2bea096e 100644 --- a/lib/routes/ucas/ai.js +++ b/lib/routes/ucas/ai.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://ai.ucas.ac.cn'; const link = `${baseUrl}/index.php/zh-cn/tzgg`; const response = await got(link); diff --git a/lib/routes/ucas/index.js b/lib/routes/ucas/index.js index 7ad36f6cc8373b..6076485226b384 100644 --- a/lib/routes/ucas/index.js +++ b/lib/routes/ucas/index.js @@ -19,7 +19,7 @@ const titleMap = { bsh: '博士后', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'bsh'; const url = `${rootUrl}/gjob/login.do?method=contentList&t=zhaopin&c=${idMap[type]}`; const response = await got.get(url); diff --git a/lib/routes/ucas/router.js b/lib/routes/ucas/router.js index 20b0c95252e31f..dd69d8dccb7e47 100644 --- a/lib/routes/ucas/router.js +++ b/lib/routes/ucas/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/ai', './ai'); router.get('/job/:type?', './index'); }; diff --git a/lib/routes/uchicago/current.js b/lib/routes/uchicago/current.js index 20935fb6bd4c81..c0571cbe478bcd 100644 --- a/lib/routes/uchicago/current.js +++ b/lib/routes/uchicago/current.js @@ -5,7 +5,7 @@ import { getCookies, setCookies } from '@/utils/puppeteer-utils'; import logger from '@/utils/logger'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const journal = ctx.req.param('journal'); const baseUrl = 'https://www.journals.uchicago.edu'; const link = `${baseUrl}/toc/${journal}/current`; diff --git a/lib/routes/uchicago/router.js b/lib/routes/uchicago/router.js index 549d4513bc7975..12168e5e31416a 100644 --- a/lib/routes/uchicago/router.js +++ b/lib/routes/uchicago/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/journals/current/:journal', './current'); }; diff --git a/lib/routes/udn/breaking-news.js b/lib/routes/udn/breaking-news.js index d39bf52e546d31..85b1ef336f0854 100644 --- a/lib/routes/udn/breaking-news.js +++ b/lib/routes/udn/breaking-news.js @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `/news/breaknews/1/${id}#breaknews`; const name = await getLinkName(link); diff --git a/lib/routes/udn/global/index.js b/lib/routes/udn/global/index.js index 086a8930dc6653..f2a36ceaf5e96d 100644 --- a/lib/routes/udn/global/index.js +++ b/lib/routes/udn/global/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const start = category === 'hot' ? 6 : 0; diff --git a/lib/routes/udn/global/tag.js b/lib/routes/udn/global/tag.js index 64944a8242f1f7..58cf685e272b16 100644 --- a/lib/routes/udn/global/tag.js +++ b/lib/routes/udn/global/tag.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag') ?? '過去24小時'; const rootUrl = 'https://global.udn.com'; diff --git a/lib/routes/udn/router.js b/lib/routes/udn/router.js index 0130d27536fa6f..b8ce3956aac532 100644 --- a/lib/routes/udn/router.js +++ b/lib/routes/udn/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/global/tag/:tag?', './global/tag'); router.get('/global/:category?', './global/index'); router.get('/news/breakingnews/:id', './breaking-news'); diff --git a/lib/routes/uestc/auto.js b/lib/routes/uestc/auto.js index 1e11a514a67aa9..ec08536c3b7f26 100644 --- a/lib/routes/uestc/auto.js +++ b/lib/routes/uestc/auto.js @@ -5,7 +5,7 @@ import puppeteer from '@/utils/puppeteer'; const baseIndexUrl = 'https://www.auto.uestc.edu.cn/index/tzgg1.htm'; const host = 'https://www.auto.uestc.edu.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); diff --git a/lib/routes/uestc/cqe.js b/lib/routes/uestc/cqe.js index b872cfdc4e80ef..702b3fc7f26274 100644 --- a/lib/routes/uestc/cqe.js +++ b/lib/routes/uestc/cqe.js @@ -14,7 +14,7 @@ const mapTitle = { tzgg: '通知公告', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'tzgg'; const pageUrl = mapUrl[type]; if (!pageUrl) { diff --git a/lib/routes/uestc/gr.js b/lib/routes/uestc/gr.js index 0a492aee5be98d..ad29df19e05f0a 100644 --- a/lib/routes/uestc/gr.js +++ b/lib/routes/uestc/gr.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://gr.uestc.edu.cn/tongzhi/'; const baseIndexUrl = 'https://gr.uestc.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got.get(baseIndexUrl); const $ = load(response.data); diff --git a/lib/routes/uestc/jwc.js b/lib/routes/uestc/jwc.js index 44da04c3272ac3..021c6b5bd0f54e 100644 --- a/lib/routes/uestc/jwc.js +++ b/lib/routes/uestc/jwc.js @@ -15,7 +15,7 @@ const map = { office: 'list/ff80808160bcf79c0160c010a8d20020/?page=1', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'important'; const pageUrl = map[type]; if (!pageUrl) { diff --git a/lib/routes/uestc/news.js b/lib/routes/uestc/news.js index 231e257acc77e7..22f7afd68f106f 100644 --- a/lib/routes/uestc/news.js +++ b/lib/routes/uestc/news.js @@ -12,7 +12,7 @@ const map = { announcement: '/?n=UestcNews.Front.CategoryV2.Page&CatId=68', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'announcement'; const pageUrl = map[type]; if (!pageUrl) { diff --git a/lib/routes/uestc/router.js b/lib/routes/uestc/router.js index 1c4a662dd41a88..1a9664fcb32831 100644 --- a/lib/routes/uestc/router.js +++ b/lib/routes/uestc/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { // departments router.get('/gr', './gr'); router.get('/cqe/:type?', './cqe'); // type: tzgg/hdyg diff --git a/lib/routes/uestc/scse.js b/lib/routes/uestc/scse.js index 62cd2715e47f3e..059b2fe4175010 100644 --- a/lib/routes/uestc/scse.js +++ b/lib/routes/uestc/scse.js @@ -19,7 +19,7 @@ const prefixes = { 1022: '【安全工作】', }; -module.exports = async (ctx) => { +export default async (ctx) => { const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); diff --git a/lib/routes/uestc/sice.js b/lib/routes/uestc/sice.js index 0a10e3d82bfeac..7402234c14ae4c 100644 --- a/lib/routes/uestc/sice.js +++ b/lib/routes/uestc/sice.js @@ -6,7 +6,7 @@ import puppeteer from '@/utils/puppeteer'; const baseIndexUrl = 'https://www.sice.uestc.edu.cn/index.htm'; const host = 'https://www.sice.uestc.edu.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); diff --git a/lib/routes/uestc/sise.js b/lib/routes/uestc/sise.js index c37428fa53f0b5..d0bbdc7330ad0f 100644 --- a/lib/routes/uestc/sise.js +++ b/lib/routes/uestc/sise.js @@ -29,7 +29,7 @@ const mapTitle = { 9: "Int'I", }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 1; const divId = mapId[type]; if (!divId) { diff --git a/lib/routes/uibe/hr.js b/lib/routes/uibe/hr.js index 52f147a2505b95..7b120f446b2a98 100644 --- a/lib/routes/uibe/hr.js +++ b/lib/routes/uibe/hr.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'tzgg'; const type = ctx.req.param('type') ?? ''; diff --git a/lib/routes/uibe/router.js b/lib/routes/uibe/router.js index e6841390017744..fdf200aee4b81a 100644 --- a/lib/routes/uibe/router.js +++ b/lib/routes/uibe/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/hr/:category?/:type?', './hr'); }; diff --git a/lib/routes/ulapia/index.js b/lib/routes/ulapia/index.js index 8aa37c420d7aa6..0f3220c7b62453 100644 --- a/lib/routes/ulapia/index.js +++ b/lib/routes/ulapia/index.js @@ -22,7 +22,7 @@ const selectorMap = { ipo_research: 'div.col-md-6', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'brokerage_news'; const url = `${rootUrl}/reports/${category}`; diff --git a/lib/routes/ulapia/research.js b/lib/routes/ulapia/research.js index 18e4257e8626ec..deb81d5630aa98 100644 --- a/lib/routes/ulapia/research.js +++ b/lib/routes/ulapia/research.js @@ -7,7 +7,7 @@ const rootUrl = 'http://www.ulapia.com'; const researchList = ['stock_research', 'industry_research', 'strategy_research', 'macro_research', 'ipo_research']; -module.exports = async (ctx) => { +export default async (ctx) => { const items = await Promise.all( researchList.map((item) => { const url = `${rootUrl}/reports/${item}`; diff --git a/lib/routes/ulapia/router.js b/lib/routes/ulapia/router.js index b404ea49476d38..b6a6ec520b830b 100644 --- a/lib/routes/ulapia/router.js +++ b/lib/routes/ulapia/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/reports/:category?', './index'); router.get('/research/latest', './research'); }; diff --git a/lib/routes/uniqlo/new.js b/lib/routes/uniqlo/new.js index f1805cab08dad5..13d2522f938221 100644 --- a/lib/routes/uniqlo/new.js +++ b/lib/routes/uniqlo/new.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const { country, category } = ctx.req.param(); const map = { diff --git a/lib/routes/uniqlo/router.js b/lib/routes/uniqlo/router.js index 12e09de6983e55..d68a73ce2972ad 100644 --- a/lib/routes/uniqlo/router.js +++ b/lib/routes/uniqlo/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/new/:country/:category', './new'); }; diff --git a/lib/routes/unraid/community-apps.js b/lib/routes/unraid/community-apps.js index c0e7b4b748d3e9..6f6567d3425048 100644 --- a/lib/routes/unraid/community-apps.js +++ b/lib/routes/unraid/community-apps.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const appFeedUrl = 'https://raw.githubusercontent.com/Squidly271/AppFeed/master/applicationFeed.json'; const defaultLimit = 20; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got(appFeedUrl); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : defaultLimit; diff --git a/lib/routes/unraid/router.js b/lib/routes/unraid/router.js index a951c8fa3607ec..f8fdf566a2ead3 100644 --- a/lib/routes/unraid/router.js +++ b/lib/routes/unraid/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/community-apps', './community-apps'); }; diff --git a/lib/routes/unusualwhales/news.js b/lib/routes/unusualwhales/news.js index a5446e36d556f0..b646af47426c57 100644 --- a/lib/routes/unusualwhales/news.js +++ b/lib/routes/unusualwhales/news.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; const apiBase = 'https://phx.unusualwhales.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got(`${apiBase}/api/fj_articles`); const items = data.map((item) => ({ diff --git a/lib/routes/unusualwhales/router.js b/lib/routes/unusualwhales/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/unusualwhales/router.js +++ b/lib/routes/unusualwhales/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/upc/jsj.js b/lib/routes/upc/jsj.js index 222a6983b901b5..2b9f250ac31898 100644 --- a/lib/routes/upc/jsj.js +++ b/lib/routes/upc/jsj.js @@ -25,7 +25,7 @@ const HEAD = { notice: '通知公告', }; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://computer.upc.edu.cn'; const type = ctx.req.param('type'); const link = `${baseUrl}/${MAP[type]}/list.htm`; diff --git a/lib/routes/upc/main.js b/lib/routes/upc/main.js index 7a4fffb6ce982e..e917f1c3440aea 100644 --- a/lib/routes/upc/main.js +++ b/lib/routes/upc/main.js @@ -16,7 +16,7 @@ const HEAD = { scholar: '学术动态', }; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://news.upc.edu.cn'; const type = ctx.req.param('type'); const link = `${baseUrl}/${MAP[type]}.htm`; diff --git a/lib/routes/upc/router.js b/lib/routes/upc/router.js index e5ba9f39716afe..7c6e02ea0cb58e 100644 --- a/lib/routes/upc/router.js +++ b/lib/routes/upc/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/main/:type', './main'); router.get('/jsj/:type', './jsj'); router.get('/yjs', './yjs'); diff --git a/lib/routes/upc/yjs.js b/lib/routes/upc/yjs.js index 24b9c228162de0..722e542dc801fd 100644 --- a/lib/routes/upc/yjs.js +++ b/lib/routes/upc/yjs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'http://zs.gs.upc.edu.cn'; const link = `${baseUrl}/sszs/list.htm`; const response = await got(link); diff --git a/lib/routes/uptimerobot/router.js b/lib/routes/uptimerobot/router.js index 4e8ce835645582..42009a2300932c 100644 --- a/lib/routes/uptimerobot/router.js +++ b/lib/routes/uptimerobot/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/rss/:id/:routeParams?', './rss'); }; diff --git a/lib/routes/uptimerobot/rss.js b/lib/routes/uptimerobot/rss.js index 4f013b0699e874..fc955af3047752 100644 --- a/lib/routes/uptimerobot/rss.js +++ b/lib/routes/uptimerobot/rss.js @@ -50,7 +50,7 @@ class Monitor { const rootURL = 'https://rss.uptimerobot.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const routeParams = Object.fromEntries(new URLSearchParams(ctx.req.param('routeParams'))); const showID = fallback(undefined, queryToBoolean(routeParams.showID), true); diff --git a/lib/routes/uraaka-joshi/router.js b/lib/routes/uraaka-joshi/router.js index c772c92db3d840..04e2762f031ec1 100644 --- a/lib/routes/uraaka-joshi/router.js +++ b/lib/routes/uraaka-joshi/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './uraaka-joshi'); router.get('/:id', './uraaka-joshi-user'); }; diff --git a/lib/routes/uraaka-joshi/uraaka-joshi-user.js b/lib/routes/uraaka-joshi/uraaka-joshi-user.js index 89a2682284af92..d984ee31705e82 100644 --- a/lib/routes/uraaka-joshi/uraaka-joshi-user.js +++ b/lib/routes/uraaka-joshi/uraaka-joshi-user.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `https://www.uraaka-joshi.com/user/${id}`; diff --git a/lib/routes/uraaka-joshi/uraaka-joshi.js b/lib/routes/uraaka-joshi/uraaka-joshi.js index 726a04ddde0f71..50280bdb9543cb 100644 --- a/lib/routes/uraaka-joshi/uraaka-joshi.js +++ b/lib/routes/uraaka-joshi/uraaka-joshi.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `https://www.uraaka-joshi.com/`; const title = `裏垢女子まとめ`; diff --git a/lib/routes/urbandictionary/random.js b/lib/routes/urbandictionary/random.js index 2bb6d8f675a40c..d6499be22d252c 100644 --- a/lib/routes/urbandictionary/random.js +++ b/lib/routes/urbandictionary/random.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.urbandictionary.com'; const { data } = await got('https://api.urbandictionary.com/v0/random'); diff --git a/lib/routes/urbandictionary/router.js b/lib/routes/urbandictionary/router.js index c196272cfb93ea..240123336a84ec 100644 --- a/lib/routes/urbandictionary/router.js +++ b/lib/routes/urbandictionary/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/random', './random'); }; diff --git a/lib/routes/usenix/router.js b/lib/routes/usenix/router.js index bd985bf73ba0e6..7469da0b2af4c4 100644 --- a/lib/routes/usenix/router.js +++ b/lib/routes/usenix/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/usenix-security-sympoium', './usenix'); }; diff --git a/lib/routes/usenix/usenix.js b/lib/routes/usenix/usenix.js index 870c6ae791f77b..a7eceb69d9a32a 100644 --- a/lib/routes/usenix/usenix.js +++ b/lib/routes/usenix/usenix.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const seasons = ['spring', 'summer', 'fall', 'winter']; -module.exports = async (ctx) => { +export default async (ctx) => { const last = new Date().getFullYear() + 1; const urlList = Array.from({ length: last - 2020 }, (_, v) => `${url}/conference/usenixsecurity${v + 20}`).flatMap((url) => seasons.map((season) => `${url}/${season}-accepted-papers`)); const responses = await got.all( diff --git a/lib/routes/usepanda/index.js b/lib/routes/usepanda/index.js index 0d107b8d86d5fc..d611f4723ceacd 100644 --- a/lib/routes/usepanda/index.js +++ b/lib/routes/usepanda/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const feedId = ctx.req.param('id'); const limit = ctx.req.query('limit') ?? 30; // 默认30条 diff --git a/lib/routes/usepanda/router.js b/lib/routes/usepanda/router.js index 8d60ece4621932..b76ebb1c600405 100644 --- a/lib/routes/usepanda/router.js +++ b/lib/routes/usepanda/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/feeds/:id', './index'); }; diff --git a/lib/routes/ustb/router.js b/lib/routes/ustb/router.js index 933dee482c95bb..d3d1456b1ad933 100644 --- a/lib/routes/ustb/router.js +++ b/lib/routes/ustb/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/tj/news/:type?', './tj/news'); router.get('/yjsy/news/:type', './yjsy/news'); router.get('/yzxc/tzgg', './yzxc/tzgg'); diff --git a/lib/routes/ustb/tj/news.js b/lib/routes/ustb/tj/news.js index 5642f33e2321ef..8a663cb30461d9 100644 --- a/lib/routes/ustb/tj/news.js +++ b/lib/routes/ustb/tj/news.js @@ -30,7 +30,7 @@ function getNews(data) { })); } -module.exports = async (ctx) => { +export default async (ctx) => { let type = ctx.req.param('type') || 'all'; if (!Object.keys(maps).includes(type)) { type = 'all'; diff --git a/lib/routes/ustb/yjsy/news.js b/lib/routes/ustb/yjsy/news.js index 35ed864e6a45d0..c5cd013c2476a5 100644 --- a/lib/routes/ustb/yjsy/news.js +++ b/lib/routes/ustb/yjsy/news.js @@ -4,7 +4,7 @@ const iconv = require('iconv-lite'); import { parseDate } from '@/utils/parse-date'; // import logger from '@/utils/logger'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const struct = { all: { diff --git a/lib/routes/ustb/yzxc/tzgg.js b/lib/routes/ustb/yzxc/tzgg.js index 2d8d0071c195d5..41734e73ab7bbe 100644 --- a/lib/routes/ustb/yzxc/tzgg.js +++ b/lib/routes/ustb/yzxc/tzgg.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'https://yzxc.ustb.edu.cn'; const url = `${host}/tzgg/index.htm`; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(url); const $ = load(response.data); const list = $('.page_content .ul-inline .box'); diff --git a/lib/routes/ustc/eeis.js b/lib/routes/ustc/eeis.js index 246a480fb7b4ee..984757b3295804 100644 --- a/lib/routes/ustc/eeis.js +++ b/lib/routes/ustc/eeis.js @@ -11,7 +11,7 @@ const map = new Map([ const host = 'https://eeis.ustc.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'tzgg'; const info = map.get(type); if (!info) { diff --git a/lib/routes/ustc/gs.js b/lib/routes/ustc/gs.js index 330b197c0b127f..e2e0c920cfe254 100644 --- a/lib/routes/ustc/gs.js +++ b/lib/routes/ustc/gs.js @@ -11,7 +11,7 @@ const map = new Map([ const host = 'https://gradschool.ustc.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'tzgg'; const info = map.get(type); if (!info) { diff --git a/lib/routes/ustc/index.js b/lib/routes/ustc/index.js index a9839affd468d8..8caa00bac00f48 100644 --- a/lib/routes/ustc/index.js +++ b/lib/routes/ustc/index.js @@ -26,7 +26,7 @@ const notice_type = { // }); // } -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'gl'; // 发起 HTTP GET 请求 const response = await got({ diff --git a/lib/routes/ustc/job.js b/lib/routes/ustc/job.js index 57e05b41530d46..f739d7553489e6 100644 --- a/lib/routes/ustc/job.js +++ b/lib/routes/ustc/job.js @@ -9,7 +9,7 @@ const titles = { joblist2: '招聘公告', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'joblist2'; const rand = 0.012_345_678_901_234_56; diff --git a/lib/routes/ustc/jwc.js b/lib/routes/ustc/jwc.js index 31c16ade6a6f66..310818c93e314c 100644 --- a/lib/routes/ustc/jwc.js +++ b/lib/routes/ustc/jwc.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const noticeUrl = 'https://www.teach.ustc.edu.cn/category/notice'; const noticeType = { teaching: '教学', info: '信息', exam: '考试', exchange: '交流' }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? ''; // 发起 HTTP GET 请求 const response = await got({ diff --git a/lib/routes/ustc/router.js b/lib/routes/ustc/router.js index 52f11d3ff84c26..d08b4234849a93 100644 --- a/lib/routes/ustc/router.js +++ b/lib/routes/ustc/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/eeis/:type?', './eeis'); router.get('/gs/:type?', './gs'); router.get('/job/:category?', './job'); diff --git a/lib/routes/ustc/sist.js b/lib/routes/ustc/sist.js index 8543c362b6302d..80a06dea17a229 100644 --- a/lib/routes/ustc/sist.js +++ b/lib/routes/ustc/sist.js @@ -11,7 +11,7 @@ const map = new Map([ const host = 'https://sist.ustc.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'tzgg'; const info = map.get(type); if (!info) { diff --git a/lib/routes/usts/jwch.js b/lib/routes/usts/jwch.js index 9379bbab0a9b7d..3591c544dfd108 100644 --- a/lib/routes/usts/jwch.js +++ b/lib/routes/usts/jwch.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const rootURL = 'http://jwch.usts.edu.cn/index'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'jwdt'; const url = `${rootURL}/${type}.htm`; const response = await got(url); diff --git a/lib/routes/usts/router.js b/lib/routes/usts/router.js index e76f73b769902f..5dd0cc8332bd93 100644 --- a/lib/routes/usts/router.js +++ b/lib/routes/usts/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/jwch/:type?', './jwch'); }; diff --git a/lib/routes/utgd/category.js b/lib/routes/utgd/category.js index bb0bf22c3ed117..095a3e6ac85259 100644 --- a/lib/routes/utgd/category.js +++ b/lib/routes/utgd/category.js @@ -8,7 +8,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'method'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; diff --git a/lib/routes/utgd/router.js b/lib/routes/utgd/router.js index e9c77dfa117692..cf27f6c7d8eabc 100644 --- a/lib/routes/utgd/router.js +++ b/lib/routes/utgd/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/timeline', './timeline'); router.get('/topic/:topic?', './topic'); router.get('/:category?', './category'); diff --git a/lib/routes/utgd/timeline.js b/lib/routes/utgd/timeline.js index c6704c03b15443..2a8b4e273f6d74 100644 --- a/lib/routes/utgd/timeline.js +++ b/lib/routes/utgd/timeline.js @@ -8,7 +8,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; const rootUrl = 'https://utgd.net'; diff --git a/lib/routes/utgd/topic.js b/lib/routes/utgd/topic.js index d30fc7f2e65fde..d100ac94b4de1b 100644 --- a/lib/routes/utgd/topic.js +++ b/lib/routes/utgd/topic.js @@ -8,7 +8,7 @@ const md = require('markdown-it')({ html: true, }); -module.exports = async (ctx) => { +export default async (ctx) => { const topic = ctx.req.param('topic') ?? '在线阅读专栏'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; diff --git a/lib/routes/uw/gix/news.js b/lib/routes/uw/gix/news.js index 8be4a871c36652..063f6c56a22d5a 100644 --- a/lib/routes/uw/gix/news.js +++ b/lib/routes/uw/gix/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const gixBaseURL = 'https://gixnetwork.org'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); let newsURL = gixBaseURL + '/news'; diff --git a/lib/routes/uw/router.js b/lib/routes/uw/router.js index 527c9b310ed1d7..06be729b7eaeb3 100644 --- a/lib/routes/uw/router.js +++ b/lib/routes/uw/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/gix/news/:category', './gix/news'); }; diff --git a/lib/routes/v1tx/index.js b/lib/routes/v1tx/index.js index c79948b84623a3..a4c3e38fadb773 100644 --- a/lib/routes/v1tx/index.js +++ b/lib/routes/v1tx/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.v1tx.com'; const { data: response } = await got(baseUrl); diff --git a/lib/routes/v1tx/router.js b/lib/routes/v1tx/router.js index d7756988faf502..b84c130aa1d81f 100644 --- a/lib/routes/v1tx/router.js +++ b/lib/routes/v1tx/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/v2ex/post.js b/lib/routes/v2ex/post.js index 820c7303de6bb6..04860a977b8105 100644 --- a/lib/routes/v2ex/post.js +++ b/lib/routes/v2ex/post.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const postid = ctx.req.param('postid'); const pageUrl = `https://www.v2ex.com/t/${postid}`; diff --git a/lib/routes/v2ex/router.js b/lib/routes/v2ex/router.js index 261d404f7fdcb0..dc9cc48f861590 100644 --- a/lib/routes/v2ex/router.js +++ b/lib/routes/v2ex/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/post/:postid', './post'); router.get('/tab/:tabid', './tab'); router.get('/topics/:type', './topics'); diff --git a/lib/routes/v2ex/tab.js b/lib/routes/v2ex/tab.js index 62fc7ab61b2243..75848d7e8beb3d 100644 --- a/lib/routes/v2ex/tab.js +++ b/lib/routes/v2ex/tab.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const tabid = ctx.req.param('tabid'); const host = 'https://v2ex.com'; const pageUrl = `${host}/?tab=${tabid}`; diff --git a/lib/routes/v2ex/topics.js b/lib/routes/v2ex/topics.js index 90f621062709fd..31db8d06ead0ff 100644 --- a/lib/routes/v2ex/topics.js +++ b/lib/routes/v2ex/topics.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const { data } = await got(`https://www.v2ex.com/api/topics/${type}.json`); diff --git a/lib/routes/v2rayshare/index.js b/lib/routes/v2rayshare/index.js index ab5e070d1ef42d..d993b5be31ac6c 100644 --- a/lib/routes/v2rayshare/index.js +++ b/lib/routes/v2rayshare/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; // 自订的 got import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: response } = await got('https://v2rayshare.com/wp-json/wp/v2/posts/?per_page=10'); const items = response.map((item) => ({ diff --git a/lib/routes/v2rayshare/router.js b/lib/routes/v2rayshare/router.js index 323c3ca6f14989..b84c130aa1d81f 100644 --- a/lib/routes/v2rayshare/router.js +++ b/lib/routes/v2rayshare/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/vcb-s/category.js b/lib/routes/vcb-s/category.js index efd87f27eba33b..430509fe1b1de2 100644 --- a/lib/routes/vcb-s/category.js +++ b/lib/routes/vcb-s/category.js @@ -8,7 +8,7 @@ const rootUrl = 'https://vcb-s.com'; const cateAPIUrl = `${rootUrl}/wp-json/wp/v2/categories`; const postsAPIUrl = `${rootUrl}/wp-json/wp/v2/posts`; -module.exports = async (ctx) => { +export default async (ctx) => { const cate = ctx.req.param('cate'); const limit = ctx.req.query('limit') ?? 7; diff --git a/lib/routes/vcb-s/index.js b/lib/routes/vcb-s/index.js index f064a8fc038f8b..e64936aad6ab2e 100644 --- a/lib/routes/vcb-s/index.js +++ b/lib/routes/vcb-s/index.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; const rootUrl = 'https://vcb-s.com'; const postsAPIUrl = `${rootUrl}/wp-json/wp/v2/posts`; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ?? 7; const url = `${postsAPIUrl}?per_page=${limit}&_embed`; diff --git a/lib/routes/vcb-s/router.js b/lib/routes/vcb-s/router.js index f07ad17d105854..1cde93eabcd5e0 100644 --- a/lib/routes/vcb-s/router.js +++ b/lib/routes/vcb-s/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/category/:cate', './category'); }; diff --git a/lib/routes/verfghbw/press.js b/lib/routes/verfghbw/press.js index 929d9596c72fd7..4e8e6427102c9c 100644 --- a/lib/routes/verfghbw/press.js +++ b/lib/routes/verfghbw/press.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const rootUrl = 'https://verfgh.baden-wuerttemberg.de'; diff --git a/lib/routes/verfghbw/router.js b/lib/routes/verfghbw/router.js index 82a3a12fecd814..6bf48c9de62e8b 100644 --- a/lib/routes/verfghbw/router.js +++ b/lib/routes/verfghbw/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/press/:keyword?', './press'); }; diff --git a/lib/routes/vimeo/category.js b/lib/routes/vimeo/category.js index af5fc1d7a0d959..c3da5eb4c4d173 100644 --- a/lib/routes/vimeo/category.js +++ b/lib/routes/vimeo/category.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category, staffpicks } = ctx.req.param(); const categoryparams = category; diff --git a/lib/routes/vimeo/channel.js b/lib/routes/vimeo/channel.js index 62f952d2939eee..cf92315837d640 100644 --- a/lib/routes/vimeo/channel.js +++ b/lib/routes/vimeo/channel.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel'); const url = `https://vimeo.com/channels/${channel}/videos`; const page1 = await got({ diff --git a/lib/routes/vimeo/router.js b/lib/routes/vimeo/router.js index 91060b6a528b2f..6507d86d1a1821 100644 --- a/lib/routes/vimeo/router.js +++ b/lib/routes/vimeo/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/category/:category/:staffpicks?', './category'); router.get('/channel/:channel', './channel'); router.get('/user/:username/:cat?', './usr-videos'); diff --git a/lib/routes/vimeo/usr-videos.js b/lib/routes/vimeo/usr-videos.js index b668d745f571cf..963539489bcac4 100644 --- a/lib/routes/vimeo/usr-videos.js +++ b/lib/routes/vimeo/usr-videos.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const tokenresponse = await got({ method: 'get', url: 'https://vimeo.com/_rv/viewer', diff --git a/lib/routes/vocus/publication.js b/lib/routes/vocus/publication.js index 8da626c923351e..b14686fb0574b1 100644 --- a/lib/routes/vocus/publication.js +++ b/lib/routes/vocus/publication.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { processList, ProcessFeed, baseUrl, apiUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `${baseUrl}/${id}/home`; diff --git a/lib/routes/vocus/router.js b/lib/routes/vocus/router.js index ddeff0106580ee..18d68257644150 100644 --- a/lib/routes/vocus/router.js +++ b/lib/routes/vocus/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/publication/:id', './publication'); router.get('/user/:id', './user'); }; diff --git a/lib/routes/vocus/user.js b/lib/routes/vocus/user.js index 237e732bf8a39c..6183d089290565 100644 --- a/lib/routes/vocus/user.js +++ b/lib/routes/vocus/user.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { processList, ProcessFeed, baseUrl, apiUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `${baseUrl}/user/@${id}`; const userData = await cache.tryGet(`vocus:user:${id}`, async () => { diff --git a/lib/routes/vom/featured.js b/lib/routes/vom/featured.js index 22048fd9c3918c..733f284402b83f 100644 --- a/lib/routes/vom/featured.js +++ b/lib/routes/vom/featured.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'http://www.vom.mn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { lang = 'mn' } = ctx.req.param(); const { data: response } = await got(`${baseUrl}/${lang}`); diff --git a/lib/routes/vom/router.js b/lib/routes/vom/router.js index 57e60df94e1670..c2ccf2431219f2 100644 --- a/lib/routes/vom/router.js +++ b/lib/routes/vom/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/featured/:lang?', './featured.js'); }; diff --git a/lib/routes/wallhaven/index.js b/lib/routes/wallhaven/index.js index 40f05f1f2c5d79..db080d2cf3b743 100644 --- a/lib/routes/wallhaven/index.js +++ b/lib/routes/wallhaven/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://wallhaven.cc'; -module.exports = async (ctx) => { +export default async (ctx) => { const filter = ctx.req.param('filter') ?? 'latest'; const needDetails = /t|y/i.test(ctx.req.param('needDetails') ?? 'false'); const url = `${rootUrl}/${filter.indexOf('=') > 0 ? `search?${filter.replaceAll(/page=\d+/g, 'page=1')}` : filter}`; diff --git a/lib/routes/wallhaven/router.js b/lib/routes/wallhaven/router.js index 690204949f890e..e0aabb0cb97545 100644 --- a/lib/routes/wallhaven/router.js +++ b/lib/routes/wallhaven/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/search/:filter?/:needDetails?', './index'); router.get('/:filter?/:needDetails?', './index'); }; diff --git a/lib/routes/wallpaperhub/index.js b/lib/routes/wallpaperhub/index.js index 8ec52c04e940fb..db8d66dbb9c0a0 100644 --- a/lib/routes/wallpaperhub/index.js +++ b/lib/routes/wallpaperhub/index.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://wallpaperhub.app/api/v1/wallpapers/?limit=20&page=&query=&width=&height=&tags='; const response = await got({ method: 'get', diff --git a/lib/routes/wallpaperhub/router.js b/lib/routes/wallpaperhub/router.js index d7756988faf502..b84c130aa1d81f 100644 --- a/lib/routes/wallpaperhub/router.js +++ b/lib/routes/wallpaperhub/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); }; diff --git a/lib/routes/wallstreetcn/hot.js b/lib/routes/wallstreetcn/hot.js index 476f98ba1ef9c6..1005a5cbb53a18 100644 --- a/lib/routes/wallstreetcn/hot.js +++ b/lib/routes/wallstreetcn/hot.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const period = ctx.req.param('period') ?? 'day'; const rootUrl = 'https://wallstreetcn.com'; diff --git a/lib/routes/wallstreetcn/live.js b/lib/routes/wallstreetcn/live.js index 5b75d92ff07257..725c69d1ad3a51 100644 --- a/lib/routes/wallstreetcn/live.js +++ b/lib/routes/wallstreetcn/live.js @@ -13,7 +13,7 @@ const titles = { financing: '理财', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'global'; const score = ctx.req.param('score') ?? 1; diff --git a/lib/routes/wallstreetcn/news.js b/lib/routes/wallstreetcn/news.js index aa24f1840d70ad..fa0d3bce29cabf 100644 --- a/lib/routes/wallstreetcn/news.js +++ b/lib/routes/wallstreetcn/news.js @@ -16,7 +16,7 @@ const titles = { medicine: '医药', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'global'; const rootUrl = 'https://wallstreetcn.com'; diff --git a/lib/routes/wallstreetcn/router.js b/lib/routes/wallstreetcn/router.js index 7e01defb99b2a8..5f7459b8c2b295 100644 --- a/lib/routes/wallstreetcn/router.js +++ b/lib/routes/wallstreetcn/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/hot/:period?', './hot'); router.get('/live/:category?/:score?', './live'); router.get('/news/:category?', './news'); diff --git a/lib/routes/wanqu/news.js b/lib/routes/wanqu/news.js index 759bd1762fc112..f6529f48eac04c 100644 --- a/lib/routes/wanqu/news.js +++ b/lib/routes/wanqu/news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.wanqu.co'; const currentUrl = rootUrl; diff --git a/lib/routes/wanqu/router.js b/lib/routes/wanqu/router.js index bd25c22a2fd87b..3c9877e17cb637 100644 --- a/lib/routes/wanqu/router.js +++ b/lib/routes/wanqu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/warthunder/news.js b/lib/routes/warthunder/news.js index 88b8bed7d5e89a..684258b39595d9 100644 --- a/lib/routes/warthunder/news.js +++ b/lib/routes/warthunder/news.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const renderDescription = (desc) => art(path.join(__dirname, 'templates/description.art'), desc); -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://warthunder.com/en/news/'; const response = await got(rootUrl); diff --git a/lib/routes/warthunder/router.js b/lib/routes/warthunder/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/warthunder/router.js +++ b/lib/routes/warthunder/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/wdc/download.js b/lib/routes/wdc/download.js index 61d30fcee8b60e..f78e62c7f3d873 100644 --- a/lib/routes/wdc/download.js +++ b/lib/routes/wdc/download.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '279'; const rootUrl = 'https://support.wdc.com'; diff --git a/lib/routes/wdc/router.js b/lib/routes/wdc/router.js index 03cc0a456a9278..79ac1b5741d4f0 100644 --- a/lib/routes/wdc/router.js +++ b/lib/routes/wdc/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/download/:id?', './download'); }; diff --git a/lib/routes/web3caff/index.js b/lib/routes/web3caff/index.js index 4ac05cf7d99535..b1c735d970864d 100644 --- a/lib/routes/web3caff/index.js +++ b/lib/routes/web3caff/index.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const params = getSubPath(ctx) === '/' ? '' : getSubPath(ctx); const rootUrl = 'https://web3caff.com'; diff --git a/lib/routes/web3caff/router.js b/lib/routes/web3caff/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/web3caff/router.js +++ b/lib/routes/web3caff/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/wechat/announce.js b/lib/routes/wechat/announce.js index 14c2ad43f0326e..289a8b596304e4 100644 --- a/lib/routes/wechat/announce.js +++ b/lib/routes/wechat/announce.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: htmlString } = await got({ method: 'get', url: 'https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncementlist&lang=zh_CN', diff --git a/lib/routes/wechat/ce.js b/lib/routes/wechat/ce.js index 2e3ba191e8f55d..9757d40491185e 100644 --- a/lib/routes/wechat/ce.js +++ b/lib/routes/wechat/ce.js @@ -9,7 +9,7 @@ import { parseDate } from '@/utils/parse-date'; // mark the UA as a desktop UA with "(X11; Linux x86_64)" const UA = 'Mozilla/5.0 (X11; Linux x86_64) RSS Reader'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const feed = await parser.parseString( diff --git a/lib/routes/wechat/data258.js b/lib/routes/wechat/data258.js index 63b301b1c6ec95..f7ea11069a3321 100644 --- a/lib/routes/wechat/data258.js +++ b/lib/routes/wechat/data258.js @@ -18,7 +18,7 @@ const parsePage = ($item, hyperlinkSelector, timeSelector) => { }; }; -module.exports = async (ctx) => { +export default async (ctx) => { // !!! here we must use a lock to prevent other requests to break the anti-anti-crawler workarounds !!! if ((await cache.get('data258:lock', false)) === '1') { throw new Error('Another request is in progress, please try again later.'); diff --git a/lib/routes/wechat/ershcimi.js b/lib/routes/wechat/ershcimi.js index d1cc6882288b41..253e09eb2c5153 100644 --- a/lib/routes/wechat/ershcimi.js +++ b/lib/routes/wechat/ershcimi.js @@ -4,7 +4,7 @@ import { finishArticleItem } from '@/utils/wechat-mp'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const rootUrl = 'https://www.cimidata.com'; diff --git a/lib/routes/wechat/feeddd.js b/lib/routes/wechat/feeddd.js index 1f90368704848c..efc25cd7e9f2bc 100644 --- a/lib/routes/wechat/feeddd.js +++ b/lib/routes/wechat/feeddd.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { finishArticleItem } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const baseUrl = 'https://feed.hamibot.com'; diff --git a/lib/routes/wechat/feeds.js b/lib/routes/wechat/feeds.js index 28782cb9fb10fd..695358d9f0c937 100644 --- a/lib/routes/wechat/feeds.js +++ b/lib/routes/wechat/feeds.js @@ -1,7 +1,7 @@ import parser from '@/utils/rss-parser'; import { finishArticleItem } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `https://github.com/hellodword/wechat-feeds/raw/feeds/${id}.xml`; const feed = await parser.parseURL(link); diff --git a/lib/routes/wechat/mp.js b/lib/routes/wechat/mp.js index 62dec9ae300467..705de4e3d4814b 100755 --- a/lib/routes/wechat/mp.js +++ b/lib/routes/wechat/mp.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const dayjs = require('dayjs'); import { finishArticleItem } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { const { biz, hid, cid } = ctx.req.param(); let cidurl = ''; if (cid) { diff --git a/lib/routes/wechat/msgalbum.js b/lib/routes/wechat/msgalbum.js index 3f8e7ed3938c8f..16d33293fd8b4b 100644 --- a/lib/routes/wechat/msgalbum.js +++ b/lib/routes/wechat/msgalbum.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const dayjs = require('dayjs'); import { finishArticleItem } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { const { biz, aid } = ctx.req.param(); const aidurl = `&album_id=${aid}`; diff --git a/lib/routes/wechat/router.js b/lib/routes/wechat/router.js index 4b8f5cc36dc24f..825009e39c0451 100644 --- a/lib/routes/wechat/router.js +++ b/lib/routes/wechat/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/announce', './announce'); router.get('/ce/:id', './ce'); router.get('/data258/:id?', './data258'); diff --git a/lib/routes/wechat/sogou.js b/lib/routes/wechat/sogou.js index 03118f6ff53030..dfd173eb386a09 100644 --- a/lib/routes/wechat/sogou.js +++ b/lib/routes/wechat/sogou.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const host = 'https://weixin.sogou.com'; import { finishArticleItem } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { const wechatId = ctx.req.param('id'); let url = `${host}/weixin`; let response = await got({ diff --git a/lib/routes/wechat/tgchannel.js b/lib/routes/wechat/tgchannel.js index 931e52a9b24f1c..8fedef9a9bf9eb 100644 --- a/lib/routes/wechat/tgchannel.js +++ b/lib/routes/wechat/tgchannel.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { finishArticleItem } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const mpName = ctx.req.param('mpName') ?? ''; let searchQueryType = ctx.req.param('searchQueryType') ?? '0'; diff --git a/lib/routes/wechat/uread.js b/lib/routes/wechat/uread.js index e9c5c8a694a4d5..6f466d9073d411 100644 --- a/lib/routes/wechat/uread.js +++ b/lib/routes/wechat/uread.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const userid = ctx.req.param('userid'); const url = `http://119.29.146.143:8080/reading/subscription/account/recent?uid=${userid}`; const response = await got({ diff --git a/lib/routes/wechat/wechat2rss.js b/lib/routes/wechat/wechat2rss.js index 9d585af91aa1d8..794d995b69b037 100644 --- a/lib/routes/wechat/wechat2rss.js +++ b/lib/routes/wechat/wechat2rss.js @@ -2,7 +2,7 @@ import parser from '@/utils/rss-parser'; import { parseDate } from '@/utils/parse-date'; import { finishArticleItem } from '@/utils/wechat-mp'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const baseUrl = 'https://wechat2rss.xlab.app'; diff --git a/lib/routes/wechat/wxnmh.js b/lib/routes/wechat/wxnmh.js index bf4c44e3d16067..07ba3bb2877a79 100644 --- a/lib/routes/wechat/wxnmh.js +++ b/lib/routes/wechat/wxnmh.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const origin = 'https://www.wxnmh.com/'; const response = await got.get(`${origin}user-${ctx.req.param('id')}.htm`); const $ = load(response.data); diff --git a/lib/routes/weekendhk/posts.js b/lib/routes/weekendhk/posts.js index 5115efed483d65..ade3396c39279e 100644 --- a/lib/routes/weekendhk/posts.js +++ b/lib/routes/weekendhk/posts.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://www.weekendhk.com'; const response = await got(`${baseUrl}/wp-json/wp/v2/posts`, { searchParams: { diff --git a/lib/routes/weekendhk/router.js b/lib/routes/weekendhk/router.js index e51016ca9a9535..59494d73ce0dca 100644 --- a/lib/routes/weekendhk/router.js +++ b/lib/routes/weekendhk/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './posts'); }; diff --git a/lib/routes/weibo/friends.js b/lib/routes/weibo/friends.js index 466c23e6c14861..0fc77718879cb3 100644 --- a/lib/routes/weibo/friends.js +++ b/lib/routes/weibo/friends.js @@ -5,7 +5,7 @@ import { config } from '@/config'; const weiboUtils = require('./utils'); import { fallback, queryToBoolean } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.weibo.cookies) { throw new Error('Weibo Friends Timeline is not available due to the absense of [Weibo Cookies]. Check relevant config tutorial'); } diff --git a/lib/routes/weibo/group.js b/lib/routes/weibo/group.js index 8acd47e810c119..e95d71eb012f2b 100644 --- a/lib/routes/weibo/group.js +++ b/lib/routes/weibo/group.js @@ -5,7 +5,7 @@ import { config } from '@/config'; const weiboUtils = require('./utils'); import { fallback, queryToBoolean } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.weibo.cookies) { throw new Error('Weibo Group Timeline is not available due to the absense of [Weibo Cookies]. Check relevant config tutorial'); } diff --git a/lib/routes/weibo/keyword.js b/lib/routes/weibo/keyword.js index 633b456b135a2d..3f9e1fe175a8dd 100644 --- a/lib/routes/weibo/keyword.js +++ b/lib/routes/weibo/keyword.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; import { fallback, queryToBoolean } from '@/utils/readable-social'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const keyword = ctx.req.param('keyword'); const data = await cache.tryGet( diff --git a/lib/routes/weibo/oasis/user.js b/lib/routes/weibo/oasis/user.js index ca039804685223..5d879978609bad 100644 --- a/lib/routes/weibo/oasis/user.js +++ b/lib/routes/weibo/oasis/user.js @@ -1,7 +1,7 @@ import buildData from '@/utils/common-config'; const weiboUtils = require('../utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const userid = ctx.req.param('userid'); const link = `https://oasis.weibo.cn/v1/h5/share?uid=${userid}`; ctx.set( diff --git a/lib/routes/weibo/router.js b/lib/routes/weibo/router.js index 68a456848a16a1..cbf69fdb7ed3d5 100644 --- a/lib/routes/weibo/router.js +++ b/lib/routes/weibo/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/friends/:routeParams?', './friends'); router.get('/group/:gid/:gname?/:routeParams?', './group'); router.get('/keyword/:keyword/:routeParams?', './keyword'); diff --git a/lib/routes/weibo/search/hot.js b/lib/routes/weibo/search/hot.js index a12a3d1a7521a3..5e1f55fcfbd80e 100644 --- a/lib/routes/weibo/search/hot.js +++ b/lib/routes/weibo/search/hot.js @@ -10,7 +10,7 @@ import * as path from 'node:path'; let wpic = 'false'; let fullpic = 'false'; -module.exports = async (ctx) => { +export default async (ctx) => { wpic = ctx.req.query('pic') ?? 'false'; fullpic = ctx.req.query('fullpic') ?? 'false'; const { diff --git a/lib/routes/weibo/super-index.js b/lib/routes/weibo/super-index.js index 185d396a4c9eb7..d87b3c76904e84 100644 --- a/lib/routes/weibo/super-index.js +++ b/lib/routes/weibo/super-index.js @@ -4,7 +4,7 @@ const weiboUtils = require('./utils'); import queryString from 'query-string'; import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const type = ctx.req.param('type') ?? 'feed'; diff --git a/lib/routes/weibo/timeline.js b/lib/routes/weibo/timeline.js index 23ff67ba5bf1f5..65ca82515805cc 100644 --- a/lib/routes/weibo/timeline.js +++ b/lib/routes/weibo/timeline.js @@ -6,7 +6,7 @@ import { config } from '@/config'; const weiboUtils = require('./utils'); import { fallback, queryToBoolean } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const feature = ctx.req.param('feature') || 0; const routeParams = ctx.req.param('routeParams') || undefined; diff --git a/lib/routes/weibo/user.js b/lib/routes/weibo/user.js index 74a2814380ccef..a68b633c5e72b1 100644 --- a/lib/routes/weibo/user.js +++ b/lib/routes/weibo/user.js @@ -7,7 +7,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { fallback, queryToBoolean } from '@/utils/readable-social'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); let displayVideo = '1'; let displayArticle = '0'; diff --git a/lib/routes/wenku8/chapter.js b/lib/routes/wenku8/chapter.js index b86892304c6a92..e3be78aca5ca61 100644 --- a/lib/routes/wenku8/chapter.js +++ b/lib/routes/wenku8/chapter.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const iconv = require('iconv-lite'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const index = Number.parseInt(id / 1000); diff --git a/lib/routes/wenku8/index.js b/lib/routes/wenku8/index.js index 16324a1deabfd4..840d285189163b 100644 --- a/lib/routes/wenku8/index.js +++ b/lib/routes/wenku8/index.js @@ -21,7 +21,7 @@ const cateTitleMap = { articlelist: '轻小说列表', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'lastupdate'; const response = await got({ method: 'get', diff --git a/lib/routes/wenku8/router.js b/lib/routes/wenku8/router.js index 8587940ddc5a50..2270012c295c38 100644 --- a/lib/routes/wenku8/router.js +++ b/lib/routes/wenku8/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/chapter/:id', './chapter'); router.get('/volume/:id', './volume'); router.get('/:category?', './index'); diff --git a/lib/routes/wenku8/volume.js b/lib/routes/wenku8/volume.js index 4c2a83f0439461..96801b26848909 100644 --- a/lib/routes/wenku8/volume.js +++ b/lib/routes/wenku8/volume.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const iconv = require('iconv-lite'); -module.exports = async (ctx) => { +export default async (ctx) => { const aid = ctx.req.param('id'); const novel_url = `https://www.wenku8.net/novel/${Number.parseInt(aid / 1000)}/${aid}/index.htm`; const $ = load(await get(novel_url)); diff --git a/lib/routes/wfdf/news.js b/lib/routes/wfdf/news.js index 384fa84e3c1b82..b4fa0a92d3d534 100644 --- a/lib/routes/wfdf/news.js +++ b/lib/routes/wfdf/news.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://wfdf.sport'; const { data: response } = await got(`${baseUrl}/wp-json/wp/v2/posts`, { searchParams: { diff --git a/lib/routes/wfdf/router.js b/lib/routes/wfdf/router.js index bd25c22a2fd87b..3c9877e17cb637 100644 --- a/lib/routes/wfdf/router.js +++ b/lib/routes/wfdf/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/wfu/jwc.js b/lib/routes/wfu/jwc.js index d6740fb4a8e177..8f83d201b1e48b 100644 --- a/lib/routes/wfu/jwc.js +++ b/lib/routes/wfu/jwc.js @@ -6,7 +6,7 @@ import { load } from 'cheerio'; const baseUrl = 'https://jwc.wfu.edu.cn/3742/list.htm'; const sizeTitle = '潍坊学院教务处新闻'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: baseUrl, diff --git a/lib/routes/wfu/news.js b/lib/routes/wfu/news.js index c006cea93ff51f..4a6202543674ee 100644 --- a/lib/routes/wfu/news.js +++ b/lib/routes/wfu/news.js @@ -45,7 +45,7 @@ async function loadContent(link) { return { description }; } -module.exports = async (ctx) => { +export default async (ctx) => { // 默认 潍院要闻 然后获取列表页面 const type = ctx.req.param('type') ?? 'wyyw'; const listPageUrl = baseUrl + catrgoryMap[type][0]; diff --git a/lib/routes/wfu/router.js b/lib/routes/wfu/router.js index 057a5241a2e83c..63345d14bbc051 100644 --- a/lib/routes/wfu/router.js +++ b/lib/routes/wfu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/jwc', './jwc'); router.get('/news/:type?', './news'); }; diff --git a/lib/routes/whitehouse/briefing-room.js b/lib/routes/whitehouse/briefing-room.js index cf7c39a4ea3864..7e5965a6787d0a 100644 --- a/lib/routes/whitehouse/briefing-room.js +++ b/lib/routes/whitehouse/briefing-room.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://www.whitehouse.gov'; diff --git a/lib/routes/whitehouse/ostp.js b/lib/routes/whitehouse/ostp.js index 9ec0bf4bb88512..25f8028f9b9657 100644 --- a/lib/routes/whitehouse/ostp.js +++ b/lib/routes/whitehouse/ostp.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.whitehouse.gov'; const currentUrl = `${rootUrl}/ostp/news-updates`; const response = await got({ diff --git a/lib/routes/whitehouse/router.js b/lib/routes/whitehouse/router.js index 78402d7c87c191..b27219ca8bc27b 100644 --- a/lib/routes/whitehouse/router.js +++ b/lib/routes/whitehouse/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/briefing-room/:category?', './briefing-room'); router.get('/ostp', './ostp'); }; diff --git a/lib/routes/who/news-room.js b/lib/routes/who/news-room.js index c0c0b8e85d9255..5d4d2dd43db263 100644 --- a/lib/routes/who/news-room.js +++ b/lib/routes/who/news-room.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'feature-stories'; const language = ctx.req.param('language') ?? ''; diff --git a/lib/routes/who/news.js b/lib/routes/who/news.js index 3729f928772d67..f0513be82bb1fd 100644 --- a/lib/routes/who/news.js +++ b/lib/routes/who/news.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') ?? 'en'; const rootUrl = 'https://www.who.int'; diff --git a/lib/routes/who/router.js b/lib/routes/who/router.js index 005f5ed4ce7164..500a43d77f3f19 100644 --- a/lib/routes/who/router.js +++ b/lib/routes/who/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:language?', './news'); router.get('/news-room/:category?/:language?', './news-room'); router.get('/speeches/:language?', './speeches'); diff --git a/lib/routes/who/speeches.js b/lib/routes/who/speeches.js index 66052371216fb9..d3cde578153369 100644 --- a/lib/routes/who/speeches.js +++ b/lib/routes/who/speeches.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const language = ctx.req.param('language') || 'en'; const rootUrl = 'https://www.who.int'; diff --git a/lib/routes/whu/cs.js b/lib/routes/whu/cs.js index 220f9af15c8f83..70db9fdaece048 100644 --- a/lib/routes/whu/cs.js +++ b/lib/routes/whu/cs.js @@ -6,7 +6,7 @@ import { load } from 'cheerio'; const baseUrl = 'https://cs.whu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = Number.parseInt(ctx.req.param('type')); let link; diff --git a/lib/routes/whu/gs/index.js b/lib/routes/whu/gs/index.js index 66521272387b2b..0e8dbbd4595842 100644 --- a/lib/routes/whu/gs/index.js +++ b/lib/routes/whu/gs/index.js @@ -15,7 +15,7 @@ const gsIndexMap = new Map([ [8, 'tzgg/zh.htm'], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const host = 'https://gs.whu.edu.cn/'; const type = (ctx.params && Number.parseInt(ctx.req.param('type'))) || 0; const response = await got(host + gsIndexMap.get(type)); diff --git a/lib/routes/whu/hyxt.js b/lib/routes/whu/hyxt.js index 8b0fafe4b2f123..b36bc590317278 100644 --- a/lib/routes/whu/hyxt.js +++ b/lib/routes/whu/hyxt.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const { domain, processMeta, getMeta, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'tzgg' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/whu/news.js b/lib/routes/whu/news.js index 21c320101368bc..86140c616a3e82 100644 --- a/lib/routes/whu/news.js +++ b/lib/routes/whu/news.js @@ -7,7 +7,7 @@ import * as path from 'node:path'; const { domain, processMeta, getMeta, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'wdzx/wdyw' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; diff --git a/lib/routes/whu/router.js b/lib/routes/whu/router.js index 8f842d56b45a77..2ba9b44d75370b 100644 --- a/lib/routes/whu/router.js +++ b/lib/routes/whu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/cs/:type', './cs'); router.get('/gs/:type?', './gs/index.js'); router.get('/hyxt/:category*', './hyxt'); diff --git a/lib/routes/wikinews/index.js b/lib/routes/wikinews/index.js index 4e5eabf56e8fc3..2a68d4091883a0 100644 --- a/lib/routes/wikinews/index.js +++ b/lib/routes/wikinews/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const currentURL = 'https://zh.wikinews.org/wiki/Special:%E6%96%B0%E9%97%BB%E8%AE%A2%E9%98%85'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const resp = await got(currentURL); const $ = load(resp.data); const urls = $('url') diff --git a/lib/routes/wikinews/router.js b/lib/routes/wikinews/router.js index 54fbb060bfc9ad..f6278b7a638b0a 100644 --- a/lib/routes/wikinews/router.js +++ b/lib/routes/wikinews/router.js @@ -1,4 +1,4 @@ const routerIndex = './index'; -module.exports = function (router) { +export default (router) => { router.get('/latest', routerIndex); }; diff --git a/lib/routes/winstall/router.js b/lib/routes/winstall/router.js index 77513190b3e3de..e24728aae305c4 100644 --- a/lib/routes/winstall/router.js +++ b/lib/routes/winstall/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:appId', './update'); }; diff --git a/lib/routes/winstall/update.js b/lib/routes/winstall/update.js index 3f535c99b14b1b..1a6565eb837d61 100644 --- a/lib/routes/winstall/update.js +++ b/lib/routes/winstall/update.js @@ -5,7 +5,7 @@ import { config } from '@/config'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://winstall.app'; const appId = ctx.req.param('appId'); diff --git a/lib/routes/wise/pair.js b/lib/routes/wise/pair.js index 23abb19ad9befd..01cd9db5f5a652 100644 --- a/lib/routes/wise/pair.js +++ b/lib/routes/wise/pair.js @@ -8,7 +8,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const renderDesc = (content) => art(path.join(__dirname, 'templates/description.art'), content); -module.exports = async (ctx) => { +export default async (ctx) => { let yesterday = dayjs().subtract(1, 'day'); const dayBefore = yesterday.subtract(1, 'day').format('YYYY-MM-DD'); yesterday = yesterday.format('YYYY-MM-DD'); diff --git a/lib/routes/wise/router.js b/lib/routes/wise/router.js index 8dcc1af0d72e29..e846e0c9349562 100644 --- a/lib/routes/wise/router.js +++ b/lib/routes/wise/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/pair/:source/:target', './pair'); }; diff --git a/lib/routes/wizfile/index.js b/lib/routes/wizfile/index.js index d709e50e24f37b..798f17cf3a556c 100644 --- a/lib/routes/wizfile/index.js +++ b/lib/routes/wizfile/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://antibody-software.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/wizfile/download`; const response = await got(currentUrl); diff --git a/lib/routes/wizfile/router.js b/lib/routes/wizfile/router.js index 90260d27310759..791d47e798b254 100644 --- a/lib/routes/wizfile/router.js +++ b/lib/routes/wizfile/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/updates', './index'); }; diff --git a/lib/routes/wmc-bj/publish.js b/lib/routes/wmc-bj/publish.js index 2eeaa35aaf39df..5d9de76c6173a4 100644 --- a/lib/routes/wmc-bj/publish.js +++ b/lib/routes/wmc-bj/publish.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'CRA-Reanalysis/2m-Temperature/6-hour/index.html' } = ctx.req.param(); const rootUrl = 'http://www.wmc-bj.net'; diff --git a/lib/routes/wmc-bj/router.js b/lib/routes/wmc-bj/router.js index 09f52941219ab1..204156cc44d50d 100644 --- a/lib/routes/wmc-bj/router.js +++ b/lib/routes/wmc-bj/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/publish/:category*', './publish'); }; diff --git a/lib/routes/wmpvp/index.js b/lib/routes/wmpvp/index.js index 9f4f521786840c..d6d6ce2dc1a3cf 100644 --- a/lib/routes/wmpvp/index.js +++ b/lib/routes/wmpvp/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param.get('type'); const response = await got({ diff --git a/lib/routes/wmpvp/router.js b/lib/routes/wmpvp/router.js index eb2f665ae4a821..ed30ab29899c57 100644 --- a/lib/routes/wmpvp/router.js +++ b/lib/routes/wmpvp/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:type', require('.')); }; diff --git a/lib/routes/wnacg/index.js b/lib/routes/wnacg/index.js index 35adeb24cd5ebf..a6eabdcbbf9fed 100644 --- a/lib/routes/wnacg/index.js +++ b/lib/routes/wnacg/index.js @@ -26,7 +26,7 @@ const categories = { const baseUrl = 'https://www.wnacg.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { cid, tag } = ctx.req.param(); if (cid && !Object.keys(categories).includes(cid)) { throw new Error('此分类不存在'); diff --git a/lib/routes/wnacg/router.js b/lib/routes/wnacg/router.js index 6855a981ca033d..dab26e1f9843f8 100644 --- a/lib/routes/wnacg/router.js +++ b/lib/routes/wnacg/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/', './index'); router.get('/category/:cid', './index'); router.get('/tag/:tag', './index'); diff --git a/lib/routes/worldjournal/index.js b/lib/routes/worldjournal/index.js index 6ab4b99e6998a9..93e6cb06362251 100644 --- a/lib/routes/worldjournal/index.js +++ b/lib/routes/worldjournal/index.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'https://www.worldjournal.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { path = 'cate/breaking' } = ctx.req.param(); const { data: response } = await got(`${baseUrl}/wj/${path}`); diff --git a/lib/routes/worldjournal/router.js b/lib/routes/worldjournal/router.js index dcaa685426e5d2..47c58ab51668ec 100644 --- a/lib/routes/worldjournal/router.js +++ b/lib/routes/worldjournal/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:path*', './index'); }; diff --git a/lib/routes/woshipm/popular.js b/lib/routes/woshipm/popular.js index 58d8cdfbb6df47..17bbbd45c806f7 100644 --- a/lib/routes/woshipm/popular.js +++ b/lib/routes/woshipm/popular.js @@ -9,7 +9,7 @@ const rangeMap = { monthly: '月榜', }; -module.exports = async (ctx) => { +export default async (ctx) => { const { range = 'daily' } = ctx.req.param(); const { data: response } = await got(`${baseUrl}/api2/app/article/popular/${range}`); diff --git a/lib/routes/woshipm/router.js b/lib/routes/woshipm/router.js index ae06a6f375077f..e77fa3ff7c5e37 100644 --- a/lib/routes/woshipm/router.js +++ b/lib/routes/woshipm/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/popular/:range?', './popular'); router.get('/user_article/:id', './user-article'); router.get('/wen', './wen'); diff --git a/lib/routes/woshipm/user-article.js b/lib/routes/woshipm/user-article.js index 312c3177474d99..ae615c8af3995f 100644 --- a/lib/routes/woshipm/user-article.js +++ b/lib/routes/woshipm/user-article.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, parseArticle } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 12; const link = `${baseUrl}/u/${id}`; diff --git a/lib/routes/woshipm/wen.js b/lib/routes/woshipm/wen.js index 85efcbecf268c0..8f325747c319e2 100644 --- a/lib/routes/woshipm/wen.js +++ b/lib/routes/woshipm/wen.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const baseUrl = 'https://wen.woshipm.com'; import { parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got(`${baseUrl}/m/main/indexNewData.html`); const $ = load(response.data); const postList = $('.article-list-item') diff --git a/lib/routes/wsj/news.js b/lib/routes/wsj/news.js index 1f7557ea743bce..cc9d3eda155f44 100644 --- a/lib/routes/wsj/news.js +++ b/lib/routes/wsj/news.js @@ -6,7 +6,7 @@ const hostMap = { 'zh-cn': 'https://cn.wsj.com/zh-hans', 'zh-tw': 'https://cn.wsj.com/zh-hant', }; -module.exports = async (ctx) => { +export default async (ctx) => { const lang = ctx.req.param('lang'); const category = ctx.req.param('category') || ''; const host = hostMap[lang]; diff --git a/lib/routes/wsj/router.js b/lib/routes/wsj/router.js index 9983d6adb2b2b6..0011c4977a28b2 100644 --- a/lib/routes/wsj/router.js +++ b/lib/routes/wsj/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:lang/:category?', './news'); }; diff --git a/lib/routes/wsyu/news.js b/lib/routes/wsyu/news.js index 85229c535ab604..3e71f5a13de3ce 100644 --- a/lib/routes/wsyu/news.js +++ b/lib/routes/wsyu/news.js @@ -20,7 +20,7 @@ const typeMap = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'xxyw'; const link = baseUrl + typeMap[type].url; const response = await got({ diff --git a/lib/routes/wsyu/router.js b/lib/routes/wsyu/router.js index 4880153cca019a..eb19f8f1f67ba3 100644 --- a/lib/routes/wsyu/router.js +++ b/lib/routes/wsyu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:type?', './news'); }; diff --git a/lib/routes/wtu/index.js b/lib/routes/wtu/index.js index c974d68a0038c2..1f10f65cce7a11 100644 --- a/lib/routes/wtu/index.js +++ b/lib/routes/wtu/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const apiUrl = 'https://ehall.wtu.edu.cn/wtu/api/queryBulletinListByConditional.do?pageNum=1&pageSize=20&columnId='; const listUrl = 'https://ehall.wtu.edu.cn/new/list.html?type='; const psgUrl = 'https://ehall.wtu.edu.cn/new/detail-word.html?'; diff --git a/lib/routes/wtu/job.js b/lib/routes/wtu/job.js index 55392c6ab4270b..32bafcff98c1af 100644 --- a/lib/routes/wtu/job.js +++ b/lib/routes/wtu/job.js @@ -34,7 +34,7 @@ function decodeData(str) { return content.toString('utf8').substring(substr2Num); } -module.exports = async (ctx) => { +export default async (ctx) => { // 获取参数 type const type = ctx.req.param('type'); const mapItem = typeMap.get(type); diff --git a/lib/routes/wtu/router.js b/lib/routes/wtu/router.js index 84f034036428ab..11bcbc1819109e 100644 --- a/lib/routes/wtu/router.js +++ b/lib/routes/wtu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:type', './index'); router.get('/job/:type', './job'); }; diff --git a/lib/routes/wyzxwk/article.js b/lib/routes/wyzxwk/article.js index fdd79f6b86107c..ebbd2cb4721fcb 100644 --- a/lib/routes/wyzxwk/article.js +++ b/lib/routes/wyzxwk/article.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'shidai'; const rootUrl = 'http://www.wyzxwk.com'; diff --git a/lib/routes/wyzxwk/router.js b/lib/routes/wyzxwk/router.js index 32413a4b4d137e..ac33a2762b29ba 100644 --- a/lib/routes/wyzxwk/router.js +++ b/lib/routes/wyzxwk/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/article/:id?', './article'); }; diff --git a/lib/routes/wzu/news.js b/lib/routes/wzu/news.js index a7105025c18a47..934b4df88d3780 100644 --- a/lib/routes/wzu/news.js +++ b/lib/routes/wzu/news.js @@ -49,7 +49,7 @@ async function loadContent(link) { return $('div[id^=vsb_content]').html(); } -module.exports = async (ctx) => { +export default async (ctx) => { // 获取路由 Tag const routeTag = Number.parseInt(ctx.req.param('type')) || 0; // 设定新闻标题及 Url diff --git a/lib/routes/wzu/router.js b/lib/routes/wzu/router.js index 4880153cca019a..eb19f8f1f67ba3 100644 --- a/lib/routes/wzu/router.js +++ b/lib/routes/wzu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/:type?', './news'); }; diff --git a/lib/routes/x-mol/news.js b/lib/routes/x-mol/news.js index 3948a409fee073..b481c756c71694 100644 --- a/lib/routes/x-mol/news.js +++ b/lib/routes/x-mol/news.js @@ -7,7 +7,7 @@ import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const tag = ctx.req.param('tag'); const urlPath = tag ? `news/tag/${tag}` : 'news/index'; const link = new URL(urlPath, utils.host).href; diff --git a/lib/routes/x-mol/paper.js b/lib/routes/x-mol/paper.js index d65c5445d867d1..0cc2ba52c17ded 100644 --- a/lib/routes/x-mol/paper.js +++ b/lib/routes/x-mol/paper.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const asyncPool = require('tiny-async-pool'); -module.exports = async (ctx) => { +export default async (ctx) => { const { type, magazine } = ctx.req.param(); const path = `paper/${type}/${magazine}`; const link = new URL(path, utils.host).href; diff --git a/lib/routes/x-mol/router.js b/lib/routes/x-mol/router.js index d47ad068799aa8..37bd14d0a8cb33 100644 --- a/lib/routes/x-mol/router.js +++ b/lib/routes/x-mol/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:tag?', './news'); router.get('/paper/:type/:magazine', './paper'); }; diff --git a/lib/routes/x6d/index.js b/lib/routes/x6d/index.js index 0f6e9055c28598..940e4c782b2f5a 100644 --- a/lib/routes/x6d/index.js +++ b/lib/routes/x6d/index.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'https://xd.x6d.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const { id = 'latest' } = ctx.req.param(); const currentUrl = id === 'latest' ? baseUrl : `${baseUrl}/html/${id}.html`; diff --git a/lib/routes/x6d/router.js b/lib/routes/x6d/router.js index e0420d96132fea..28cef7111ec14a 100644 --- a/lib/routes/x6d/router.js +++ b/lib/routes/x6d/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:id?', './index'); }; diff --git a/lib/routes/xaufe/jiaowu.js b/lib/routes/xaufe/jiaowu.js index 704ae4fc70bc0a..f586887bee95dc 100644 --- a/lib/routes/xaufe/jiaowu.js +++ b/lib/routes/xaufe/jiaowu.js @@ -16,7 +16,7 @@ const categories = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const pCategory = ctx.req.param('category'); const category = categories[pCategory] || categories.tzgg; diff --git a/lib/routes/xaufe/router.js b/lib/routes/xaufe/router.js index e9436409b3d3fc..5c986f5adc9d98 100644 --- a/lib/routes/xaufe/router.js +++ b/lib/routes/xaufe/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/jiaowu/:category?', './jiaowu'); }; diff --git a/lib/routes/xaut/index.js b/lib/routes/xaut/index.js index 9d7e8e2dfe9bfb..4feddb3b77baa8 100644 --- a/lib/routes/xaut/index.js +++ b/lib/routes/xaut/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { let category = ctx.req.param('category'); const dic_html = { tzgg: 'tzgg.htm', xyyw: 'xyyw.htm', mtbd: 'mtbd1.htm', xshd: 'xshd.htm' }; const dic_title = { tzgg: '通知公告', xyyw: '校园要闻', mtbd: '媒体播报', xshd: '学术活动' }; diff --git a/lib/routes/xaut/jwc.js b/lib/routes/xaut/jwc.js index c05da70656b261..44de7e5a5e5d1c 100644 --- a/lib/routes/xaut/jwc.js +++ b/lib/routes/xaut/jwc.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { let category = ctx.req.param('category'); const rootUrl = 'http://jwc.xaut.edu.cn/'; const dic_html = { tzgg: 'tzgg.htm', xwdt: 'xwdt.htm', gzzd: 'gzzd.htm', jggs: 'xkjs/jggs.htm', jsjg: 'xkjs/jsjg.htm', jsxx: 'xkjs/jsxx.htm', gkgs: 'gkgs.htm' }; diff --git a/lib/routes/xaut/router.js b/lib/routes/xaut/router.js index d12b5772ef9e93..5fca51f4b7cc32 100644 --- a/lib/routes/xaut/router.js +++ b/lib/routes/xaut/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/index/:category?', './index'); router.get('/jwc/:category?', './jwc'); router.get('/rsc/:category?', './rsc'); diff --git a/lib/routes/xaut/rsc.js b/lib/routes/xaut/rsc.js index 8a2218b2d434e7..e08f37b4289b8f 100644 --- a/lib/routes/xaut/rsc.js +++ b/lib/routes/xaut/rsc.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { let category = ctx.req.param('category'); // 这里的category是个形参 const dic_html = { tzgg: 'tzgg.htm', gzdt: 'gzdt.htm' }; diff --git a/lib/routes/xboxfan/news.js b/lib/routes/xboxfan/news.js index 97321e87eb911f..02fda23b0a5666 100644 --- a/lib/routes/xboxfan/news.js +++ b/lib/routes/xboxfan/news.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; import md5 from '@/utils/md5'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://xboxfan.com/'; const { data: response } = await got(baseUrl); const $ = load(response); diff --git a/lib/routes/xboxfan/router.js b/lib/routes/xboxfan/router.js index bc9de1afcadd9d..3c9877e17cb637 100644 --- a/lib/routes/xboxfan/router.js +++ b/lib/routes/xboxfan/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './news'); }; diff --git a/lib/routes/xiaohongshu/board.js b/lib/routes/xiaohongshu/board.js index a16f5381e8e1bb..113053c906e302 100644 --- a/lib/routes/xiaohongshu/board.js +++ b/lib/routes/xiaohongshu/board.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { getBoard } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://www.xiaohongshu.com/board/${ctx.req.param('board_id')}`; const main = await getBoard(url, cache); diff --git a/lib/routes/xiaohongshu/notes.js b/lib/routes/xiaohongshu/notes.js index dafa0ad315aae2..cb9bd0d2ac0431 100644 --- a/lib/routes/xiaohongshu/notes.js +++ b/lib/routes/xiaohongshu/notes.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getNotes, formatText, formatNote } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const userId = ctx.req.param('user_id'); const url = `https://www.xiaohongshu.com/user/profile/${userId}`; diff --git a/lib/routes/xiaohongshu/router.js b/lib/routes/xiaohongshu/router.js index 5345bff3b01aa9..fa25c16697d483 100644 --- a/lib/routes/xiaohongshu/router.js +++ b/lib/routes/xiaohongshu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/board/:board_id', './board'); router.get('/user/:user_id/notes/fulltext', './notes'); router.get('/user/:user_id/:category', './user'); diff --git a/lib/routes/xiaohongshu/user.js b/lib/routes/xiaohongshu/user.js index bdfe972fba1a3f..fd1678fd9ccadb 100644 --- a/lib/routes/xiaohongshu/user.js +++ b/lib/routes/xiaohongshu/user.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getUser } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const userId = ctx.req.param('user_id'); const category = ctx.req.param('category'); const url = `https://www.xiaohongshu.com/user/profile/${userId}`; diff --git a/lib/routes/xiaomiyoupin/crowdfunding.js b/lib/routes/xiaomiyoupin/crowdfunding.js index 08ebbe3c268f8b..76d43f3d521fc7 100644 --- a/lib/routes/xiaomiyoupin/crowdfunding.js +++ b/lib/routes/xiaomiyoupin/crowdfunding.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const base_url = 'https://m.xiaomiyoupin.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const resp = await got('https://home.mi.com/lasagne/page/5'); const site_url = resp.data.redirect.location; diff --git a/lib/routes/xiaomiyoupin/latest.js b/lib/routes/xiaomiyoupin/latest.js index 79bfb44b45858d..dbfebf5dceee18 100644 --- a/lib/routes/xiaomiyoupin/latest.js +++ b/lib/routes/xiaomiyoupin/latest.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { parseModule, parseFloorItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got('https://m.xiaomiyoupin.com/homepage/main/v1005'); const floors = parseModule(response.data.data.homepage.floors, 'product_hot'); const items = parseFloorItem(floors); diff --git a/lib/routes/xiaomiyoupin/router.js b/lib/routes/xiaomiyoupin/router.js index c58e92c73dda35..c28e3ad2dfb9d0 100644 --- a/lib/routes/xiaomiyoupin/router.js +++ b/lib/routes/xiaomiyoupin/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/crowdfunding', './crowdfunding'); router.get('/latest', './latest'); }; diff --git a/lib/routes/xiaote/index.js b/lib/routes/xiaote/index.js index eeb178d0a9b42d..5832bf322baca7 100644 --- a/lib/routes/xiaote/index.js +++ b/lib/routes/xiaote/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; // 自订的 got import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data } = await got.post('https://lcen.xiaote.net//api/graphql/', { json: { query: `query($startCursor: Int) { diff --git a/lib/routes/xiaote/router.js b/lib/routes/xiaote/router.js index d7bacbbfd15cdb..c037330e2d74a9 100644 --- a/lib/routes/xiaote/router.js +++ b/lib/routes/xiaote/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/news', './index'); }; diff --git a/lib/routes/xiaoyuzhou/pickup.js b/lib/routes/xiaoyuzhou/pickup.js index 4cfacb64a17c4d..8b2b98df556153 100644 --- a/lib/routes/xiaoyuzhou/pickup.js +++ b/lib/routes/xiaoyuzhou/pickup.js @@ -78,7 +78,7 @@ const ProcessFeed = async () => { }); }; -module.exports = async (ctx) => { +export default async (ctx) => { let resultItems = await cache.tryGet(XIAOYUZHOU_ITEMS, () => ProcessFeed()); if (!isToday(resultItems[0].pubDate)) { // force refresh cache diff --git a/lib/routes/xiaoyuzhou/podcast.js b/lib/routes/xiaoyuzhou/podcast.js index 3dfb02a13e8aa6..63e027c8d83531 100644 --- a/lib/routes/xiaoyuzhou/podcast.js +++ b/lib/routes/xiaoyuzhou/podcast.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `https://www.xiaoyuzhoufm.com/podcast/${ctx.req.param('id')}`; const response = await got({ method: 'get', diff --git a/lib/routes/xiaoyuzhou/router.js b/lib/routes/xiaoyuzhou/router.js index e5198ee991b5eb..d7037812a2ae48 100644 --- a/lib/routes/xiaoyuzhou/router.js +++ b/lib/routes/xiaoyuzhou/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/podcast/:id', './podcast'); router.get('/', './pickup'); }; diff --git a/lib/routes/xiaozhuanlan/column.js b/lib/routes/xiaozhuanlan/column.js index ea5b11b4be6926..5ff55ab7c9fca4 100644 --- a/lib/routes/xiaozhuanlan/column.js +++ b/lib/routes/xiaozhuanlan/column.js @@ -7,7 +7,7 @@ const md = require('markdown-it')({ }); const baseUrl = 'https://xiaozhuanlan.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const response = await got(`${baseUrl}/${id}`); diff --git a/lib/routes/xiaozhuanlan/router.js b/lib/routes/xiaozhuanlan/router.js index 6a4c63149766d9..ff71ac677995e9 100644 --- a/lib/routes/xiaozhuanlan/router.js +++ b/lib/routes/xiaozhuanlan/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/column/:id', './column'); }; diff --git a/lib/routes/xidian/jwc.js b/lib/routes/xidian/jwc.js index 5ff97adcff3220..6665a813758dbf 100644 --- a/lib/routes/xidian/jwc.js +++ b/lib/routes/xidian/jwc.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://jwc.xidian.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'tzgg' } = ctx.req.param(); const url = `${baseUrl}/${category}.htm`; const response = await got(url, { diff --git a/lib/routes/xidian/router.js b/lib/routes/xidian/router.js index f1f19b50b36e10..5db53bf7a3edcf 100644 --- a/lib/routes/xidian/router.js +++ b/lib/routes/xidian/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/jwc/:category?', './jwc'); }; diff --git a/lib/routes/ximalaya/album.js b/lib/routes/ximalaya/album.js index 8de603628e2b35..27d51d5e023f8a 100644 --- a/lib/routes/ximalaya/album.js +++ b/lib/routes/ximalaya/album.js @@ -80,7 +80,7 @@ function judgeTrue(str, ...validStrings) { return false; } -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); // 专辑分类 const id = ctx.req.param('id'); // 专辑id const shouldAll = judgeTrue(ctx.req.param('all'), 'all'); diff --git a/lib/routes/ximalaya/router.js b/lib/routes/ximalaya/router.js index 06b9b68d1537c7..8fc1a95fe7bcfc 100644 --- a/lib/routes/ximalaya/router.js +++ b/lib/routes/ximalaya/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/:type/:id/:all?', './album'); router.get('/:type/:id/:all/:shownote?', './album'); }; diff --git a/lib/routes/xinpianchang/index.js b/lib/routes/xinpianchang/index.js index b926dfc614cbec..040da489dd677b 100644 --- a/lib/routes/xinpianchang/index.js +++ b/lib/routes/xinpianchang/index.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, getData, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { params = 'article-0-0-all-all-0-0-score' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 60; diff --git a/lib/routes/xinpianchang/rank.js b/lib/routes/xinpianchang/rank.js index bbcfddc7ad8cac..a81fc1e14da034 100644 --- a/lib/routes/xinpianchang/rank.js +++ b/lib/routes/xinpianchang/rank.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { rootUrl, getData, processItems } = require('./util'); -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'all' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 60; diff --git a/lib/routes/xinpianchang/router.js b/lib/routes/xinpianchang/router.js index 9f04d6491e3f17..b9aa89d218dc77 100644 --- a/lib/routes/xinpianchang/router.js +++ b/lib/routes/xinpianchang/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/discover/:params?', './'); router.get('/rank/:category?', './rank'); router.get('/:params?', './'); diff --git a/lib/routes/xjtu/2yuan/news.js b/lib/routes/xjtu/2yuan/news.js index 09f3395da9bae4..3608e6fe6c8b22 100644 --- a/lib/routes/xjtu/2yuan/news.js +++ b/lib/routes/xjtu/2yuan/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '110'; const rootUrl = 'http://2yuan.xjtu.edu.cn'; diff --git a/lib/routes/xjtu/dean.js b/lib/routes/xjtu/dean.js index a38efa5aabe6b7..68a160465d5676 100644 --- a/lib/routes/xjtu/dean.js +++ b/lib/routes/xjtu/dean.js @@ -29,7 +29,7 @@ const parseContent = (htmlString) => { }; }; -module.exports = async (ctx) => { +export default async (ctx) => { const subpath = ctx.req.param('subpath'); const url = `http://dean.xjtu.edu.cn/${subpath.replaceAll('.htm', '')}.htm`; diff --git a/lib/routes/xjtu/dyyy/index.js b/lib/routes/xjtu/dyyy/index.js index 059607a5194797..8855117d7a3072 100644 --- a/lib/routes/xjtu/dyyy/index.js +++ b/lib/routes/xjtu/dyyy/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const baseUrl = 'http://www.dyyy.xjtu.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const path = ctx.req.param('path'); const response = await got(`${baseUrl}/${path}.htm`); diff --git a/lib/routes/xjtu/ee.js b/lib/routes/xjtu/ee.js index 75fcf77acd39a5..c20c4068aaebe9 100644 --- a/lib/routes/xjtu/ee.js +++ b/lib/routes/xjtu/ee.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '1124'; const rootUrl = `http://ee.xjtu.edu.cn/list.jsp?urltype=tree.TreeTempUrl&wbtreeid=${id}`; const baseUrl = 'http://ee.xjtu.edu.cn'; diff --git a/lib/routes/xjtu/gs/tzgg.js b/lib/routes/xjtu/gs/tzgg.js index eb6e7a6baaa0dd..a7708c0100bd93 100644 --- a/lib/routes/xjtu/gs/tzgg.js +++ b/lib/routes/xjtu/gs/tzgg.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://gs.xjtu.edu.cn/tzgg.htm'; const response = await got({ method: 'get', diff --git a/lib/routes/xjtu/international.js b/lib/routes/xjtu/international.js index d13d531f3ac20b..d248c874a632f2 100644 --- a/lib/routes/xjtu/international.js +++ b/lib/routes/xjtu/international.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const subpath = ctx.req.param('subpath'); const base = 'http://international.xjtu.edu.cn'; diff --git a/lib/routes/xjtu/job.js b/lib/routes/xjtu/job.js index 155248e1b1ca4b..5944e63a431602 100644 --- a/lib/routes/xjtu/job.js +++ b/lib/routes/xjtu/job.js @@ -15,7 +15,7 @@ const arr = { jysx: '就业实习', }; -module.exports = async (ctx) => { +export default async (ctx) => { const subpath = ctx.req.param('subpath') ?? 'zxgg'; const getTzgg = await got.post(`${baseUrl}/xsfw/sys/jyxtgktapp/modules/jywzManage/getTzgg.do`, { form: { diff --git a/lib/routes/xjtu/router.js b/lib/routes/xjtu/router.js index b7c301f88237e4..4607c5e8a73500 100644 --- a/lib/routes/xjtu/router.js +++ b/lib/routes/xjtu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/2yuan/news/:id?', './2yuan/news'); router.get('/dean/:subpath+', './dean'); router.get('/dyyy/:path+', './dyyy/index'); diff --git a/lib/routes/xjtu/std.js b/lib/routes/xjtu/std.js index 9f4047faaf6f59..e80b836798696c 100644 --- a/lib/routes/xjtu/std.js +++ b/lib/routes/xjtu/std.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'http://std.xjtu.edu.cn'; diff --git a/lib/routes/xkb/index.js b/lib/routes/xkb/index.js index b85975f4432e39..9ebc02d7640886 100644 --- a/lib/routes/xkb/index.js +++ b/lib/routes/xkb/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const channel = ctx.req.param('channel') ?? 350; const currentUrl = `https://www.xkb.com.cn/xkbapp/fundapi/article/api/articles?chnlId=${channel}&visibility=1&page=0&size=20&keyword=`; diff --git a/lib/routes/xkb/router.js b/lib/routes/xkb/router.js index 91df4fbcd3a5ab..2a73869aae89b4 100644 --- a/lib/routes/xkb/router.js +++ b/lib/routes/xkb/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:channel', './index'); }; diff --git a/lib/routes/xmanhua/index.js b/lib/routes/xmanhua/index.js index f005be4297276a..e02f4d65ad717c 100644 --- a/lib/routes/xmanhua/index.js +++ b/lib/routes/xmanhua/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); const host = 'https://xmanhua.com'; const url = `https://xmanhua.com/${uid}/`; diff --git a/lib/routes/xmanhua/router.js b/lib/routes/xmanhua/router.js index 30ef947c4460b3..0476ba3dca2f26 100644 --- a/lib/routes/xmanhua/router.js +++ b/lib/routes/xmanhua/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:uid', './index'); }; diff --git a/lib/routes/xmnn/epaper.js b/lib/routes/xmnn/epaper.js index b366161afda1bd..5c75893d879707 100644 --- a/lib/routes/xmnn/epaper.js +++ b/lib/routes/xmnn/epaper.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'xmrb'; const rootUrl = 'https://epaper.xmnn.cn'; diff --git a/lib/routes/xmnn/news.js b/lib/routes/xmnn/news.js index c155d01cc72c89..6dbeff90e425f5 100644 --- a/lib/routes/xmnn/news.js +++ b/lib/routes/xmnn/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'xmxw' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/xmnn/router.js b/lib/routes/xmnn/router.js index 5f5fe2af395fec..bff855ea4bd7ec 100644 --- a/lib/routes/xmnn/router.js +++ b/lib/routes/xmnn/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/epaper/:id?', './epaper'); router.get('/news/:category*', './news'); }; diff --git a/lib/routes/xmut/jwc/bkjw.js b/lib/routes/xmut/jwc/bkjw.js index bb34ffeb2fcef2..2aae4fbcfc6f38 100644 --- a/lib/routes/xmut/jwc/bkjw.js +++ b/lib/routes/xmut/jwc/bkjw.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const xmut = 'https://jwc.xmut.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'jwxt' } = ctx.req.param(); const url = `${xmut}/index/tzgg/${category}.htm`; const res = await got(url, { diff --git a/lib/routes/xmut/jwc/yjs.js b/lib/routes/xmut/jwc/yjs.js index 0713522f57f9b3..9a6d054de3e173 100644 --- a/lib/routes/xmut/jwc/yjs.js +++ b/lib/routes/xmut/jwc/yjs.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const xmut = 'https://yjs.xmut.edu.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'yjsc' } = ctx.req.param(); const url = `${xmut}/index/${category}.htm`; const res = await got(url, { diff --git a/lib/routes/xmut/router.js b/lib/routes/xmut/router.js index f9f4df84943b76..831c6353ff9c1f 100644 --- a/lib/routes/xmut/router.js +++ b/lib/routes/xmut/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/jwc/bkjw/:category?', './jwc/bkjw.js'); router.get('/jwc/yjjw/:category?', './jwc/yjs.js'); }; diff --git a/lib/routes/xsijishe/forum.js b/lib/routes/xsijishe/forum.js index b178f7b3dac4a2..a4d8a44ad2ed47 100644 --- a/lib/routes/xsijishe/forum.js +++ b/lib/routes/xsijishe/forum.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://xsijishe.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const fid = ctx.req.param('fid'); const url = `${baseUrl}/forum-${fid}-1.html`; const resp = await got(url); diff --git a/lib/routes/xsijishe/rank.js b/lib/routes/xsijishe/rank.js index 2a836dc0bbfae3..c486e78bb2e688 100644 --- a/lib/routes/xsijishe/rank.js +++ b/lib/routes/xsijishe/rank.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const baseUrl = 'https://xsijishe.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const rankType = ctx.req.param('type'); let title; let rankId; diff --git a/lib/routes/xsijishe/router.js b/lib/routes/xsijishe/router.js index 8a5a3651be5dc9..a9e0419b5cc6d5 100644 --- a/lib/routes/xsijishe/router.js +++ b/lib/routes/xsijishe/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/forum/:fid', './forum'); router.get('/rank/:type', './rank'); }; diff --git a/lib/routes/xueqiu/column.js b/lib/routes/xueqiu/column.js index bcedd504eb50a6..78a2922391d0f5 100644 --- a/lib/routes/xueqiu/column.js +++ b/lib/routes/xueqiu/column.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const cookieJar = new CookieJar(); const baseUrl = 'https://xueqiu.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const pageUrl = `${baseUrl}/${id}/column`; diff --git a/lib/routes/xueqiu/favorite.js b/lib/routes/xueqiu/favorite.js index dfd2a698aeae29..67c8c2cb0ab2d0 100644 --- a/lib/routes/xueqiu/favorite.js +++ b/lib/routes/xueqiu/favorite.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const res1 = await got({ diff --git a/lib/routes/xueqiu/fund.js b/lib/routes/xueqiu/fund.js index 4cd13990640acf..7ec01d5f12ea63 100644 --- a/lib/routes/xueqiu/fund.js +++ b/lib/routes/xueqiu/fund.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const guid = ctx.req.param('id'); const appUrl = `https://danjuanapp.com/funding/${guid}`; const url = `https://danjuanapp.com/djapi/fund/${guid}`; diff --git a/lib/routes/xueqiu/hots.js b/lib/routes/xueqiu/hots.js index f0afea7189c800..dce5c896615171 100644 --- a/lib/routes/xueqiu/hots.js +++ b/lib/routes/xueqiu/hots.js @@ -3,7 +3,7 @@ import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; const sanitizeHtml = require('sanitize-html'); -module.exports = async (ctx) => { +export default async (ctx) => { const res1 = await got({ method: 'get', url: 'https://xueqiu.com/', diff --git a/lib/routes/xueqiu/router.js b/lib/routes/xueqiu/router.js index 23aff9fd921290..8c1797cd0124b2 100644 --- a/lib/routes/xueqiu/router.js +++ b/lib/routes/xueqiu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/column/:id', './column'); router.get('/favorite/:id', './favorite'); router.get('/fund/:id', './fund'); diff --git a/lib/routes/xueqiu/snb.js b/lib/routes/xueqiu/snb.js index aa3f03d291420c..d0ebbb309d39e2 100644 --- a/lib/routes/xueqiu/snb.js +++ b/lib/routes/xueqiu/snb.js @@ -4,7 +4,7 @@ import randUserAgent from '@/utils/rand-user-agent'; const UA = randUserAgent({ browser: 'chrome', os: 'android', device: 'mobile' }); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const url = 'https://xueqiu.com/p/' + id; diff --git a/lib/routes/xueqiu/stock-comments.js b/lib/routes/xueqiu/stock-comments.js index 4fe3960b00271c..35ed0fd18cd15d 100644 --- a/lib/routes/xueqiu/stock-comments.js +++ b/lib/routes/xueqiu/stock-comments.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const sanitizeHtml = require('sanitize-html'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const res = await got({ diff --git a/lib/routes/xueqiu/stock-info.js b/lib/routes/xueqiu/stock-info.js index 98e97f48940b30..3093b2e330d743 100644 --- a/lib/routes/xueqiu/stock-info.js +++ b/lib/routes/xueqiu/stock-info.js @@ -4,7 +4,7 @@ import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; const sanitizeHtml = require('sanitize-html'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const type = ctx.req.param('type') || 'announcement'; const count = 10; diff --git a/lib/routes/xueqiu/today.js b/lib/routes/xueqiu/today.js index fb3f76ecd70e4d..0ab616124f7205 100644 --- a/lib/routes/xueqiu/today.js +++ b/lib/routes/xueqiu/today.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const size = ctx.req.query('limit') ?? '20'; const rootUrl = 'https://xueqiu.com'; diff --git a/lib/routes/xueqiu/user-stock.js b/lib/routes/xueqiu/user-stock.js index 5471b6a35593d2..e3e4c69d89a14f 100644 --- a/lib/routes/xueqiu/user-stock.js +++ b/lib/routes/xueqiu/user-stock.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import queryString from 'query-string'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const res1 = await got({ diff --git a/lib/routes/xueqiu/user.js b/lib/routes/xueqiu/user.js index f2a758e84b6b02..c2d4e8fb555375 100644 --- a/lib/routes/xueqiu/user.js +++ b/lib/routes/xueqiu/user.js @@ -6,7 +6,7 @@ const sanitizeHtml = require('sanitize-html'); const rootUrl = 'https://xueqiu.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const type = ctx.req.param('type') || 10; const source = type === '11' ? '买卖' : ''; diff --git a/lib/routes/xunhupay/index.js b/lib/routes/xunhupay/index.js index 8d69ca1e3f03e0..ecbc10c67f0b7d 100644 --- a/lib/routes/xunhupay/index.js +++ b/lib/routes/xunhupay/index.js @@ -1,7 +1,7 @@ import buildData from '@/utils/common-config'; const baseUrl = 'https://www.xunhupay.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = `${baseUrl}/blog.html`; ctx.set( 'data', diff --git a/lib/routes/xunhupay/router.js b/lib/routes/xunhupay/router.js index 54bb430679dbd0..a9a35b9bc33206 100644 --- a/lib/routes/xunhupay/router.js +++ b/lib/routes/xunhupay/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/blog', './index'); }; diff --git a/lib/routes/xys/new.js b/lib/routes/xys/new.js index affc1d214b430d..df2b8ecb767084 100644 --- a/lib/routes/xys/new.js +++ b/lib/routes/xys/new.js @@ -6,7 +6,7 @@ import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://www.xys.org'; const currentUrl = `${rootUrl}/new.html`; diff --git a/lib/routes/xys/router.js b/lib/routes/xys/router.js index 31d087779c5ae9..b850a6c370994e 100644 --- a/lib/routes/xys/router.js +++ b/lib/routes/xys/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/new', './new'); }; diff --git a/lib/routes/xyzrank/index.js b/lib/routes/xyzrank/index.js index 37c69a1c16b91c..65bd7bb7ec0bf0 100644 --- a/lib/routes/xyzrank/index.js +++ b/lib/routes/xyzrank/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? ''; const rootUrl = 'https://xyzrank.com'; diff --git a/lib/routes/xyzrank/router.js b/lib/routes/xyzrank/router.js index bb933866690784..0bcd82a5c2aa19 100644 --- a/lib/routes/xyzrank/router.js +++ b/lib/routes/xyzrank/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './index'); }; diff --git a/lib/routes/yahoo/news/tw/index.js b/lib/routes/yahoo/news/tw/index.js index 68f6c4391532cd..4ce62fff55d974 100644 --- a/lib/routes/yahoo/news/tw/index.js +++ b/lib/routes/yahoo/news/tw/index.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getArchive, getCategories, parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { region, category } = ctx.req.param(); if (!['hk', 'tw'].includes(region)) { throw new Error(`Unknown region: ${region}`); diff --git a/lib/routes/yahoo/news/tw/provider-helper.js b/lib/routes/yahoo/news/tw/provider-helper.js index a88ccdfe2294e0..0a0cf9edf0f651 100644 --- a/lib/routes/yahoo/news/tw/provider-helper.js +++ b/lib/routes/yahoo/news/tw/provider-helper.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getProviderList } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const region = ctx.req.param('region'); if (!['hk', 'tw'].includes(region)) { throw new Error(`Unknown region: ${region}`); diff --git a/lib/routes/yahoo/news/tw/provider.js b/lib/routes/yahoo/news/tw/provider.js index 57b915f7d223b4..0ae5869f3dd326 100644 --- a/lib/routes/yahoo/news/tw/provider.js +++ b/lib/routes/yahoo/news/tw/provider.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getArchive, getProviderList, parseList, parseItem } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { region, providerId } = ctx.req.param(); if (!['hk', 'tw'].includes(region)) { throw new Error(`Unknown region: ${region}`); diff --git a/lib/routes/yahoo/news/us/index.js b/lib/routes/yahoo/news/us/index.js index b8717291c2cce7..cc38da57c86e02 100644 --- a/lib/routes/yahoo/news/us/index.js +++ b/lib/routes/yahoo/news/us/index.js @@ -4,7 +4,7 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const region = ctx.req.param('region') === 'en' ? '' : ctx.req.param('region').toLowerCase(); if (!isValidHost(region) && region !== '') { throw new Error('Invalid region'); diff --git a/lib/routes/yahoo/router.js b/lib/routes/yahoo/router.js index 40f4efbdc4964f..a6b20680956820 100644 --- a/lib/routes/yahoo/router.js +++ b/lib/routes/yahoo/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/news/en/:category?', './news/us/index'); router.get('/news/provider/:region/:providerId', './news/tw/provider'); router.get('/news/providers/:region', './news/tw/provider-helper'); diff --git a/lib/routes/yangtzeu/dongke.js b/lib/routes/yangtzeu/dongke.js index 5002a7a958b2a7..7cd6b3517d3e9d 100644 --- a/lib/routes/yangtzeu/dongke.js +++ b/lib/routes/yangtzeu/dongke.js @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 10; const rootUrl = 'https://dongke.yangtzeu.edu.cn'; diff --git a/lib/routes/yangtzeu/router.js b/lib/routes/yangtzeu/router.js index a426379d10577e..2136ea0411289b 100644 --- a/lib/routes/yangtzeu/router.js +++ b/lib/routes/yangtzeu/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/dongke/*', './dongke'); }; diff --git a/lib/routes/ycwb/index.js b/lib/routes/ycwb/index.js index 7fe2b115e8503a..9386a0d560e5c4 100644 --- a/lib/routes/ycwb/index.js +++ b/lib/routes/ycwb/index.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const node = ctx.req.param('node') ?? 1; const currentUrl = `https://6api.ycwb.com/app_if/jy/getArticles?nodeid=${node}&pagesize=15`; diff --git a/lib/routes/ycwb/router.js b/lib/routes/ycwb/router.js index 1256b8dae378a1..783379f3ed143e 100644 --- a/lib/routes/ycwb/router.js +++ b/lib/routes/ycwb/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:node', './index'); }; diff --git a/lib/routes/yicai/author.js b/lib/routes/yicai/author.js index 0e3f6d247b9977..703144e111c803 100644 --- a/lib/routes/yicai/author.js +++ b/lib/routes/yicai/author.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '100005663'; const currentUrl = `${rootUrl}/author/${id}.html`; diff --git a/lib/routes/yicai/brief.js b/lib/routes/yicai/brief.js index 522dd9d2cf57e3..200e221ca0dbc3 100644 --- a/lib/routes/yicai/brief.js +++ b/lib/routes/yicai/brief.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; const { rootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/brief`; const apiUrl = `${rootUrl}/api/ajax/getbrieflist?type=0&page=1&pagesize=${ctx.req.query('limit') ?? 50}`; diff --git a/lib/routes/yicai/dt.js b/lib/routes/yicai/dt.js index 5d514f2ada7a11..ce896a08dc78f8 100644 --- a/lib/routes/yicai/dt.js +++ b/lib/routes/yicai/dt.js @@ -11,7 +11,7 @@ const columns = { visualization: 4, }; -module.exports = async (ctx) => { +export default async (ctx) => { const { column = 'article', category = '0' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 30; diff --git a/lib/routes/yicai/feed.js b/lib/routes/yicai/feed.js index 8607127d30515c..1b330bbf1f89c4 100644 --- a/lib/routes/yicai/feed.js +++ b/lib/routes/yicai/feed.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '669'; const currentUrl = `${rootUrl}/feed/${id}`; diff --git a/lib/routes/yicai/headline.js b/lib/routes/yicai/headline.js index 324309d243fd57..93bd48bdd7a4d3 100644 --- a/lib/routes/yicai/headline.js +++ b/lib/routes/yicai/headline.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const apiUrl = `${rootUrl}/api/ajax/getlistbycid?cid=48&type=1&page=1&pagesize=${ctx.req.query('limit') ?? 30}`; const items = await ProcessItems(apiUrl, cache.tryGet); diff --git a/lib/routes/yicai/latest.js b/lib/routes/yicai/latest.js index 175d19141d3806..d94e78b9871b8c 100644 --- a/lib/routes/yicai/latest.js +++ b/lib/routes/yicai/latest.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const apiUrl = `${rootUrl}/api/ajax/getlatest?page=1&pagesize=${ctx.req.query('limit') ?? 30}`; const items = await ProcessItems(apiUrl, cache.tryGet); diff --git a/lib/routes/yicai/news.js b/lib/routes/yicai/news.js index 7bf9ac86342499..4cdd59806a6ed6 100644 --- a/lib/routes/yicai/news.js +++ b/lib/routes/yicai/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; let channel; diff --git a/lib/routes/yicai/router.js b/lib/routes/yicai/router.js index b4ca04549afe51..14fffd19d75812 100644 --- a/lib/routes/yicai/router.js +++ b/lib/routes/yicai/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/author/:id?', './author'); router.get('/brief', './brief'); router.get('/dt/:column?/:category?', './dt'); diff --git a/lib/routes/yicai/video.js b/lib/routes/yicai/video.js index 6c699cd7489d4b..ff88d8a96bcefd 100644 --- a/lib/routes/yicai/video.js +++ b/lib/routes/yicai/video.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; let channel; diff --git a/lib/routes/yicai/vip.js b/lib/routes/yicai/vip.js index 1fa65936fd65c4..eb77a2253717e8 100644 --- a/lib/routes/yicai/vip.js +++ b/lib/routes/yicai/vip.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const { rootUrl, ProcessItems } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? '428'; const currentUrl = `${rootUrl}/vip/product/${id}`; diff --git a/lib/routes/ymgal/article.js b/lib/routes/ymgal/article.js index 8e60c20a3e5623..dd7c56c758c8b6 100644 --- a/lib/routes/ymgal/article.js +++ b/lib/routes/ymgal/article.js @@ -11,7 +11,7 @@ const types = { column: '?type=COLUMN&page=1', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') || 'all'; const link = `${host}/co/topic/list` + types[type]; diff --git a/lib/routes/ymgal/game.js b/lib/routes/ymgal/game.js index 13a3d21eecee6a..c366f7cc98721e 100644 --- a/lib/routes/ymgal/game.js +++ b/lib/routes/ymgal/game.js @@ -9,7 +9,7 @@ const date = new Date(); const year = date.getFullYear(); const month = date.getMonth() + 1; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: `${host}/release-list/${year}/${month}`, diff --git a/lib/routes/ymgal/router.js b/lib/routes/ymgal/router.js index 6d9cc07a2d1718..054388b773ba52 100644 --- a/lib/routes/ymgal/router.js +++ b/lib/routes/ymgal/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/article/:type?', './article'); router.get('/game/release', './game'); }; diff --git a/lib/routes/yoasobi-music/info.js b/lib/routes/yoasobi-music/info.js index 24e2717145dbda..482237f251a81c 100644 --- a/lib/routes/yoasobi-music/info.js +++ b/lib/routes/yoasobi-music/info.js @@ -4,7 +4,7 @@ const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const ARTIST = 'YOASOBI', diff --git a/lib/routes/yoasobi-music/live.js b/lib/routes/yoasobi-music/live.js index 9827308626ec98..670798035962ac 100644 --- a/lib/routes/yoasobi-music/live.js +++ b/lib/routes/yoasobi-music/live.js @@ -3,7 +3,7 @@ const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const ARTIST = 'YOASOBI', SONYJPURL = 'https://www.sonymusic.co.jp', BASEURL = 'https://www.sonymusic.co.jp/json/v2/artist', diff --git a/lib/routes/yoasobi-music/media.js b/lib/routes/yoasobi-music/media.js index 080f889c9f775a..d9f233ef187fb1 100644 --- a/lib/routes/yoasobi-music/media.js +++ b/lib/routes/yoasobi-music/media.js @@ -3,7 +3,7 @@ const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const ARTIST = 'YOASOBI', BASEURL = 'https://www.sonymusic.co.jp/json/v2/artist', POSTFIX = 'start/0/count/-1'; diff --git a/lib/routes/yoasobi-music/router.js b/lib/routes/yoasobi-music/router.js index fc3f848e95cd5c..09629a1dfc1987 100644 --- a/lib/routes/yoasobi-music/router.js +++ b/lib/routes/yoasobi-music/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/info/:category?', './info'); // news, biography router.get('/live', './live'); router.get('/media', './media'); diff --git a/lib/routes/yomiuri/news.js b/lib/routes/yomiuri/news.js index 93c0f85a03e05d..d3ab637cd9abb0 100644 --- a/lib/routes/yomiuri/news.js +++ b/lib/routes/yomiuri/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'news' } = ctx.req.param(); const url = `https://www.yomiuri.co.jp/${category}`; diff --git a/lib/routes/yomiuri/router.js b/lib/routes/yomiuri/router.js index 30a6a8617dd417..009a87867aaf07 100644 --- a/lib/routes/yomiuri/router.js +++ b/lib/routes/yomiuri/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category?', './news'); }; diff --git a/lib/routes/yomujp/level.js b/lib/routes/yomujp/level.js index c5a9a962220999..b6c16de43c56c8 100644 --- a/lib/routes/yomujp/level.js +++ b/lib/routes/yomujp/level.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import md5 from '@/utils/md5'; -module.exports = async (ctx) => { +export default async (ctx) => { const level = formatLevel(ctx.req.param('level')); const url = new URL('https://yomujp.com/wp-json/wp/v2/posts'); url.searchParams.append('categories', getLevel(level)); diff --git a/lib/routes/yomujp/router.js b/lib/routes/yomujp/router.js index 25a079728162d2..abe5e167a16436 100644 --- a/lib/routes/yomujp/router.js +++ b/lib/routes/yomujp/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:level?', './level'); }; diff --git a/lib/routes/youku/channel.js b/lib/routes/youku/channel.js index 50233b393c10ee..b2899e026101c5 100644 --- a/lib/routes/youku/channel.js +++ b/lib/routes/youku/channel.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const channelId = ctx.req.param('channelId'); const embed = !ctx.req.param('embed'); diff --git a/lib/routes/youku/router.js b/lib/routes/youku/router.js index 70e13875fb2e3b..a9848bcad38a48 100644 --- a/lib/routes/youku/router.js +++ b/lib/routes/youku/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/channel/:channelId/:embed?', './channel'); }; diff --git a/lib/routes/youtube/channel.js b/lib/routes/youtube/channel.js index 49c785ca99daaa..d90ad563f59924 100644 --- a/lib/routes/youtube/channel.js +++ b/lib/routes/youtube/channel.js @@ -3,7 +3,7 @@ const utils = require('./utils'); import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.youtube || !config.youtube.key) { throw new Error('YouTube RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/youtube/charts.js b/lib/routes/youtube/charts.js index 697d6399fcfae2..19af0e2069d3d2 100644 --- a/lib/routes/youtube/charts.js +++ b/lib/routes/youtube/charts.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const { renderDescription } = require('./utils'); import { config } from '@/config'; -module.exports = async (ctx) => { +export default async (ctx) => { const contentMap = { TopArtists: { contentKey: 'artists', diff --git a/lib/routes/youtube/community.js b/lib/routes/youtube/community.js index bdce5716b890fd..2599fef531dae4 100644 --- a/lib/routes/youtube/community.js +++ b/lib/routes/youtube/community.js @@ -5,7 +5,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const { isYouTubeChannelId } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const handle = ctx.req.param('handle'); let urlPath = handle; diff --git a/lib/routes/youtube/custom.js b/lib/routes/youtube/custom.js index f5b32bc5f39aff..8a76ca4234d6e1 100644 --- a/lib/routes/youtube/custom.js +++ b/lib/routes/youtube/custom.js @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.youtube || !config.youtube.key) { throw new Error('YouTube RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/youtube/live.js b/lib/routes/youtube/live.js index 0aa0872a847914..a7b7c6cec3dde0 100644 --- a/lib/routes/youtube/live.js +++ b/lib/routes/youtube/live.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.youtube || !config.youtube.key) { throw new Error('YouTube RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/youtube/playlist.js b/lib/routes/youtube/playlist.js index a7a3531597e33b..57ac4664e1e97b 100644 --- a/lib/routes/youtube/playlist.js +++ b/lib/routes/youtube/playlist.js @@ -3,7 +3,7 @@ const utils = require('./utils'); import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.youtube || !config.youtube.key) { throw new Error('YouTube RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/youtube/router.js b/lib/routes/youtube/router.js index d5b4da60d2e348..d303216588f06b 100644 --- a/lib/routes/youtube/router.js +++ b/lib/routes/youtube/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/c/:username/:embed?', './custom'); router.get('/channel/:id/:embed?', './channel'); router.get('/charts/:category?/:country?/:embed?', './charts'); diff --git a/lib/routes/youtube/subscriptions.js b/lib/routes/youtube/subscriptions.js index a8225b8fb50203..356743b540c4be 100644 --- a/lib/routes/youtube/subscriptions.js +++ b/lib/routes/youtube/subscriptions.js @@ -4,7 +4,7 @@ const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; const asyncPool = require('tiny-async-pool'); -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.youtube || !config.youtube.key || !config.youtube.clientId || !config.youtube.clientSecret || !config.youtube.refreshToken) { throw new Error('YouTube RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/youtube/user.js b/lib/routes/youtube/user.js index a88056c16e345b..6038a22271df4e 100644 --- a/lib/routes/youtube/user.js +++ b/lib/routes/youtube/user.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { if (!config.youtube || !config.youtube.key) { throw new Error('YouTube RSS is disabled due to the lack of relevant config'); } diff --git a/lib/routes/youzhiyouxing/materials.js b/lib/routes/youzhiyouxing/materials.js index 15880f85e489db..d7aa18427cd6ff 100644 --- a/lib/routes/youzhiyouxing/materials.js +++ b/lib/routes/youzhiyouxing/materials.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? ''; const rootUrl = 'https://youzhiyouxing.cn'; diff --git a/lib/routes/youzhiyouxing/router.js b/lib/routes/youzhiyouxing/router.js index ed8f2497fcea24..bf8cc03fb1e577 100644 --- a/lib/routes/youzhiyouxing/router.js +++ b/lib/routes/youzhiyouxing/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/materials/:id?', './materials'); }; diff --git a/lib/routes/yuque/book.js b/lib/routes/yuque/book.js index a802f2fa52dea8..24f18b45fd0ec0 100644 --- a/lib/routes/yuque/book.js +++ b/lib/routes/yuque/book.js @@ -8,7 +8,7 @@ const { CookieJar } = require('tough-cookie'); const APP_DATA_REGEX = /window\.appData = JSON\.parse\(decodeURIComponent\("(.+?)"\)\);/; const baseUrl = 'https://www.yuque.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const cookieJar = new CookieJar(); const { name, book } = ctx.req.param(); const bookUrl = `${baseUrl}/${name}/${book}`; diff --git a/lib/routes/yuque/router.js b/lib/routes/yuque/router.js index ca8ff327c5f063..b91e721c33d2f0 100644 --- a/lib/routes/yuque/router.js +++ b/lib/routes/yuque/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:name/:book', './book'); }; diff --git a/lib/routes/yxdown/news.js b/lib/routes/yxdown/news.js index 560bdd73803765..3b7838fe38e768 100644 --- a/lib/routes/yxdown/news.js +++ b/lib/routes/yxdown/news.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; const { rootUrl, getCookie } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ? `${ctx.req.param('category')}/` : ''; const currentUrl = `${rootUrl}/news/${category}`; diff --git a/lib/routes/yxdown/recommend.js b/lib/routes/yxdown/recommend.js index 9c07a9eeb28b37..4576bc3a04c4f8 100644 --- a/lib/routes/yxdown/recommend.js +++ b/lib/routes/yxdown/recommend.js @@ -5,7 +5,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; const { rootUrl, getCookie } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const currentUrl = `${rootUrl}/news/`; const cookie = await getCookie(); const response = await got(currentUrl, { diff --git a/lib/routes/yxdown/router.js b/lib/routes/yxdown/router.js index 248a8af6a45e98..506a52daae1266 100644 --- a/lib/routes/yxdown/router.js +++ b/lib/routes/yxdown/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/news/:category?', './news'); router.get('/recommend', './recommend'); }; diff --git a/lib/routes/yxdzqb/index.js b/lib/routes/yxdzqb/index.js index d84328d9ab37d5..0dbf96a6beb6d8 100644 --- a/lib/routes/yxdzqb/index.js +++ b/lib/routes/yxdzqb/index.js @@ -13,7 +13,7 @@ const map = { low_chinese: 'index_low_cn.html', }; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const link = `${host}/${Object.hasOwn(map, type) ? map[type] : `index_${type}.html`}`; diff --git a/lib/routes/yxdzqb/router.js b/lib/routes/yxdzqb/router.js index 8f960ec65963e1..e5d24c7d995d3b 100644 --- a/lib/routes/yxdzqb/router.js +++ b/lib/routes/yxdzqb/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type', './index'); }; diff --git a/lib/routes/yxrb/home.js b/lib/routes/yxrb/home.js index f867a25cdb578f..4f714f2974ceb5 100644 --- a/lib/routes/yxrb/home.js +++ b/lib/routes/yxrb/home.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseUrl = 'http://news.yxrb.net'; -module.exports = async (ctx) => { +export default async (ctx) => { const { category = 'info' } = ctx.req.param(); const link = `${baseUrl}/${category}/`; const response = await got(link); diff --git a/lib/routes/yxrb/router.js b/lib/routes/yxrb/router.js index a4144c03c0b83d..4f0c310e082c01 100644 --- a/lib/routes/yxrb/router.js +++ b/lib/routes/yxrb/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:category?', './home'); }; diff --git a/lib/routes/yyets/article.js b/lib/routes/yyets/article.js index 20da2d07a73952..563ba9ee967d2f 100644 --- a/lib/routes/yyets/article.js +++ b/lib/routes/yyets/article.js @@ -6,7 +6,7 @@ import timezone from '@/utils/timezone'; const baseURL = 'https://yysub.net'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? ''; const url = `${baseURL}/article${type ? '?type=' + type : ''}`; diff --git a/lib/routes/yyets/router.js b/lib/routes/yyets/router.js index 9352457f187fbf..545ffb72f188d8 100644 --- a/lib/routes/yyets/router.js +++ b/lib/routes/yyets/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/article/:type?', './article'); router.get('/today', './today'); }; diff --git a/lib/routes/yyets/today.js b/lib/routes/yyets/today.js index 88ad9ea3b09101..b9806042f922ff 100644 --- a/lib/routes/yyets/today.js +++ b/lib/routes/yyets/today.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { // 发起 HTTP GET 请求 const response = await got({ method: 'get', diff --git a/lib/routes/yystv/category.js b/lib/routes/yystv/category.js index dbe987a05207be..13383b97e3cb4e 100644 --- a/lib/routes/yystv/category.js +++ b/lib/routes/yystv/category.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const url = `https://www.yystv.cn/b/${category}`; const response = await got({ diff --git a/lib/routes/yystv/docs.js b/lib/routes/yystv/docs.js index 0fd497d3d1de2a..8d424d11ce4ce9 100644 --- a/lib/routes/yystv/docs.js +++ b/lib/routes/yystv/docs.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = `https://www.yystv.cn/docs`; const response = await got({ method: 'get', diff --git a/lib/routes/yystv/router.js b/lib/routes/yystv/router.js index 0e329eabf998b5..51e6bf07982798 100644 --- a/lib/routes/yystv/router.js +++ b/lib/routes/yystv/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/category/:category', './category'); router.get('/docs', './docs'); }; diff --git a/lib/routes/zagg/new-arrivals.js b/lib/routes/zagg/new-arrivals.js index bfb672effbd73d..f7a4463aba4dcf 100644 --- a/lib/routes/zagg/new-arrivals.js +++ b/lib/routes/zagg/new-arrivals.js @@ -3,7 +3,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.zagg.com/en_us'; -module.exports = async (ctx) => { +export default async (ctx) => { const query = ctx.req.param('query'); const params = new URLSearchParams(query); const brands = params.get('brand'); diff --git a/lib/routes/zagg/router.js b/lib/routes/zagg/router.js index 033f9c11901322..85f4d41f3995fb 100644 --- a/lib/routes/zagg/router.js +++ b/lib/routes/zagg/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/new-arrivals/:query?', './new-arrivals'); }; diff --git a/lib/routes/zaker/index.js b/lib/routes/zaker/index.js index 9307958f955bf8..8c8502b2a0f762 100644 --- a/lib/routes/zaker/index.js +++ b/lib/routes/zaker/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'channel'; const id = ctx.req.param('id') ?? 1; const rootUrl = 'http://www.myzaker.com'; diff --git a/lib/routes/zaker/router.js b/lib/routes/zaker/router.js index d4c9b8e6b7207d..f1f031a956d3d6 100644 --- a/lib/routes/zaker/router.js +++ b/lib/routes/zaker/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/:type/:id?', './index'); }; diff --git a/lib/routes/zaobao/index.js b/lib/routes/zaobao/index.js index cb21dc7bbb8a04..301025bc54739e 100644 --- a/lib/routes/zaobao/index.js +++ b/lib/routes/zaobao/index.js @@ -1,7 +1,7 @@ const { parseList } = require('./util'); const baseUrl = 'https://www.zaobao.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'realtime'; const section = ctx.req.param('section') ?? 'china'; const sectionLink = `/${type}/${section}`; diff --git a/lib/routes/zaobao/interactive.js b/lib/routes/zaobao/interactive.js index 357fedd63ef9a5..36c4c76617d6be 100644 --- a/lib/routes/zaobao/interactive.js +++ b/lib/routes/zaobao/interactive.js @@ -1,7 +1,7 @@ const { parseList } = require('./util'); const baseUrl = 'https://www.zaobao.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const sectionLink = `/interactive-graphics`; const { resultList } = await parseList(ctx, sectionLink); diff --git a/lib/routes/zaobao/realtime.js b/lib/routes/zaobao/realtime.js index dba85b7d2ba313..0d7eed29af996b 100644 --- a/lib/routes/zaobao/realtime.js +++ b/lib/routes/zaobao/realtime.js @@ -1,7 +1,7 @@ const { parseList } = require('./util'); const baseUrl = 'https://www.zaobao.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const section = ctx.req.param('section') ?? 'china'; let name; diff --git a/lib/routes/zaobao/router.js b/lib/routes/zaobao/router.js index 889a49c7fbd55f..1a80c3dfea58fd 100644 --- a/lib/routes/zaobao/router.js +++ b/lib/routes/zaobao/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/interactive-graphics', './interactive'); router.get('/realtime/:section?', './realtime'); router.get('/znews/:section?', './znews'); diff --git a/lib/routes/zaobao/znews.js b/lib/routes/zaobao/znews.js index 68c904215e6c98..24d670f8dafae5 100644 --- a/lib/routes/zaobao/znews.js +++ b/lib/routes/zaobao/znews.js @@ -1,7 +1,7 @@ const { parseList } = require('./util'); const baseUrl = 'https://www.zaobao.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const section = ctx.req.param('section'); let info; diff --git a/lib/routes/zaozao/article.js b/lib/routes/zaozao/article.js index 17f50c23564089..880a5e56110d12 100644 --- a/lib/routes/zaozao/article.js +++ b/lib/routes/zaozao/article.js @@ -1,7 +1,7 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const { type = 'recommend' } = ctx.req.param(); const response = await got({ method: 'put', diff --git a/lib/routes/zaozao/router.js b/lib/routes/zaozao/router.js index f77b0e77dcf5ec..e83c0c1c57f3fd 100644 --- a/lib/routes/zaozao/router.js +++ b/lib/routes/zaozao/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/article/:type?', './article'); }; diff --git a/lib/routes/zcmu/jwc/index.js b/lib/routes/zcmu/jwc/index.js index a0c8945fd172a7..bd1620e4e9e03b 100644 --- a/lib/routes/zcmu/jwc/index.js +++ b/lib/routes/zcmu/jwc/index.js @@ -13,7 +13,7 @@ const map = new Map([ [5, { title: '教务处 -- 排课管理', id: 'jwgl/pkgl' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = Number.parseInt(ctx.req.param('type')); const id = map.get(type).id; const res = await got({ diff --git a/lib/routes/zcmu/router.js b/lib/routes/zcmu/router.js index d6451d32df9eee..4265a3d5d8db52 100644 --- a/lib/routes/zcmu/router.js +++ b/lib/routes/zcmu/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/jwc/:type?', './jwc'); router.get('/yxy/:type?', './yxy'); }; diff --git a/lib/routes/zcmu/yxy/index.js b/lib/routes/zcmu/yxy/index.js index 2afcb40c5826c3..beeb11bb62892a 100644 --- a/lib/routes/zcmu/yxy/index.js +++ b/lib/routes/zcmu/yxy/index.js @@ -14,7 +14,7 @@ const map = new Map([ [6, { title: '药学院 -- 日常通知', id: 'xsgz/rctz' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = Number.parseInt(ctx.req.param('type')); const id = map.get(type).id; const res = await got({ diff --git a/lib/routes/zcool/discover.js b/lib/routes/zcool/discover.js index 5c7d0b6da84724..141d9dc8ddc8a0 100644 --- a/lib/routes/zcool/discover.js +++ b/lib/routes/zcool/discover.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const locations = require('./locations'); -module.exports = async (ctx) => { +export default async (ctx) => { const categories = { 0: '精选', 8: '平面', diff --git a/lib/routes/zcool/router.js b/lib/routes/zcool/router.js index 33f4bfe60a33cc..118c8393124d53 100644 --- a/lib/routes/zcool/router.js +++ b/lib/routes/zcool/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/discover/:query?/:subCate?/:hasVideo?/:city?/:college?/:recommendLevel?/:sort?', './discover'); router.get('/top/:type', './top'); router.get('/user/:uid', './user'); diff --git a/lib/routes/zcool/top.js b/lib/routes/zcool/top.js index d1d0029b70cdb0..7500df198ad6c0 100644 --- a/lib/routes/zcool/top.js +++ b/lib/routes/zcool/top.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const { extractArticle, extractWork } = require('./utils'); const baseUrl = 'https://www.zcool.com.cn'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type'); const url = `${baseUrl}/top/${type === 'design' ? 'index.do' : 'article.do?rankType=8'}`; diff --git a/lib/routes/zcool/user.js b/lib/routes/zcool/user.js index 194a54aff29d6a..689be406810dbc 100644 --- a/lib/routes/zcool/user.js +++ b/lib/routes/zcool/user.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const { extractArticle, extractWork } = require('./utils'); import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const uid = ctx.req.param('uid'); let pageUrl = `https://www.zcool.com.cn/u/${uid}`; if (isNaN(uid)) { diff --git a/lib/routes/zhangyoubao/index.js b/lib/routes/zhangyoubao/index.js index c517d8994de8f2..aa30ddd877d158 100644 --- a/lib/routes/zhangyoubao/index.js +++ b/lib/routes/zhangyoubao/index.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const map = new Map([ ['lol', { title: '英雄联盟', id: 1 }], diff --git a/lib/routes/zhangyoubao/router.js b/lib/routes/zhangyoubao/router.js index 980a5c3364b524..f3e255626526b5 100644 --- a/lib/routes/zhangyoubao/router.js +++ b/lib/routes/zhangyoubao/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:category', './index'); }; diff --git a/lib/routes/zhibo8/forum.js b/lib/routes/zhibo8/forum.js index fe4eb8e9d17be0..9e9665b07b6871 100644 --- a/lib/routes/zhibo8/forum.js +++ b/lib/routes/zhibo8/forum.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `https://bbs.zhibo8.cc/forum/list/?fid=${id}`; diff --git a/lib/routes/zhibo8/luxiang.js b/lib/routes/zhibo8/luxiang.js index 1af906047fe906..84bede12279427 100644 --- a/lib/routes/zhibo8/luxiang.js +++ b/lib/routes/zhibo8/luxiang.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'https://www.zhibo8.cc'; const { category = 'nba' } = ctx.req.param(); const link = `${rootUrl}/${category}/luxiang.htm`; diff --git a/lib/routes/zhibo8/more.js b/lib/routes/zhibo8/more.js index c3f45cb20098f6..206b39e9090b3f 100644 --- a/lib/routes/zhibo8/more.js +++ b/lib/routes/zhibo8/more.js @@ -11,7 +11,7 @@ const categories = { other: '综合', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'nba'; const rootUrl = 'https://news.zhibo8.cc'; diff --git a/lib/routes/zhibo8/post.js b/lib/routes/zhibo8/post.js index 3d9c2a9a25741b..4f159c2ab53508 100644 --- a/lib/routes/zhibo8/post.js +++ b/lib/routes/zhibo8/post.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const link = `https://bbs.zhibo8.cc/forum/topic?tid=${id}`; diff --git a/lib/routes/zhibo8/router.js b/lib/routes/zhibo8/router.js index 0022d4b07aeaad..b299d099211c6e 100644 --- a/lib/routes/zhibo8/router.js +++ b/lib/routes/zhibo8/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/forum/:id', './forum'); router.get('/luxiang/:category?', './luxiang'); router.get('/more/:category?', './more'); diff --git a/lib/routes/zhihu/activities.js b/lib/routes/zhihu/activities.js index a9a5e6180cad0a..5c607337c2882a 100644 --- a/lib/routes/zhihu/activities.js +++ b/lib/routes/zhihu/activities.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const g_encrypt = require('./execlib/x-zse-96-v3'); import md5 from '@/utils/md5'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); // Because the API of zhihu.com has changed, we must use the value of `d_c0` (extracted from cookies) to calculate diff --git a/lib/routes/zhihu/answers.js b/lib/routes/zhihu/answers.js index 50965ca0b4bcd0..4b2ef5bc5c8b3e 100644 --- a/lib/routes/zhihu/answers.js +++ b/lib/routes/zhihu/answers.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const headers = { 'User-Agent': 'ZhihuHybrid com.zhihu.android/Futureve/6.59.0 Mozilla/5.0 (Linux; Android 10; GM1900 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/85.0.4183.127 Mobile Safari/537.36', diff --git a/lib/routes/zhihu/bookstore/newest.js b/lib/routes/zhihu/bookstore/newest.js index 9b851014d99049..cbf435bc2d1fcc 100644 --- a/lib/routes/zhihu/bookstore/newest.js +++ b/lib/routes/zhihu/bookstore/newest.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const response = await got({ method: 'get', url: 'https://api.zhihu.com/books/features/new', diff --git a/lib/routes/zhihu/collection.js b/lib/routes/zhihu/collection.js index e57d08de6e6c76..be10319a83b078 100644 --- a/lib/routes/zhihu/collection.js +++ b/lib/routes/zhihu/collection.js @@ -5,7 +5,7 @@ const utils = require('./utils'); const { generateData } = require('./pin/utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const getAll = ctx.req.param('getAll'); diff --git a/lib/routes/zhihu/daily-section.js b/lib/routes/zhihu/daily-section.js index f4af0962a2a3f7..8c930d1d2128d3 100644 --- a/lib/routes/zhihu/daily-section.js +++ b/lib/routes/zhihu/daily-section.js @@ -6,7 +6,7 @@ import { parseDate } from '@/utils/parse-date'; // 参考:https://github.com/izzyleung/ZhihuDailyPurify/wiki/%E7%9F%A5%E4%B9%8E%E6%97%A5%E6%8A%A5-API-%E5%88%86%E6%9E%90 // 文章给出了v7版 api的信息,包含全文api -module.exports = async (ctx) => { +export default async (ctx) => { const sectionId = ctx.req.param('sectionId'); const listRes = await got({ method: 'get', diff --git a/lib/routes/zhihu/daily.js b/lib/routes/zhihu/daily.js index 5ede28817321ea..51aeaefcd9a9f2 100644 --- a/lib/routes/zhihu/daily.js +++ b/lib/routes/zhihu/daily.js @@ -20,7 +20,7 @@ async function dohResolve(name) { return response.data.Answer.map((item) => item.data); } -module.exports = async (ctx) => { +export default async (ctx) => { const api = 'https://news-at.zhihu.com/api/4/news'; const HOST = 'news-at.zhihu.com'; let address = HOST; diff --git a/lib/routes/zhihu/hot.js b/lib/routes/zhihu/hot.js index b515ebbcb116c3..3fd88dfb394d59 100644 --- a/lib/routes/zhihu/hot.js +++ b/lib/routes/zhihu/hot.js @@ -15,7 +15,7 @@ const titles = { film: '影视', }; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category') ?? 'total'; const response = await got({ diff --git a/lib/routes/zhihu/hotlist.js b/lib/routes/zhihu/hotlist.js index 8e9f3812c1ce0a..b4f4461dd61bcb 100644 --- a/lib/routes/zhihu/hotlist.js +++ b/lib/routes/zhihu/hotlist.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { data: { data }, } = await got({ diff --git a/lib/routes/zhihu/pin/daily.js b/lib/routes/zhihu/pin/daily.js index e17aeb5f487f99..6440d49186cd3f 100644 --- a/lib/routes/zhihu/pin/daily.js +++ b/lib/routes/zhihu/pin/daily.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { generateData } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { data: { data }, } = await got({ diff --git a/lib/routes/zhihu/pin/hotlist.js b/lib/routes/zhihu/pin/hotlist.js index 1374fc40ae2e48..d8122032643f93 100644 --- a/lib/routes/zhihu/pin/hotlist.js +++ b/lib/routes/zhihu/pin/hotlist.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { generateData } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { data: { data }, } = await got({ diff --git a/lib/routes/zhihu/pin/people.js b/lib/routes/zhihu/pin/people.js index 265d7c3ec4c6bc..4dbd9f5d3fa6ea 100644 --- a/lib/routes/zhihu/pin/people.js +++ b/lib/routes/zhihu/pin/people.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { generateData } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const { diff --git a/lib/routes/zhihu/posts.js b/lib/routes/zhihu/posts.js index 8092c1c2ebc37b..7213adc8dd84de 100644 --- a/lib/routes/zhihu/posts.js +++ b/lib/routes/zhihu/posts.js @@ -3,7 +3,7 @@ const utils = require('./utils'); import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const usertype = ctx.req.param('usertype'); diff --git a/lib/routes/zhihu/question.js b/lib/routes/zhihu/question.js index 93d90e7ad81d5e..18d52c5ed98d9d 100644 --- a/lib/routes/zhihu/question.js +++ b/lib/routes/zhihu/question.js @@ -5,7 +5,7 @@ import md5 from '@/utils/md5'; const g_encrypt = require('./execlib/x-zse-96-v3'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { questionId, sortBy = 'default', // default,created,updated diff --git a/lib/routes/zhihu/router.js b/lib/routes/zhihu/router.js index 63240f0ab23ee5..ef69b581311e46 100644 --- a/lib/routes/zhihu/router.js +++ b/lib/routes/zhihu/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/bookstore/newest', './bookstore/newest'); router.get('/collection/:id/:getAll?', './collection'); router.get('/daily', './daily'); diff --git a/lib/routes/zhihu/timeline.js b/lib/routes/zhihu/timeline.js index 1f8549ff1b8667..b93a12ad0a1ee1 100644 --- a/lib/routes/zhihu/timeline.js +++ b/lib/routes/zhihu/timeline.js @@ -3,7 +3,7 @@ import { config } from '@/config'; const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const cookie = config.zhihu.cookies; if (cookie === undefined) { throw new Error('缺少知乎用户登录后的 Cookie 值'); diff --git a/lib/routes/zhihu/topic.js b/lib/routes/zhihu/topic.js index 68b617e0294a76..67eca0a5de50af 100644 --- a/lib/routes/zhihu/topic.js +++ b/lib/routes/zhihu/topic.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const g_encrypt = require('./execlib/x-zse-96-v3'); import md5 from '@/utils/md5'; -module.exports = async (ctx) => { +export default async (ctx) => { const { topicId, isTop = false } = ctx.req.param(); const link = `https://www.zhihu.com/topic/${topicId}/${isTop ? 'top-answers' : 'newest'}`; diff --git a/lib/routes/zhihu/weekly.js b/lib/routes/zhihu/weekly.js index 792d121956d265..a044eb58c2c408 100644 --- a/lib/routes/zhihu/weekly.js +++ b/lib/routes/zhihu/weekly.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const host = 'https://www.zhihu.com'; -module.exports = async (ctx) => { +export default async (ctx) => { const link = 'https://www.zhihu.com/pub/weekly'; const response = await got(link); const $ = load(response.data); diff --git a/lib/routes/zhihu/xhu/activities.js b/lib/routes/zhihu/xhu/activities.js index 3e4b60473e437a..1526cdba650d33 100644 --- a/lib/routes/zhihu/xhu/activities.js +++ b/lib/routes/zhihu/xhu/activities.js @@ -3,7 +3,7 @@ const auth = require('./auth'); const utils = require('../utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const xhuCookie = await auth.getCookie(ctx); const hexId = ctx.req.param('hexId'); const link = `https://www.zhihu.com/people/${hexId}`; diff --git a/lib/routes/zhihu/xhu/answers.js b/lib/routes/zhihu/xhu/answers.js index a1efbc0ce950ae..7ad53da1622956 100644 --- a/lib/routes/zhihu/xhu/answers.js +++ b/lib/routes/zhihu/xhu/answers.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const auth = require('./auth'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const xhuCookie = await auth.getCookie(ctx); const hexId = ctx.req.param('hexId'); const link = `https://www.zhihu.com/people/${hexId}/answers`; diff --git a/lib/routes/zhihu/xhu/collection.js b/lib/routes/zhihu/xhu/collection.js index 60255cdade1c81..c42c94ff669b01 100644 --- a/lib/routes/zhihu/xhu/collection.js +++ b/lib/routes/zhihu/xhu/collection.js @@ -3,7 +3,7 @@ const auth = require('./auth'); const { generateData } = require('../pin/utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const xhuCookie = await auth.getCookie(ctx); const id = ctx.req.param('id'); const link = `https://www.zhihu.com/collection/${id}`; diff --git a/lib/routes/zhihu/xhu/posts.js b/lib/routes/zhihu/xhu/posts.js index 7d529ab33d19e8..3415b9f75b2502 100644 --- a/lib/routes/zhihu/xhu/posts.js +++ b/lib/routes/zhihu/xhu/posts.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; const auth = require('./auth'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const xhuCookie = await auth.getCookie(ctx); const hexId = ctx.req.param('hexId'); const link = `https://www.zhihu.com/people/${hexId}/posts`; diff --git a/lib/routes/zhihu/xhu/question.js b/lib/routes/zhihu/xhu/question.js index d9045e83184685..5ff6ab422094af 100644 --- a/lib/routes/zhihu/xhu/question.js +++ b/lib/routes/zhihu/xhu/question.js @@ -3,7 +3,7 @@ const auth = require('./auth'); const utils = require('../utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const xhuCookie = await auth.getCookie(ctx); const { questionId, diff --git a/lib/routes/zhihu/xhu/topic.js b/lib/routes/zhihu/xhu/topic.js index 15ee58b9b29e58..f7fc189cb0047f 100644 --- a/lib/routes/zhihu/xhu/topic.js +++ b/lib/routes/zhihu/xhu/topic.js @@ -3,7 +3,7 @@ const auth = require('./auth'); const utils = require('../utils'); import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const xhuCookie = await auth.getCookie(ctx); const topicId = ctx.req.param('topicId'); const link = `https://www.zhihu.com/topic/${topicId}/newest`; diff --git a/lib/routes/zhihu/xhu/zhuanlan.js b/lib/routes/zhihu/xhu/zhuanlan.js index d6c948cbeb77f5..1aad3cec578a6d 100644 --- a/lib/routes/zhihu/xhu/zhuanlan.js +++ b/lib/routes/zhihu/xhu/zhuanlan.js @@ -3,7 +3,7 @@ const auth = require('./auth'); import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const xhuCookie = await auth.getCookie(ctx); const id = ctx.req.param('id'); const link = `https://www.zhihu.com/column/${id}`; diff --git a/lib/routes/zhihu/zhuanlan.js b/lib/routes/zhihu/zhuanlan.js index 26667826edda26..312a5435df6f1c 100644 --- a/lib/routes/zhihu/zhuanlan.js +++ b/lib/routes/zhihu/zhuanlan.js @@ -3,7 +3,7 @@ const utils = require('./utils'); import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const listRes = await got({ diff --git a/lib/routes/zhitongcaijing/index.js b/lib/routes/zhitongcaijing/index.js index 250c517b49535a..7d18d5bc897716 100644 --- a/lib/routes/zhitongcaijing/index.js +++ b/lib/routes/zhitongcaijing/index.js @@ -64,7 +64,7 @@ const ids = { }, }; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'recommend'; const category = ctx.req.param('category') ?? ''; diff --git a/lib/routes/zhitongcaijing/router.js b/lib/routes/zhitongcaijing/router.js index afcc326cf097b1..4456ee4703429d 100644 --- a/lib/routes/zhitongcaijing/router.js +++ b/lib/routes/zhitongcaijing/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:id?/:category?', './index'); }; diff --git a/lib/routes/zhiy/letter.js b/lib/routes/zhiy/letter.js index d5870766e399a3..fd1317a76eda17 100644 --- a/lib/routes/zhiy/letter.js +++ b/lib/routes/zhiy/letter.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, fetchUserDate } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const author = ctx.req.param('author'); const userData = await fetchUserDate(author); diff --git a/lib/routes/zhiy/post.js b/lib/routes/zhiy/post.js index b50db87646dd36..199dc6885c8e5c 100644 --- a/lib/routes/zhiy/post.js +++ b/lib/routes/zhiy/post.js @@ -6,7 +6,7 @@ import { art } from '@/utils/render'; import * as path from 'node:path'; const dayjs = require('dayjs'); -module.exports = async (ctx) => { +export default async (ctx) => { art.defaults.imports = { dayjs, ...art.defaults.imports, diff --git a/lib/routes/zhiy/router.js b/lib/routes/zhiy/router.js index 02c3301daeee29..06763d9f456e88 100644 --- a/lib/routes/zhiy/router.js +++ b/lib/routes/zhiy/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/letters/:author', './letter'); router.get('/posts/:author', './post'); }; diff --git a/lib/routes/zhubai/index.js b/lib/routes/zhubai/index.js index 2ec86285ee3373..9771b197a1ea43 100644 --- a/lib/routes/zhubai/index.js +++ b/lib/routes/zhubai/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { isValidHost } from '@/utils/valid-host'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; if (!isValidHost(id)) { diff --git a/lib/routes/zhubai/router.js b/lib/routes/zhubai/router.js index 316b72d5bda07a..404a7a0a379062 100644 --- a/lib/routes/zhubai/router.js +++ b/lib/routes/zhubai/router.js @@ -1,4 +1,4 @@ -module.exports = function (router) { +export default (router) => { router.get('/top20', './top20'); router.get('/:id', './index'); }; diff --git a/lib/routes/zhubai/top20.js b/lib/routes/zhubai/top20.js index a91173110ea9f6..9c67432d516454 100644 --- a/lib/routes/zhubai/top20.js +++ b/lib/routes/zhubai/top20.js @@ -12,7 +12,7 @@ const parseContent = (content) => art.defaults.imports.parseContent = parseContent; -module.exports = async (ctx) => { +export default async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; const rootUrl = 'http://analy.zhubai.wiki'; diff --git a/lib/routes/zimuxia/index.js b/lib/routes/zimuxia/index.js index f705a33a32b727..6a1640d32a1601 100644 --- a/lib/routes/zimuxia/index.js +++ b/lib/routes/zimuxia/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const category = ctx.req.param('category'); const rootUrl = 'https://www.zimuxia.cn'; diff --git a/lib/routes/zimuxia/portfolio.js b/lib/routes/zimuxia/portfolio.js index f9522586368b84..f55167e0daf764 100644 --- a/lib/routes/zimuxia/portfolio.js +++ b/lib/routes/zimuxia/portfolio.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const allowlinktypes = new Set(['all', 'magnet', 'ed2k', 'baidu', 'subhd', 'quark', '115']); -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id'); let linktype = ctx.req.query('linktype') ?? 'magnet'; linktype = allowlinktypes.has(linktype) ? linktype : 'magnet'; diff --git a/lib/routes/zimuxia/router.js b/lib/routes/zimuxia/router.js index 66b368e2839461..8f6fdd42be8f25 100644 --- a/lib/routes/zimuxia/router.js +++ b/lib/routes/zimuxia/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/portfolio/:id', './portfolio'); router.get('/:category?', './index'); }; diff --git a/lib/routes/zjgtjy/index.js b/lib/routes/zjgtjy/index.js index a7d980952f4dc4..2cd45023a7d1e6 100644 --- a/lib/routes/zjgtjy/index.js +++ b/lib/routes/zjgtjy/index.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') === 'all' ? '' : ctx.req.param('type').toUpperCase(); const host = `https://td.zjgtjy.cn:8553/devops/noticeInfo/queryNoticeInfoList?pageSize=10&pageNumber=1¬iceType=${type}&sort=DESC`; diff --git a/lib/routes/zjgtjy/router.js b/lib/routes/zjgtjy/router.js index 47ce2498dc8532..6fd05f06e15564 100644 --- a/lib/routes/zjgtjy/router.js +++ b/lib/routes/zjgtjy/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/:type?', './index'); }; diff --git a/lib/routes/zjol/paper.js b/lib/routes/zjol/paper.js index 0d3ed72596c916..3055a5b828fb8d 100644 --- a/lib/routes/zjol/paper.js +++ b/lib/routes/zjol/paper.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id') ?? 'zjrb'; const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 100; diff --git a/lib/routes/zjol/router.js b/lib/routes/zjol/router.js index e7ee9aa57b3a9c..98a5ec9fb1b96a 100644 --- a/lib/routes/zjol/router.js +++ b/lib/routes/zjol/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/paper/:id?', './paper'); }; diff --git a/lib/routes/zju/career/index.js b/lib/routes/zju/career/index.js index f26d7a348bd3b0..70a4cd0e56ad11 100644 --- a/lib/routes/zju/career/index.js +++ b/lib/routes/zju/career/index.js @@ -12,7 +12,7 @@ const map = new Map([ [4, { title: '浙大就业服务平台 -- 告示通告', id: 'lmjdid=739BEBB72A252B25E0538713470A6C41&sjlmid=undefined&lmtype=2&lx=2' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = Number.parseInt(ctx.req.param('type')); const id = map.get(type).id; const res = await got(`${host}${id}`); diff --git a/lib/routes/zju/cst/custom.js b/lib/routes/zju/cst/custom.js index 3a6bf93972414c..e5c071724c6bb3 100644 --- a/lib/routes/zju/cst/custom.js +++ b/lib/routes/zju/cst/custom.js @@ -30,7 +30,7 @@ async function getPage(id) { ); } -module.exports = async (ctx) => { +export default async (ctx) => { const id = ctx.req.param('id').split('+'); const tasks = id.map((id) => getPage(id)); const results = await Promise.all(tasks); diff --git a/lib/routes/zju/cst/index.js b/lib/routes/zju/cst/index.js index 53fd97ac213b0c..b9b62273396102 100644 --- a/lib/routes/zju/cst/index.js +++ b/lib/routes/zju/cst/index.js @@ -43,7 +43,7 @@ async function getPage(id) { ); } -module.exports = async (ctx) => { +export default async (ctx) => { const type = Number.parseInt(ctx.req.param('type')); const link = host + map.get(type).id; let items = []; diff --git a/lib/routes/zju/grs/index.js b/lib/routes/zju/grs/index.js index 5a8b7d92f66b05..78726cdfa23739 100644 --- a/lib/routes/zju/grs/index.js +++ b/lib/routes/zju/grs/index.js @@ -13,7 +13,7 @@ const map = new Map([ [5, { title: '浙大研究生院 -- 海外交流', tag: 'hwjl' }], ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = Number.parseInt(ctx.req.param('type')); const tag = map.get(type).tag; const url = `${host}${tag}/list.htm`; diff --git a/lib/routes/zju/list.js b/lib/routes/zju/list.js index 29bd4e2935e625..0643b1ccccff0f 100644 --- a/lib/routes/zju/list.js +++ b/lib/routes/zju/list.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const host = 'https://www.zju.edu.cn/'; -module.exports = async (ctx) => { +export default async (ctx) => { const type = ctx.req.param('type') ?? 'xs'; const link = host + type + `/list.htm`; const response = await got({ diff --git a/lib/routes/zju/physics/index.js b/lib/routes/zju/physics/index.js index f59d536a5ccef0..bf83b7ac6e6687 100644 --- a/lib/routes/zju/physics/index.js +++ b/lib/routes/zju/physics/index.js @@ -22,7 +22,7 @@ const map = new Map([ [11, { title: '浙大物理学院 -- 学术报告', id: '3735' }],*/ ]); -module.exports = async (ctx) => { +export default async (ctx) => { const type = Number.parseInt(ctx.req.param('type')); const id = map.get(type).id; const res = await got({ diff --git a/lib/routes/zju/router.js b/lib/routes/zju/router.js index 100ee5e2f6b8ac..35b917cf452a98 100644 --- a/lib/routes/zju/router.js +++ b/lib/routes/zju/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/career/:type', './career'); router.get('/cst/custom/:id', './cst/custom'); router.get('/cst/:type', './cst'); diff --git a/lib/routes/zjuvag/blog.js b/lib/routes/zjuvag/blog.js index f1af200f25a241..03ca97ca46fbbd 100644 --- a/lib/routes/zjuvag/blog.js +++ b/lib/routes/zjuvag/blog.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析 import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://zjuvag.org/blog/'; const { data: response } = await got(baseUrl); const $ = load(response); diff --git a/lib/routes/zjuvag/router.js b/lib/routes/zjuvag/router.js index e08aa776942a77..da5910733e49ed 100644 --- a/lib/routes/zjuvag/router.js +++ b/lib/routes/zjuvag/router.js @@ -1,3 +1,3 @@ -module.exports = (router) => { +export default (router) => { router.get('/blog', './blog'); }; diff --git a/lib/routes/zodgame/forum.js b/lib/routes/zodgame/forum.js index 1163120880394c..ae860d313850a9 100644 --- a/lib/routes/zodgame/forum.js +++ b/lib/routes/zodgame/forum.js @@ -7,7 +7,7 @@ import * as path from 'node:path'; const rootUrl = 'https://zodgame.xyz'; -module.exports = async (ctx) => { +export default async (ctx) => { const fid = ctx.req.param('fid'); const subUrl = `${rootUrl}/api/mobile/index.php?version=4&module=forumdisplay&fid=${fid}`; const cookie = config.zodgame.cookie; diff --git a/lib/routes/zodgame/router.js b/lib/routes/zodgame/router.js index da5dacd8cddb6b..4b9bc76fa1989f 100644 --- a/lib/routes/zodgame/router.js +++ b/lib/routes/zodgame/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/forum/:fid?', './forum'); }; diff --git a/lib/routes/zotero/router.js b/lib/routes/zotero/router.js index 62b94830180428..dc368bb5aeffb1 100644 --- a/lib/routes/zotero/router.js +++ b/lib/routes/zotero/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/versions', './versions'); }; diff --git a/lib/routes/zotero/versions.js b/lib/routes/zotero/versions.js index e46733b8003d02..4fdf7e7a8607bb 100644 --- a/lib/routes/zotero/versions.js +++ b/lib/routes/zotero/versions.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.zotero.org/support/changelog'; const response = await got(url); const data = response.data; diff --git a/lib/routes/zrblog/router.js b/lib/routes/zrblog/router.js index 574929e02f0d85..692ecaf4aabb91 100644 --- a/lib/routes/zrblog/router.js +++ b/lib/routes/zrblog/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/', require('./rss')); }; diff --git a/lib/routes/zrblog/rss.js b/lib/routes/zrblog/rss.js index 4637f0b265d6ba..3a0704c3b8ba3f 100644 --- a/lib/routes/zrblog/rss.js +++ b/lib/routes/zrblog/rss.js @@ -2,7 +2,7 @@ import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import { load } from 'cheerio'; -module.exports = async (ctx) => { +export default async (ctx) => { const url = 'https://www.zrblog.net/'; const response = await got({ method: 'get', url }); const $ = load(response.data); diff --git a/lib/routes/zuel/notice.js b/lib/routes/zuel/notice.js index 9cf3f38454442b..2f7e77e1bca5d3 100644 --- a/lib/routes/zuel/notice.js +++ b/lib/routes/zuel/notice.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://wap.zuel.edu.cn'; const currentUrl = `${rootUrl}/notice/list.htm`; diff --git a/lib/routes/zuel/router.js b/lib/routes/zuel/router.js index 25ddffef8f6687..542a85d08ce2fc 100644 --- a/lib/routes/zuel/router.js +++ b/lib/routes/zuel/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/notice', './notice'); }; diff --git a/lib/routes/zuvio/boards.js b/lib/routes/zuvio/boards.js index 7986c2b5ae172f..7566336b9342af 100644 --- a/lib/routes/zuvio/boards.js +++ b/lib/routes/zuvio/boards.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const { getBoards, rootUrl } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const items = await getBoards(cache.tryGet); ctx.set('data', { diff --git a/lib/routes/zuvio/router.js b/lib/routes/zuvio/router.js index 9fc11b56631a96..7564a9606899fe 100644 --- a/lib/routes/zuvio/router.js +++ b/lib/routes/zuvio/router.js @@ -1,4 +1,4 @@ -module.exports = (router) => { +export default (router) => { router.get('/student5/boards', './boards'); router.get('/student5/:board?', './student5'); }; diff --git a/lib/routes/zuvio/student5.js b/lib/routes/zuvio/student5.js index e3405968c0af47..44a7f9b74fdd70 100644 --- a/lib/routes/zuvio/student5.js +++ b/lib/routes/zuvio/student5.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { token, apiUrl, rootUrl, renderDesc, getBoards } = require('./utils'); -module.exports = async (ctx) => { +export default async (ctx) => { const { board = '' } = ctx.req.param(); const title = board ? (await getBoards(cache.tryGet)).find((i) => i.boardId === board).title : '全部'; diff --git a/lib/routes/zyshow/index.js b/lib/routes/zyshow/index.js index 39fb30d21a9f2a..9e2dcaeb540aa4 100644 --- a/lib/routes/zyshow/index.js +++ b/lib/routes/zyshow/index.js @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import * as path from 'node:path'; -module.exports = async (ctx) => { +export default async (ctx) => { const rootUrl = 'http://www.zyshow.net'; const currentUrl = `${rootUrl}${getSubPath(ctx).replace(/\/$/, '')}/`; diff --git a/lib/routes/zyshow/router.js b/lib/routes/zyshow/router.js index 91a6a844140902..6f45ba54b7681a 100644 --- a/lib/routes/zyshow/router.js +++ b/lib/routes/zyshow/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('*', './index'); }; diff --git a/lib/routes/zyw/hot.js b/lib/routes/zyw/hot.js index ab2f44a80376a0..0fc948b860066d 100644 --- a/lib/routes/zyw/hot.js +++ b/lib/routes/zyw/hot.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; -module.exports = async (ctx) => { +export default async (ctx) => { const site = ctx.req.param('site') ?? ''; const rootUrl = 'https://hot.zyw.asia'; diff --git a/lib/routes/zyw/router.js b/lib/routes/zyw/router.js index 4994074df73b31..3ae929b356f564 100644 --- a/lib/routes/zyw/router.js +++ b/lib/routes/zyw/router.js @@ -1,3 +1,3 @@ -module.exports = function (router) { +export default (router) => { router.get('/hot/:site?', './hot'); }; From a2a3e1b58b3804644c3fe8cc35780a15aff6ad89 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 2 Mar 2024 03:27:44 +0800 Subject: [PATCH 5/9] feat: remove unclean require in router.js --- lib/routes/ciweimao/router.js | 2 +- lib/routes/hbooker/router.js | 2 +- lib/routes/sfacg/router.js | 2 +- lib/routes/tvtropes/router.js | 2 +- lib/routes/wmpvp/router.js | 2 +- lib/routes/zrblog/router.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/routes/ciweimao/router.js b/lib/routes/ciweimao/router.js index bf5f0b92e5d9ed..817fef3dde6546 100644 --- a/lib/routes/ciweimao/router.js +++ b/lib/routes/ciweimao/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/chapter/:id', require('./chapter')); + router.get('/chapter/:id', './chapter'); }; diff --git a/lib/routes/hbooker/router.js b/lib/routes/hbooker/router.js index bf5f0b92e5d9ed..817fef3dde6546 100644 --- a/lib/routes/hbooker/router.js +++ b/lib/routes/hbooker/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/chapter/:id', require('./chapter')); + router.get('/chapter/:id', './chapter'); }; diff --git a/lib/routes/sfacg/router.js b/lib/routes/sfacg/router.js index 151935db563465..72374499e482ae 100644 --- a/lib/routes/sfacg/router.js +++ b/lib/routes/sfacg/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/novel/chapter/:id', require('./novel-chapter')); + router.get('/novel/chapter/:id', './novel-chapter'); }; diff --git a/lib/routes/tvtropes/router.js b/lib/routes/tvtropes/router.js index 85f49f95fa91ce..676e3be2634e25 100644 --- a/lib/routes/tvtropes/router.js +++ b/lib/routes/tvtropes/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/featured/:category?', require('./featured')); + router.get('/featured/:category?', './featured'); }; diff --git a/lib/routes/wmpvp/router.js b/lib/routes/wmpvp/router.js index ed30ab29899c57..4f35ef401d901a 100644 --- a/lib/routes/wmpvp/router.js +++ b/lib/routes/wmpvp/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/news/:type', require('.')); + router.get('/news/:type', './index'); }; diff --git a/lib/routes/zrblog/router.js b/lib/routes/zrblog/router.js index 692ecaf4aabb91..09c585b57315bb 100644 --- a/lib/routes/zrblog/router.js +++ b/lib/routes/zrblog/router.js @@ -1,3 +1,3 @@ export default (router) => { - router.get('/', require('./rss')); + router.get('/', './rss'); }; From 91e6fe3d1aa07117ae2c46bca3d2cda6a858cf4b Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 2 Mar 2024 03:50:42 +0800 Subject: [PATCH 6/9] feat: remove unclean require in core --- lib/middleware/anti-hotlink.test.ts | 8 ++++++-- lib/utils/common-utils.ts | 2 +- lib/utils/timezone.ts | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/middleware/anti-hotlink.test.ts b/lib/middleware/anti-hotlink.test.ts index f3b463b14d9ee1..8b38463f3823f0 100644 --- a/lib/middleware/anti-hotlink.test.ts +++ b/lib/middleware/anti-hotlink.test.ts @@ -1,7 +1,6 @@ import { describe, expect, it, jest, afterEach, afterAll } from '@jest/globals'; import supertest from 'supertest'; import Parser from 'rss-parser'; -import querystring from 'query-string'; import type { serve } from '@hono/node-server'; const parser = new Parser(); @@ -127,7 +126,12 @@ const testAntiHotlink = async (path, expectObj, query?: string | Record `${key}=${value}`) + .join('&'); } path = path + (queryStr ? `?${queryStr}` : ''); diff --git a/lib/utils/common-utils.ts b/lib/utils/common-utils.ts index 123fa75ad5e5fd..29f792c8ee86d3 100644 --- a/lib/utils/common-utils.ts +++ b/lib/utils/common-utils.ts @@ -1,5 +1,5 @@ import { parseDate } from '@/utils/parse-date'; -const title = require('title'); +import title from 'title'; // convert a string into title case const toTitleCase = (str: string) => title(str); diff --git a/lib/utils/timezone.ts b/lib/utils/timezone.ts index 1e967b6979aa66..6091fa11686d37 100644 --- a/lib/utils/timezone.ts +++ b/lib/utils/timezone.ts @@ -1,4 +1,4 @@ -const assert = require('assert').strict; +import { strict as assert } from 'assert'; const millisInAnHour = 60 * 60 * 1000; const serverTimezone = -new Date().getTimezoneOffset() / 60; From 1b0acc996b79a51589bc7f81a8526b044fd4530c Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 2 Mar 2024 04:50:51 +0800 Subject: [PATCH 7/9] test: import app instead of index --- lib/middleware/access-control.test.ts | 202 ++++++++++++++++--------- lib/middleware/anti-hotlink.test.ts | 18 +-- lib/middleware/cache.test.ts | 105 ++++++------- lib/middleware/debug.test.ts | 30 ++-- lib/middleware/filter-engine.test.ts | 17 +-- lib/middleware/header.test.ts | 33 +++-- lib/middleware/header.ts | 2 +- lib/middleware/parameter.test.ts | 206 +++++++++++++------------- lib/middleware/template.test.ts | 58 ++++---- lib/middleware/template.ts | 2 + 10 files changed, 354 insertions(+), 319 deletions(-) diff --git a/lib/middleware/access-control.test.ts b/lib/middleware/access-control.test.ts index d5bfc476e519a5..639895a0ea769a 100644 --- a/lib/middleware/access-control.test.ts +++ b/lib/middleware/access-control.test.ts @@ -1,15 +1,11 @@ import { describe, expect, it, jest, afterEach } from '@jest/globals'; -import supertest from 'supertest'; import md5 from '@/utils/md5'; -import type { serve } from '@hono/node-server'; - -let server: ReturnType; process.env.NODE_NAME = 'mock'; -function checkBlock(response) { +async function checkBlock(response) { expect(response.status).toBe(403); - expect(response.text).toMatch(/Access denied\./); + expect(await response.text()).toMatch(/Access denied\./); } afterEach(() => { @@ -17,7 +13,6 @@ afterEach(() => { delete process.env.DENYLIST; delete process.env.ALLOWLIST; jest.resetModules(); - server.close(); }); describe('access-control', () => { @@ -26,46 +21,77 @@ describe('access-control', () => { const code = md5('/test/2' + key); process.env.DENYLIST = 'est/1,233.233.233.,black'; process.env.ACCESS_KEY = key; - server = (await import('@/index')).default; - const request = supertest(server); - - const response11 = await request.get('/test/1'); - checkBlock(response11); - - const response12 = await request.get('/test/1').set('X-Mock-IP', '233.233.233.233'); - checkBlock(response12); - - const response13 = await request.get('/test/1').set('user-agent', 'blackua'); - checkBlock(response13); - - const response21 = await request.get('/test/2'); + const app = (await import('@/app')).default; + + const response11 = await app.request('/test/1'); + await checkBlock(response11); + + const response12 = await app.request('/test/1', { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); + await checkBlock(response12); + + const response13 = await app.request('/test/1', { + headers: { + 'user-agent': 'blackua', + }, + }); + await checkBlock(response13); + + const response21 = await app.request('/test/2'); expect(response21.status).toBe(200); - const response22 = await request.get('/test/2').set('X-Mock-IP', '233.233.233.233'); - checkBlock(response22); + const response22 = await app.request('/test/2', { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); + await checkBlock(response22); - const response23 = await request.get('/test/2').set('user-agent', 'blackua'); - checkBlock(response23); + const response23 = await app.request('/test/2', { + headers: { + 'user-agent': 'blackua', + }, + }); + await checkBlock(response23); // wrong key/code, not on denylist - const response311 = await request.get(`/test/2?key=wrong+${key}`); + const response311 = await app.request(`/test/2?key=wrong+${key}`); expect(response311.status).toBe(200); - const response312 = await request.get(`/test/2?code=wrong+${code}`); + const response312 = await app.request(`/test/2?code=wrong+${code}`); expect(response312.status).toBe(200); // wrong key/code, on denylist - const response321 = await request.get(`/test/2?key=wrong+${key}`).set('X-Mock-IP', '233.233.233.233'); - checkBlock(response321); - - const response322 = await request.get(`/test/2?code=wrong+${code}`).set('X-Mock-IP', '233.233.233.233'); - checkBlock(response322); + const response321 = await app.request(`/test/2?key=wrong+${key}`, { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); + await checkBlock(response321); + + const response322 = await app.request(`/test/2?code=wrong+${code}`, { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); + await checkBlock(response322); // right key/code, on denylist - const response331 = await request.get(`/test/2?key=${key}`).set('X-Mock-IP', '233.233.233.233'); + const response331 = await app.request(`/test/2?key=${key}`, { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); expect(response331.status).toBe(200); - const response332 = await request.get(`/test/2?code=${code}`).set('X-Mock-IP', '233.233.233.233'); + const response332 = await app.request(`/test/2?code=${code}`, { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); expect(response332.status).toBe(200); }); @@ -74,61 +100,96 @@ describe('access-control', () => { const code = md5('/test/2' + key); process.env.ALLOWLIST = 'est/1,233.233.233.,103.31.4.0/22,white'; process.env.ACCESS_KEY = key; - server = (await import('@/index')).default; - const request = supertest(server); + const app = (await import('@/app')).default; - const response01 = await request.get('/'); + const response01 = await app.request('/'); expect(response01.status).toBe(200); - const response02 = await request.get('/robots.txt'); + const response02 = await app.request('/robots.txt'); expect(response02.status).toBe(404); - const response11 = await request.get('/test/1'); + const response11 = await app.request('/test/1'); expect(response11.status).toBe(200); - const response12 = await request.get('/test/1').set('X-Mock-IP', '233.233.233.233'); + const response12 = await app.request('/test/1', { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); expect(response12.status).toBe(200); - const response13 = await request.get('/test/1').set('user-agent', 'whiteua'); + const response13 = await app.request('/test/1', { + headers: { + 'user-agent': 'whiteua', + }, + }); expect(response13.status).toBe(200); - const response21 = await request.get('/test/2'); - checkBlock(response21); + const response21 = await app.request('/test/2'); + await checkBlock(response21); - const response22 = await request.get('/test/2').set('X-Mock-IP', '233.233.233.233'); + const response22 = await app.request('/test/2', { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); expect(response22.status).toBe(200); - const response221 = await request.get('/test/2').set('X-Mock-IP', '103.31.4.0'); + const response221 = await app.request('/test/2', { + headers: { + 'X-Mock-IP': '103.31.4.0', + }, + }); expect(response221.status).toBe(200); - const response222 = await request.get('/test/2').set('X-Mock-IP', '103.31.7.255'); + const response222 = await app.request('/test/2', { + headers: { + 'X-Mock-IP': '103.31.7.255', + }, + }); expect(response222.status).toBe(200); - const response223 = await request.get('/test/2').set('X-Mock-IP', '103.31.8.0'); - checkBlock(response223); - - const response23 = await request.get('/test/2').set('user-agent', 'whiteua'); + const response223 = await app.request('/test/2', { + headers: { + 'X-Mock-IP': '103.31.8.0', + }, + }); + await checkBlock(response223); + + const response23 = await app.request('/test/2', { + headers: { + 'user-agent': 'whiteua', + }, + }); expect(response23.status).toBe(200); // wrong key/code, not on allowlist - const response311 = await request.get(`/test/2?code=wrong+${code}`); - checkBlock(response311); + const response311 = await app.request(`/test/2?code=wrong+${code}`); + await checkBlock(response311); - const response312 = await request.get(`/test/2?key=wrong+${key}`); - checkBlock(response312); + const response312 = await app.request(`/test/2?key=wrong+${key}`); + await checkBlock(response312); // wrong key/code, on allowlist - const response321 = await request.get(`/test/2?code=wrong+${code}`).set('X-Mock-IP', '233.233.233.233'); + const response321 = await app.request(`/test/2?code=wrong+${code}`, { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); expect(response321.status).toBe(200); - const response322 = await request.get(`/test/2?key=wrong+${key}`).set('X-Mock-IP', '233.233.233.233'); + const response322 = await app.request(`/test/2?key=wrong+${key}`, { + headers: { + 'X-Mock-IP': '233.233.233.233', + }, + }); expect(response322.status).toBe(200); // right key/code - const response331 = await request.get(`/test/2?code=${code}`); + const response331 = await app.request(`/test/2?code=${code}`); expect(response331.status).toBe(200); - const response332 = await request.get(`/test/2?key=${key}`); + const response332 = await app.request(`/test/2?key=${key}`); expect(response332.status).toBe(200); }); @@ -136,33 +197,32 @@ describe('access-control', () => { const key = '1L0veRSSHub'; const code = md5('/test/2' + key); process.env.ACCESS_KEY = key; - server = (await import('@/index')).default; - const request = supertest(server); + const app = (await import('@/app')).default; - const response01 = await request.get('/'); + const response01 = await app.request('/'); expect(response01.status).toBe(200); - const response02 = await request.get('/robots.txt'); + const response02 = await app.request('/robots.txt'); expect(response02.status).toBe(404); - const response11 = await request.get('/test/1'); - checkBlock(response11); + const response11 = await app.request('/test/1'); + await checkBlock(response11); - const response21 = await request.get('/test/2'); - checkBlock(response21); + const response21 = await app.request('/test/2'); + await checkBlock(response21); // wrong key/code - const response321 = await request.get(`/test/2?key=wrong+${key}`); - checkBlock(response321); + const response321 = await app.request(`/test/2?key=wrong+${key}`); + await checkBlock(response321); - const response322 = await request.get(`/test/2?code=wrong+${code}`); - checkBlock(response322); + const response322 = await app.request(`/test/2?code=wrong+${code}`); + await checkBlock(response322); // right key/code - const response331 = await request.get(`/test/2?key=${key}`); + const response331 = await app.request(`/test/2?key=${key}`); expect(response331.status).toBe(200); - const response332 = await request.get(`/test/2?code=${code}`); + const response332 = await app.request(`/test/2?code=${code}`); expect(response332.status).toBe(200); }); }); diff --git a/lib/middleware/anti-hotlink.test.ts b/lib/middleware/anti-hotlink.test.ts index 8b38463f3823f0..40240e9090b02a 100644 --- a/lib/middleware/anti-hotlink.test.ts +++ b/lib/middleware/anti-hotlink.test.ts @@ -1,11 +1,8 @@ import { describe, expect, it, jest, afterEach, afterAll } from '@jest/globals'; -import supertest from 'supertest'; import Parser from 'rss-parser'; -import type { serve } from '@hono/node-server'; const parser = new Parser(); jest.setTimeout(50000); -let server: ReturnType; afterAll(() => { delete process.env.HOTLINK_TEMPLATE; @@ -19,7 +16,6 @@ afterEach(() => { delete process.env.HOTLINK_INCLUDE_PATHS; delete process.env.HOTLINK_EXCLUDE_PATHS; delete process.env.ALLOW_USER_HOTLINK_TEMPLATE; - server.close(); jest.resetModules(); }); @@ -121,8 +117,7 @@ const expects = { }; const testAntiHotlink = async (path, expectObj, query?: string | Record) => { - server = (await import('@/index')).default; - const request = supertest(server); + const app = (await import('@/app')).default; let queryStr; if (query) { @@ -135,8 +130,8 @@ const testAntiHotlink = async (path, expectObj, query?: string | Record i.content), desc: parsed.description, @@ -251,9 +246,8 @@ describe('anti-hotlink', () => { it('invalid-property', async () => { process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${createObjectURL}'; - server = (await import('@/index')).default; - const request = supertest(server); - const response = await request.get('/test/complicated'); - expect(response.text).toContain('Error: Invalid URL property: createObjectURL'); + const app = (await import('@/app')).default; + const response = await app.request('/test/complicated'); + expect(await response.text()).toContain('Error: Invalid URL property: createObjectURL'); }); }); diff --git a/lib/middleware/cache.test.ts b/lib/middleware/cache.test.ts index 7989b591e94719..c7187c766f67cd 100644 --- a/lib/middleware/cache.test.ts +++ b/lib/middleware/cache.test.ts @@ -1,11 +1,8 @@ import { describe, expect, it, jest, afterEach, afterAll, beforeAll } from '@jest/globals'; -import supertest from 'supertest'; import Parser from 'rss-parser'; import wait from '@/utils/wait'; -import type { serve } from '@hono/node-server'; const parser = new Parser(); -let server: ReturnType; beforeAll(() => { process.env.CACHE_EXPIRE = '1'; @@ -15,7 +12,6 @@ beforeAll(() => { afterEach(() => { delete process.env.CACHE_TYPE; jest.resetModules(); - server?.close(); }); afterAll(() => { @@ -25,14 +21,13 @@ afterAll(() => { describe('cache', () => { it('memory', async () => { process.env.CACHE_TYPE = 'memory'; - server = (await import('@/index')).default; - const request = supertest(server); + const app = (await import('@/app')).default; - const response1 = await request.get('/test/cache'); - const response2 = await request.get('/test/cache'); + const response1 = await app.request('/test/cache'); + const response2 = await app.request('/test/cache'); - const parsed1 = await parser.parseString(response1.text); - const parsed2 = await parser.parseString(response2.text); + const parsed1 = await parser.parseString(await response1.text()); + const parsed2 = await parser.parseString(await response2.text()); delete parsed1.lastBuildDate; delete parsed2.lastBuildDate; @@ -43,29 +38,29 @@ describe('cache', () => { expect(parsed2).toMatchObject(parsed1); expect(response2.status).toBe(200); - expect(response2.headers['rsshub-cache-status']).toBe('HIT'); + expect(response2.headers.get('rsshub-cache-status')).toBe('HIT'); await wait(1 * 1000 + 100); - const response3 = await request.get('/test/cache'); + const response3 = await app.request('/test/cache'); expect(response3.headers).not.toHaveProperty('rsshub-cache-status'); - const parsed3 = await parser.parseString(response3.text); + const parsed3 = await parser.parseString(await response3.text()); await wait(3 * 1000 + 100); - const response4 = await request.get('/test/cache'); - const parsed4 = await parser.parseString(response4.text); + const response4 = await app.request('/test/cache'); + const parsed4 = await parser.parseString(await response4.text()); expect(parsed1.items[0].content).toBe('Cache1'); expect(parsed2.items[0].content).toBe('Cache1'); expect(parsed3.items[0].content).toBe('Cache1'); expect(parsed4.items[0].content).toBe('Cache2'); - await request.get('/test/refreshCache'); + await app.request('/test/refreshCache'); await wait(1 * 1000 + 100); - const response5 = await request.get('/test/refreshCache'); - const parsed5 = await parser.parseString(response5.text); + const response5 = await app.request('/test/refreshCache'); + const parsed5 = await parser.parseString(await response5.text()); await wait(2 * 1000 + 100); - const response6 = await request.get('/test/refreshCache'); - const parsed6 = await parser.parseString(response6.text); + const response6 = await app.request('/test/refreshCache'); + const parsed6 = await parser.parseString(await response6.text()); expect(parsed5.items[0].content).toBe('1 1'); expect(parsed6.items[0].content).toBe('1 0'); @@ -73,14 +68,14 @@ describe('cache', () => { it('redis', async () => { process.env.CACHE_TYPE = 'redis'; - server = (await import('@/index')).default; - const request = supertest(server); + const app = (await import('@/app')).default; - const response1 = await request.get('/test/cache'); - const response2 = await request.get('/test/cache'); + await wait(500); + const response1 = await app.request('/test/cache'); + const response2 = await app.request('/test/cache'); - const parsed1 = await parser.parseString(response1.text); - const parsed2 = await parser.parseString(response2.text); + const parsed1 = await parser.parseString(await response1.text()); + const parsed2 = await parser.parseString(await response2.text()); delete parsed1.lastBuildDate; delete parsed2.lastBuildDate; @@ -91,29 +86,29 @@ describe('cache', () => { expect(parsed2).toMatchObject(parsed1); expect(response2.status).toBe(200); - expect(response2.headers['rsshub-cache-status']).toBe('HIT'); + expect(response2.headers.get('rsshub-cache-status')).toBe('HIT'); await wait(1 * 1000 + 100); - const response3 = await request.get('/test/cache'); + const response3 = await app.request('/test/cache'); expect(response3.headers).not.toHaveProperty('rsshub-cache-status'); - const parsed3 = await parser.parseString(response3.text); + const parsed3 = await parser.parseString(await response3.text()); await wait(3 * 1000 + 100); - const response4 = await request.get('/test/cache'); - const parsed4 = await parser.parseString(response4.text); + const response4 = await app.request('/test/cache'); + const parsed4 = await parser.parseString(await response4.text()); expect(parsed1.items[0].content).toBe('Cache1'); expect(parsed2.items[0].content).toBe('Cache1'); expect(parsed3.items[0].content).toBe('Cache1'); expect(parsed4.items[0].content).toBe('Cache2'); - await request.get('/test/refreshCache'); + await app.request('/test/refreshCache'); await wait(1 * 1000 + 100); - const response5 = await request.get('/test/refreshCache'); - const parsed5 = await parser.parseString(response5.text); + const response5 = await app.request('/test/refreshCache'); + const parsed5 = await parser.parseString(await response5.text()); await wait(2 * 1000 + 100); - const response6 = await request.get('/test/refreshCache'); - const parsed6 = await parser.parseString(response6.text); + const response6 = await app.request('/test/refreshCache'); + const parsed6 = await parser.parseString(await response6.text()); expect(parsed5.items[0].content).toBe('1 1'); expect(parsed6.items[0].content).toBe('1 0'); @@ -124,16 +119,15 @@ describe('cache', () => { it('redis with quit', async () => { process.env.CACHE_TYPE = 'redis'; - server = (await import('@/index')).default; const cache = (await import('@/utils/cache')).default; await cache.clients.redisClient!.quit(); - const request = supertest(server); + const app = (await import('@/app')).default; - const response1 = await request.get('/test/cache'); - const response2 = await request.get('/test/cache'); + const response1 = await app.request('/test/cache'); + const response2 = await app.request('/test/cache'); - const parsed1 = await parser.parseString(response1.text); - const parsed2 = await parser.parseString(response2.text); + const parsed1 = await parser.parseString(await response1.text()); + const parsed2 = await parser.parseString(await response2.text()); expect(response2.status).toBe(200); expect(response2.headers).not.toHaveProperty('rsshub-cache-status'); @@ -145,14 +139,13 @@ describe('cache', () => { it('redis with error', async () => { process.env.CACHE_TYPE = 'redis'; process.env.REDIS_URL = 'redis://wrongpath:6379'; - server = (await import('@/index')).default; - const request = supertest(server); + const app = (await import('@/app')).default; - const response1 = await request.get('/test/cache'); - const response2 = await request.get('/test/cache'); + const response1 = await app.request('/test/cache'); + const response2 = await app.request('/test/cache'); - const parsed1 = await parser.parseString(response1.text); - const parsed2 = await parser.parseString(response2.text); + const parsed1 = await parser.parseString(await response1.text()); + const parsed2 = await parser.parseString(await response2.text()); expect(response2.status).toBe(200); expect(response2.headers).not.toHaveProperty('rsshub-cache-status'); @@ -166,14 +159,13 @@ describe('cache', () => { it('no cache', async () => { process.env.CACHE_TYPE = 'NO'; - server = (await import('@/index')).default; - const request = supertest(server); + const app = (await import('@/app')).default; - const response1 = await request.get('/test/cache'); - const response2 = await request.get('/test/cache'); + const response1 = await app.request('/test/cache'); + const response2 = await app.request('/test/cache'); - const parsed1 = await parser.parseString(response1.text); - const parsed2 = await parser.parseString(response2.text); + const parsed1 = await parser.parseString(await response1.text()); + const parsed2 = await parser.parseString(await response2.text()); expect(response2.status).toBe(200); expect(response2.headers).not.toHaveProperty('rsshub-cache-status'); @@ -184,11 +176,10 @@ describe('cache', () => { it('throws URL key', async () => { process.env.CACHE_TYPE = 'memory'; - server = (await import('@/index')).default; - const request = supertest(server); + const app = (await import('@/app')).default; try { - const response = await request.get('/test/cacheUrlKey'); + const response = await app.request('/test/cacheUrlKey'); expect(response).toThrow(Error); } catch (error: any) { expect(error.message).toContain('Cache key must be a string'); diff --git a/lib/middleware/debug.test.ts b/lib/middleware/debug.test.ts index bf7071b1ceaf50..49cf06a6520444 100644 --- a/lib/middleware/debug.test.ts +++ b/lib/middleware/debug.test.ts @@ -1,11 +1,9 @@ -import { describe, expect, it, afterAll } from '@jest/globals'; -import supertest from 'supertest'; -import server from '@/index'; +import { describe, expect, it } from '@jest/globals'; +import app from '@/app'; import { load } from 'cheerio'; process.env.NODE_NAME = 'mock'; -const request = supertest(server); let gitHash; try { gitHash = require('git-rev-sync').short(); @@ -13,22 +11,22 @@ try { gitHash = (process.env.HEROKU_SLUG_COMMIT && process.env.HEROKU_SLUG_COMMIT.slice(0, 7)) || 'unknown'; } -afterAll(() => { - server.close(); -}); - describe('debug', () => { it('debug', async () => { - const response1 = await request.get('/test/1'); - const etag = response1.headers.etag; - await request.get('/test/1').set('If-None-Match', etag); - await request.get('/test/2'); - await request.get('/test/empty'); - await request.get('/test/empty'); + const response1 = await app.request('/test/1'); + const etag = response1.headers.get('etag'); + await app.request('/test/1', { + headers: { + 'If-None-Match': etag!, + }, + }); + await app.request('/test/2'); + await app.request('/test/empty'); + await app.request('/test/empty'); - const response = await request.get('/'); + const response = await app.request('/'); - const $ = load(response.text); + const $ = load(await response.text()); $('.debug-item').each((index, item) => { const key = $(item).find('.debug-key').html()?.trim(); const value = $(item).find('.debug-value').html()?.trim(); diff --git a/lib/middleware/filter-engine.test.ts b/lib/middleware/filter-engine.test.ts index a7677650ba7205..689ff215191ec9 100644 --- a/lib/middleware/filter-engine.test.ts +++ b/lib/middleware/filter-engine.test.ts @@ -1,5 +1,4 @@ import { describe, expect, it, afterAll, jest, afterEach } from '@jest/globals'; -import supertest from 'supertest'; jest.setTimeout(50000); @@ -14,29 +13,29 @@ afterEach(() => { describe('filter-engine', () => { it(`filter RE2 engine ReDoS attack`, async () => { - const request = supertest((await import('@/index')).default); + const app = (await import('@/app')).default; - const response = await request.get('/test/1?filter=abc(%3F%3Ddef)'); + const response = await app.request('/test/1?filter=abc(%3F%3Ddef)'); expect(response.status).toBe(404); - expect(response.text).toMatch(/RE2JSSyntaxException/); + expect(await response.text()).toMatch(/RE2JSSyntaxException/); }); it(`filter Regexp engine backward compatibility`, async () => { process.env.FILTER_REGEX_ENGINE = 'regexp'; - const request = supertest((await import('@/index')).default); + const app = (await import('@/app')).default; - const response = await request.get('/test/1?filter=abc(%3F%3Ddef)'); + const response = await app.request('/test/1?filter=abc(%3F%3Ddef)'); expect(response.status).toBe(200); }); it(`filter Regexp engine test config`, async () => { process.env.FILTER_REGEX_ENGINE = 'somethingelse'; - const request = supertest((await import('@/index')).default); + const app = (await import('@/app')).default; - const response = await request.get('/test/1?filter=abc(%3F%3Ddef)'); + const response = await app.request('/test/1?filter=abc(%3F%3Ddef)'); expect(response.status).toBe(404); - expect(response.text).toMatch(/somethingelse/); + expect(await response.text()).toMatch(/somethingelse/); }); }); diff --git a/lib/middleware/header.test.ts b/lib/middleware/header.test.ts index 237e851edf5b42..34f9bc58bee3af 100644 --- a/lib/middleware/header.test.ts +++ b/lib/middleware/header.test.ts @@ -1,5 +1,4 @@ import { describe, expect, it, afterAll } from '@jest/globals'; -import supertest from 'supertest'; process.env.NODE_NAME = 'mock'; process.env.ALLOW_ORIGIN = 'rsshub.mock'; @@ -13,24 +12,28 @@ afterAll(() => { describe('header', () => { it(`header`, async () => { - const request = supertest((await import('@/index')).default); + const app = (await import('@/app')).default; const { config } = await import('@/config'); - const response = await request.get('/test/1'); - expect(response.headers['access-control-allow-origin']).toBe('rsshub.mock'); - expect(response.headers['access-control-allow-methods']).toBe('GET'); - expect(response.headers['content-type']).toBe('application/xml; charset=utf-8'); - expect(response.headers['cache-control']).toBe(`public, max-age=${config.cache.routeExpire}`); - expect(response.headers['last-modified']).toBe(response.text.match(/(.*)<\/lastBuildDate>/)?.[1]); - expect(response.headers['rsshub-node']).toBe('mock'); - expect(response.headers.etag).not.toBe(undefined); - etag = response.headers.etag; + const response = await app.request('/test/1'); + expect(response.headers.get('access-control-allow-origin')).toBe('rsshub.mock'); + expect(response.headers.get('access-control-allow-methods')).toBe('GET'); + expect(response.headers.get('content-type')).toBe('application/xml; charset=utf-8'); + expect(response.headers.get('cache-control')).toBe(`public, max-age=${config.cache.routeExpire}`); + expect(response.headers.get('last-modified')).toBe((await response.text()).match(/(.*)<\/lastBuildDate>/)?.[1]); + expect(response.headers.get('rsshub-node')).toBe('mock'); + expect(response.headers.get('etag')).not.toBe(undefined); + etag = response.headers.get('etag'); }); it(`etag`, async () => { - const request = supertest((await import('@/index')).default); - const response = await request.get('/test/1').set('If-None-Match', etag); + const app = (await import('@/app')).default; + const response = await app.request('/test/1', { + headers: { + 'If-None-Match': etag, + }, + }); expect(response.status).toBe(304); - expect(response.text).toBe(''); - expect(response.headers['last-modified']).toBe(undefined); + expect(await response.text()).toBe(''); + expect(response.headers.get('last-modified')).toBe(null); }); }); diff --git a/lib/middleware/header.ts b/lib/middleware/header.ts index f8badd78532ad6..f43d8614548f81 100644 --- a/lib/middleware/header.ts +++ b/lib/middleware/header.ts @@ -39,7 +39,7 @@ const middleware: MiddlewareHandler = async (ctx, next) => { const ifNoneMatch = ctx.req.header('If-None-Match') ?? null; if (etagMatches(etag, ifNoneMatch)) { ctx.status(304); - return ctx.body(null); + ctx.set('no-content', true); } else { ctx.header('Last-Modified', lastBuildDate); } diff --git a/lib/middleware/parameter.test.ts b/lib/middleware/parameter.test.ts index 5bf88247617bd5..4250943118462a 100644 --- a/lib/middleware/parameter.test.ts +++ b/lib/middleware/parameter.test.ts @@ -1,138 +1,132 @@ -import { describe, expect, it, afterAll, jest } from '@jest/globals'; -import supertest from 'supertest'; -import server from '@/index'; +import { describe, expect, it, jest } from '@jest/globals'; +import app from '@/app'; import Parser from 'rss-parser'; import { config } from '@/config'; import nock from 'nock'; -const request = supertest(server); const parser = new Parser(); -afterAll(() => { - server.close(); -}); - describe('filter', () => { it(`filter`, async () => { - const response = await request.get('/test/1?filter=Description4|Title5'); - const parsed = await parser.parseString(response.text); + const response = await app.request('/test/1?filter=Description4|Title5'); + const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(2); expect(parsed.items[0].title).toBe('Title4'); expect(parsed.items[1].title).toBe('Title5'); }); it(`filter filter_case_sensitive default`, async () => { - const response = await request.get('/test/1?filter=description4|title5'); - const parsed = await parser.parseString(response.text); + 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 () => { - const response = await request.get('/test/1?filter=description4|title5&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title4'); expect(parsed.items[1].title).toBe('Title5'); }); it(`filter_title`, async () => { - const response = await request.get('/test/1?filter_title=Description4|Title5'); - const parsed = await parser.parseString(response.text); + 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 () => { - const response = await request.get('/test/1?filter_title=description4|title5&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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 () => { - const response = await request.get('/test/1?filter_description=Description4|Title5'); - const parsed = await parser.parseString(response.text); + 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 () => { - const response = await request.get('/test/1?filter_description=description4|title5&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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 () => { - const response = await request.get('/test/1?filter_author=DIYgod4|DIYgod5'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title4'); expect(parsed.items[1].title).toBe('Title5'); }); it(`filter_author filter_case_sensitive default`, async () => { - const response = await request.get('/test/1?filter_author=diygod4|diygod5'); - const parsed = await parser.parseString(response.text); + 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 () => { - const response = await request.get('/test/1?filter_author=diygod4|diygod5&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title4'); expect(parsed.items[1].title).toBe('Title5'); }); it(`filter_category`, async () => { - const response = await request.get('/test/filter?filter_category=Category0|Category1'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Filter Title1'); expect(parsed.items[1].title).toBe('Filter Title2'); }); it(`filter_category filter_case_sensitive default`, async () => { - const response = await request.get('/test/filter?filter_category=category0|category1'); - const parsed = await parser.parseString(response.text); + 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 () => { - const response = await request.get('/test/filter?filter_category=category0|category1&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Filter Title1'); expect(parsed.items[1].title).toBe('Filter Title2'); }); it(`filter_category filter_case_sensitive=false category string`, async () => { - const response = await request.get('/test/filter?filter_category=category3&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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 () => { - const response = await request.get('/test/filter-illegal-category?filter_category=CategoryIllegal'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].categories?.length).toBe(1); expect(parsed.items[0].categories?.[0]).toBe('CategoryIllegal'); }); it(`filter_time`, async () => { - const response = await request.get('/test/current_time?filter_time=25'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); }); it(`filterout`, async () => { - const response = await request.get('/test/1?filterout=Description4|Title5'); - const parsed = await parser.parseString(response.text); + const response = await app.request('/test/1?filterout=Description4|Title5'); + const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(3); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -140,8 +134,8 @@ describe('filter', () => { }); it(`filterout filter_case_sensitive default`, async () => { - const response = await request.get('/test/1?filterout=description4|title5'); - const parsed = await parser.parseString(response.text); + const response = await app.request('/test/1?filterout=description4|title5'); + const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(5); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -149,8 +143,8 @@ describe('filter', () => { }); it(`filterout filter_case_sensitive=false`, async () => { - const response = await request.get('/test/1?filterout=description4|title5&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -158,8 +152,8 @@ describe('filter', () => { }); it(`filterout_title`, async () => { - const response = await request.get('/test/1?filterout_title=Description4|Title5'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -168,8 +162,8 @@ describe('filter', () => { }); it(`filterout_title filter_case_sensitive=false`, async () => { - const response = await request.get('/test/1?filterout_title=description4|title5&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -178,8 +172,8 @@ describe('filter', () => { }); it(`filterout_description`, async () => { - const response = await request.get('/test/1?filterout_description=Description4|Title5'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -188,8 +182,8 @@ describe('filter', () => { }); it(`filterout_description filter_case_sensitive=false`, async () => { - const response = await request.get('/test/1?filterout_description=description4|title5&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -198,8 +192,8 @@ describe('filter', () => { }); it(`filterout_author`, async () => { - const response = await request.get('/test/1?filterout_author=DIYgod4|DIYgod5'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -207,8 +201,8 @@ describe('filter', () => { }); it(`filterout_author filter_case_sensitive default`, async () => { - const response = await request.get('/test/1?filterout_author=diygod4|diygod5'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -216,8 +210,8 @@ describe('filter', () => { }); it(`filterout_author filter_case_sensitive=false`, async () => { - const response = await request.get('/test/1?filterout_author=diygod4|diygod5&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -225,8 +219,8 @@ describe('filter', () => { }); it(`filterout_category`, async () => { - const response = await request.get('/test/filter?filterout_category=Category0|Category1'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Filter Title3'); expect(parsed.items[1].title).toBe('Title1'); @@ -234,8 +228,8 @@ describe('filter', () => { }); it(`filterout_category filter_case_sensitive default`, async () => { - const response = await request.get('/test/filter?filterout_category=category0|category1'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Filter Title1'); expect(parsed.items[1].title).toBe('Filter Title2'); @@ -244,8 +238,8 @@ describe('filter', () => { }); it(`filterout_category filter_case_sensitive=false`, async () => { - const response = await request.get('/test/filter?filterout_category=category0|category1&filter_case_sensitive=false'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Filter Title3'); expect(parsed.items[1].title).toBe('Title1'); @@ -253,15 +247,15 @@ describe('filter', () => { }); it(`filter combination`, async () => { - const response = await request.get('/test/filter?filter_title=Filter&filter_description=Description1'); - const parsed = await parser.parseString(response.text); + 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 () => { - const response = await request.get('/test/filter?filterout_title=Filter&filterout_description=Description1'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title2'); }); @@ -269,8 +263,8 @@ describe('filter', () => { describe('limit', () => { it(`limit`, async () => { - const response = await request.get('/test/1?limit=3'); - const parsed = await parser.parseString(response.text); + const response = await app.request('/test/1?limit=3'); + const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(3); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title2'); @@ -280,9 +274,9 @@ describe('limit', () => { describe('sorted', () => { it('sorted', async () => { - const response = await request.get('/test/sort?sorted=false'); + const response = await app.request('/test/sort?sorted=false'); expect(response.status).toBe(200); - const parsed = await parser.parseString(response.text); + const parsed = await parser.parseString(await response.text()); expect(parsed.items[0].title).toBe('Sort Title 0'); expect(parsed.items[1].title).toBe('Sort Title 1'); expect(parsed.items[2].title).toBe('Sort Title 2'); @@ -292,8 +286,8 @@ describe('sorted', () => { describe('tgiv', () => { it(`tgiv`, async () => { - const response = await request.get('/test/1?tgiv=test'); - const parsed = await parser.parseString(response.text); + 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`); }); @@ -301,49 +295,49 @@ describe('tgiv', () => { describe('empty', () => { it(`empty`, async () => { - const response1 = await request.get('/test/empty'); + const response1 = await app.request('/test/empty'); expect(response1.status).toBe(404); - expect(response1.text).toMatch(/Error: this route is empty/); + expect(await response1.text()).toMatch(/Error: this route is empty/); - const response2 = await request.get('/test/1?limit=0'); + const response2 = await app.request('/test/1?limit=0'); expect(response2.status).toBe(200); - const parsed = await parser.parseString(response2.text); + const parsed = await parser.parseString(await response2.text()); expect(parsed.items.length).toBe(0); }); }); describe('allow_empty', () => { it(`allow_empty`, async () => { - const response = await request.get('/test/allow_empty'); + const response = await app.request('/test/allow_empty'); expect(response.status).toBe(200); - const parsed = await parser.parseString(response.text); + const parsed = await parser.parseString(await response.text()); expect(parsed.items.length).toBe(0); }); }); describe('wrong_path', () => { it(`wrong_path`, async () => { - const response = await request.get('/wrong'); + const response = await app.request('/wrong'); expect(response.status).toBe(404); - expect(response.headers['cache-control']).toBe(`public, max-age=${config.cache.routeExpire}`); - expect(response.text).toMatch(/Error message: wrong path/); + expect(response.headers.get('cache-control')).toBe(`public, max-age=${config.cache.routeExpire}`); + expect(await response.text()).toMatch(/Error message: wrong path/); }); }); describe('fulltext_mode', () => { it(`fulltext`, async () => { - const response = await request.get('/test/1?mode=fulltext'); + const response = await app.request('/test/1?mode=fulltext'); expect(response.status).toBe(200); - const parsed = await parser.parseString(response.text); + const parsed = await parser.parseString(await response.text()); expect(parsed.items[0].content).not.toBe(undefined); }, 60000); }); describe('complicated_description', () => { it(`complicated_description`, async () => { - const response = await request.get('/test/complicated'); + const response = await app.request('/test/complicated'); expect(response.status).toBe(200); - const parsed = await parser.parseString(response.text); + const parsed = await parser.parseString(await response.text()); expect(parsed.items[0].content).toBe(` @@ -361,9 +355,9 @@ describe('complicated_description', () => { describe('multimedia_description', () => { it(`multimedia_description`, async () => { - const response = await request.get('/test/multimedia'); + const response = await app.request('/test/multimedia'); expect(response.status).toBe(200); - const parsed = await parser.parseString(response.text); + const parsed = await parser.parseString(await response.text()); expect(parsed.items[0].content).toBe(`

宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵宇宙無敵…

' @@ -419,8 +413,8 @@ describe('brief', () => { describe('multi parameter', () => { it(`filter before limit`, async () => { - const response = await request.get('/test/filter-limit?filterout_title=2&limit=2'); - const parsed = await parser.parseString(response.text); + 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); expect(parsed.items[0].title).toBe('Title1'); expect(parsed.items[1].title).toBe('Title3'); @@ -432,7 +426,7 @@ describe('openai', () => { jest.resetModules(); process.env.OPENAI_API_KEY = 'sk-1234567890'; - const request = supertest((await import('@/index')).default); + const app = (await import('@/app')).default; const { config } = await import('@/config'); nock(config.openai.endpoint) .post('/chat/completions') @@ -449,14 +443,14 @@ describe('openai', () => { }, ]); - const responseWithGpt = await request.get('/test/gpt?chatgpt=true'); - const responseNormal = await request.get('/test/gpt'); + const responseWithGpt = await app.request('/test/gpt?chatgpt=true'); + const responseNormal = await app.request('/test/gpt'); expect(responseWithGpt.status).toBe(200); expect(responseNormal.status).toBe(200); - const parsedGpt = await parser.parseString(responseWithGpt.text); - const parsedNormal = await parser.parseString(responseNormal.text); + const parsedGpt = await parser.parseString(await responseWithGpt.text()); + const parsedNormal = await parser.parseString(await responseNormal.text()); expect(parsedGpt.items[0].content).not.toBe(undefined); expect(parsedGpt.items[0].content).toBe(parsedNormal.items[0].content); diff --git a/lib/middleware/template.test.ts b/lib/middleware/template.test.ts index db1a77db24f7be..ee8c35b1c7bfad 100644 --- a/lib/middleware/template.test.ts +++ b/lib/middleware/template.test.ts @@ -1,21 +1,15 @@ -import { describe, expect, it, afterAll } from '@jest/globals'; -import supertest from 'supertest'; -import server from '@/index'; +import { describe, expect, it } from '@jest/globals'; +import app from '@/app'; import Parser from 'rss-parser'; -const request = supertest(server); const parser = new Parser(); -afterAll(() => { - server.close(); -}); - describe('template', () => { const expectPubDate = new Date(1_546_272_000_000 - 10 * 1000); it(`.rss`, async () => { - const response1 = await request.get('/test/1?format=rss'); - const parsed1 = await parser.parseString(response1.text); + const response1 = await app.request('/test/1?format=rss'); + const parsed1 = await parser.parseString(await response1.text()); expect(parsed1).toEqual(expect.any(Object)); expect(parsed1.title).toEqual(expect.any(String)); @@ -33,8 +27,8 @@ describe('template', () => { expect(parsed1.items[0].content).toEqual(expect.any(String)); expect(parsed1.items[0].guid).toEqual(expect.any(String)); - const response2 = await request.get('/test/1'); - const parsed2 = await parser.parseString(response2.text); + const response2 = await app.request('/test/1'); + const parsed2 = await parser.parseString(await response2.text()); delete parsed1.lastBuildDate; delete parsed2.lastBuildDate; delete parsed1.feedUrl; @@ -45,8 +39,8 @@ describe('template', () => { }); it(`.atom`, async () => { - const response = await request.get('/test/1?format=atom'); - const parsed = await parser.parseString(response.text); + const response = await app.request('/test/1?format=atom'); + const parsed = await parser.parseString(await response.text()); expect(parsed).toEqual(expect.any(Object)); expect(parsed.title).toEqual(expect.any(String)); @@ -64,12 +58,12 @@ describe('template', () => { }); it(`.json`, async () => { - const jsonResponse = await request.get('/test/1?format=json'); - const rssResponse = await request.get('/test/1?format=rss'); - const jsonParsed = JSON.parse(jsonResponse.text); - const rssParsed = await parser.parseString(rssResponse.text); + const jsonResponse = await app.request('/test/1?format=json'); + const rssResponse = await app.request('/test/1?format=rss'); + const jsonParsed = JSON.parse(await jsonResponse.text()); + const rssParsed = await parser.parseString(await rssResponse.text()); - expect(jsonResponse.headers['content-type']).toBe('application/feed+json; charset=UTF-8'); + expect(jsonResponse.headers.get('content-type')).toBe('application/feed+json; charset=UTF-8'); expect(jsonParsed.items[0].title).toEqual(rssParsed.items[0].title); expect(jsonParsed.items[0].url).toEqual(rssParsed.items[0].link); @@ -81,34 +75,34 @@ describe('template', () => { }); it('.debug.html', async () => { - const jsonResponse = await request.get('/test/1?format=json'); - const jsonParsed = JSON.parse(jsonResponse.text); + const jsonResponse = await app.request('/test/1?format=json'); + const jsonParsed = JSON.parse(await jsonResponse.text()); - const debugHTMLResponse0 = await request.get('/test/1?format=0.debug.html'); - expect(debugHTMLResponse0.headers['content-type']).toBe('text/html; charset=UTF-8'); - expect(debugHTMLResponse0.text).toBe(jsonParsed.items[0].content_html); + const debugHTMLResponse0 = await app.request('/test/1?format=0.debug.html'); + expect(debugHTMLResponse0.headers.get('content-type')).toBe('text/html; charset=UTF-8'); + expect(await debugHTMLResponse0.text()).toBe(jsonParsed.items[0].content_html); - const debugHTMLResponseNotExist = await request.get(`/test/1?format=${jsonParsed.items.length}.debug.html`); - expect(debugHTMLResponseNotExist.text).toBe(`data.item[${jsonParsed.items.length}].description not found`); + const debugHTMLResponseNotExist = await app.request(`/test/1?format=${jsonParsed.items.length}.debug.html`); + expect(await debugHTMLResponseNotExist.text()).toBe(`data.item[${jsonParsed.items.length}].description not found`); }); it('flatten author object', async () => { - const response = await request.get('/test/json'); - const parsed = await parser.parseString(response.text); + const response = await app.request('/test/json'); + const parsed = await parser.parseString(await response.text()); expect(parsed.items[2].author).toBe(['DIYgod1', 'DIYgod2'].map((name) => name).join(', ')); expect(parsed.items[3].author).toBe(['DIYgod3', 'DIYgod4', 'DIYgod5'].map((name) => name).join(', ')); expect(parsed.items[4].author).toBeUndefined(); }); it(`long title`, async () => { - const response = await request.get('/test/long'); - const parsed = await parser.parseString(response.text); + const response = await app.request('/test/long'); + const parsed = await parser.parseString(await response.text()); expect(parsed.items[0].title?.length).toBe(153); }); it(`enclosure`, async () => { - const response = await request.get('/test/enclosure'); - const parsed = await parser.parseString(response.text); + const response = await app.request('/test/enclosure'); + const parsed = await parser.parseString(await response.text()); expect(parsed.itunes?.author).toBe('DIYgod'); expect(parsed.items[0].enclosure?.url).toBe('https://github.com/DIYgod/RSSHub/issues/1'); expect(parsed.items[0].enclosure?.length).toBe('3661'); diff --git a/lib/middleware/template.ts b/lib/middleware/template.ts index 9c2027f9e47d8d..6c37046beef9fb 100644 --- a/lib/middleware/template.ts +++ b/lib/middleware/template.ts @@ -88,6 +88,8 @@ const middleware: MiddlewareHandler = async (ctx, next) => { } else if (outputType === 'json') { ctx.header('Content-Type', 'application/feed+json; charset=UTF-8'); return ctx.body(json(result)); + } else if (ctx.get('no-content')) { + return ctx.body(null); } else { return ctx.body(art(template, result)); } From 2e5728fd859e26f8a14edfb8e89dfc7e1e4bceec Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 2 Mar 2024 05:00:59 +0800 Subject: [PATCH 8/9] feat: unclean routes export --- lib/routes/hpoi/all.js | 2 +- lib/routes/hpoi/character.js | 2 +- lib/routes/hpoi/work.js | 2 +- lib/routes/telegram/channel.js | 2 +- lib/routes/twitter/keyword.js | 2 +- lib/routes/twitter/media.js | 2 +- lib/routes/twitter/user.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/routes/hpoi/all.js b/lib/routes/hpoi/all.js index dada62194c6ecd..1c9d1ba07a24e2 100644 --- a/lib/routes/hpoi/all.js +++ b/lib/routes/hpoi/all.js @@ -1,3 +1,3 @@ const { ProcessFeed } = require('./utils'); -module.exports = async (ctx) => ctx.set('data', await ProcessFeed('all', 0, ctx.req.param('order'))); +export default async (ctx) => ctx.set('data', await ProcessFeed('all', 0, ctx.req.param('order'))); diff --git a/lib/routes/hpoi/character.js b/lib/routes/hpoi/character.js index 4e2800962bd254..3bdb8cfc920c38 100644 --- a/lib/routes/hpoi/character.js +++ b/lib/routes/hpoi/character.js @@ -1,3 +1,3 @@ const { ProcessFeed } = require('./utils'); -module.exports = async (ctx) => ctx.set('data', await ProcessFeed('character', ctx.req.param('id'), ctx.req.param('order'))); +export default async (ctx) => ctx.set('data', await ProcessFeed('character', ctx.req.param('id'), ctx.req.param('order'))); diff --git a/lib/routes/hpoi/work.js b/lib/routes/hpoi/work.js index 6f1573029ae0e6..852e17a2df96ea 100644 --- a/lib/routes/hpoi/work.js +++ b/lib/routes/hpoi/work.js @@ -1,3 +1,3 @@ const { ProcessFeed } = require('./utils'); -module.exports = async (ctx) => ctx.set('data', await ProcessFeed('work', ctx.req.param('id'), ctx.req.param('order'))); +export default async (ctx) => ctx.set('data', await ProcessFeed('work', ctx.req.param('id'), ctx.req.param('order'))); diff --git a/lib/routes/telegram/channel.js b/lib/routes/telegram/channel.js index 6ef68a6ab01984..d255a216c4aa92 100644 --- a/lib/routes/telegram/channel.js +++ b/lib/routes/telegram/channel.js @@ -53,7 +53,7 @@ const mediaTagDict = { export default async (ctx) => { const useWeb = ctx.req.param('routeParams') || !(config.telegram.session && config.feature.mediaProxyKey); if (!useWeb) { - return require('./tglib/channel')(ctx); + return require('./tglib/channel').default(ctx); } const username = ctx.req.param('username'); diff --git a/lib/routes/twitter/keyword.js b/lib/routes/twitter/keyword.js index 42982ed4d55098..01bfca71ad85ac 100644 --- a/lib/routes/twitter/keyword.js +++ b/lib/routes/twitter/keyword.js @@ -1,3 +1,3 @@ const webApiImpl = require('./web-api/search'); -module.exports = async (ctx) => await webApiImpl(ctx); +export default async (ctx) => await webApiImpl(ctx); diff --git a/lib/routes/twitter/media.js b/lib/routes/twitter/media.js index feb81050abe6d6..595b7165cd8ff8 100644 --- a/lib/routes/twitter/media.js +++ b/lib/routes/twitter/media.js @@ -1,3 +1,3 @@ const webApiImpl = require('./web-api/media'); -module.exports = async (ctx) => await webApiImpl(ctx); +export default async (ctx) => await webApiImpl(ctx); diff --git a/lib/routes/twitter/user.js b/lib/routes/twitter/user.js index 7fa73ad558fae1..70359ed26b9778 100644 --- a/lib/routes/twitter/user.js +++ b/lib/routes/twitter/user.js @@ -1,3 +1,3 @@ const webApiImpl = require('./web-api/user'); -module.exports = (ctx) => webApiImpl(ctx); +export default (ctx) => webApiImpl(ctx); From 9e8b7dc462f0649157b11a9c1cdf53b63bd42044 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 2 Mar 2024 05:04:55 +0800 Subject: [PATCH 9/9] docs: esm export --- website/docs/joinus/new-rss/before-start.md | 4 +-- website/docs/joinus/new-rss/start-code.md | 36 +++++++++---------- .../current/joinus/new-rss/before-start.md | 4 +-- .../current/joinus/new-rss/start-code.md | 36 +++++++++---------- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/website/docs/joinus/new-rss/before-start.md b/website/docs/joinus/new-rss/before-start.md index 4843f30a033eaa..fa98d10a4a8579 100644 --- a/website/docs/joinus/new-rss/before-start.md +++ b/website/docs/joinus/new-rss/before-start.md @@ -96,7 +96,7 @@ For example, if you are creating an RSS feed for [GitHub Repo Issues](/routes/pr ```js -module.exports = (router) => { +export default (router) => { // highlight-next-line router.get('/issue/:user/:repo?', './issue'); }; @@ -106,7 +106,7 @@ module.exports = (router) => { ```js -module.exports = function (router) { +export default function (router) { // highlight-next-line router.get('/issue/:user/:repo?', './issue'); }; diff --git a/website/docs/joinus/new-rss/start-code.md b/website/docs/joinus/new-rss/start-code.md index 12f934734556fd..b85af9fac6ca36 100644 --- a/website/docs/joinus/new-rss/start-code.md +++ b/website/docs/joinus/new-rss/start-code.md @@ -31,7 +31,7 @@ Here's the basic code to get you started: import got from '@/utils/got'; // a customised got import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { // Your logic here ctx.set('data', { @@ -51,7 +51,7 @@ As mentioned earlier, we need to retrieve the GitHub username and repository nam ```js -module.exports = async (ctx) => { +export default async (ctx) => { // highlight-next-line const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -65,7 +65,7 @@ module.exports = async (ctx) => { ```js -module.exports = async (ctx) => { +export default async (ctx) => { // highlight-start const user = ctx.req.param('user'); const repo = ctx.req.param('repo') ?? 'RSSHub'; @@ -90,7 +90,7 @@ After we have the user input, we can use it to make a request to the API. In mos ```js -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); // highlight-start // Send an HTTP GET request to the API @@ -119,7 +119,7 @@ module.exports = async (ctx) => { ```js -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const repo = ctx.req.param('repo') ?? 'RSSHub'; // highlight-start @@ -160,7 +160,7 @@ Here is the final code that you should have: import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); const { data } = await got(`https://api.github.com/repos/${user}/${repo}/issues`, { @@ -210,7 +210,7 @@ module.exports = async (ctx) => { import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); const { data } = await got(`https://api.github.com/repos/${user}/${repo}/issues`, { @@ -265,7 +265,7 @@ import got from '@/utils/got'; // a customised got import { load } from 'cheerio'; // an HTML parser with a jQuery-like API import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { // Your logic here ctx.set('data', { @@ -283,7 +283,7 @@ You will add your own code to extract data from the HTML document, process it, a As mentioned before, we want users to enter a GitHub username and a repository name, and fall back to `RSSHub` if they don't enter the repository name in the request URL. ```js -module.exports = async (ctx) => { +export default async (ctx) => { // highlight-start // Retrieve user and repository name from the URL parameters const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -359,7 +359,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -407,7 +407,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -488,7 +488,7 @@ Here's some basic code to get you started: // Import necessary modules import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { ctx.set('data', await buildData({ link: '', // The RSS source link url: '', // The data source link @@ -507,7 +507,7 @@ Our RSS feed currently lacks content. The `item` must be set to add the content. ```js import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); const link = `https://github.com/${user}/${repo}/issues`; @@ -546,7 +546,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; // highlight-end -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); const link = `https://github.com/${user}/${repo}/issues`; @@ -599,7 +599,7 @@ import { load } from 'cheerio'; // an HTML parser with a jQuery-like API import { parseDate } from '@/utils/parse-date'; import logger from '@/utils/logger'; -module.exports = async (ctx) => { +export default async (ctx) => { // Your logic here ctx.set('data', { @@ -621,7 +621,7 @@ import { parseDate } from '@/utils/parse-date'; import logger from '@/utils/logger'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -676,7 +676,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -703,7 +703,7 @@ import { parseDate } from '@/utils/parse-date'; import logger from '@/utils/logger'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param(); diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/before-start.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/before-start.md index 020841def82a90..151fc07019a191 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/before-start.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/before-start.md @@ -96,7 +96,7 @@ npm run dev ```js -module.exports = (router) => { +export default (router) => { // highlight-next-line router.get('/issue/:user/:repo?', './issue'); }; @@ -106,7 +106,7 @@ module.exports = (router) => { ```js -module.exports = function (router) { +export default function (router) { // highlight-next-line router.get('/issue/:user/:repo?', './issue'); }; diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/start-code.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/start-code.md index abb4023baa6ddc..5424122b68e2ba 100644 --- a/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/start-code.md +++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/joinus/new-rss/start-code.md @@ -31,7 +31,7 @@ sidebar_position: 3 import got from '@/utils/got'; // 自订的 got import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { // 在此处编写您的逻辑 ctx.set('data', { @@ -51,7 +51,7 @@ module.exports = async (ctx) => { ```js -module.exports = async (ctx) => { +export default async (ctx) => { // highlight-next-line const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -65,7 +65,7 @@ module.exports = async (ctx) => { ```js -module.exports = async (ctx) => { +export default async (ctx) => { // highlight-start const user = ctx.req.param('user'); const repo = ctx.req.param('repo') ?? 'RSSHub'; @@ -90,7 +90,7 @@ module.exports = async (ctx) => { ```js -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); // highlight-start // 发送 HTTP GET 请求到 API 并解构返回的数据对象 @@ -117,7 +117,7 @@ module.exports = async (ctx) => { ```js -module.exports = async (ctx) => { +export default async (ctx) => { const user = ctx.req.param('user'); const repo = ctx.req.param('repo') ?? 'RSSHub'; // highlight-start @@ -158,7 +158,7 @@ module.exports = async (ctx) => { import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); const { data } = await got(`https://api.github.com/repos/${user}/${repo}/issues`, { @@ -207,7 +207,7 @@ module.exports = async (ctx) => { import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); const { data } = await got(`https://api.github.com/repos/${user}/${repo}/issues`, { @@ -262,7 +262,7 @@ import got from '@/utils/got'; // 自订的 got import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析器 import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { // 在此处编写您的逻辑 ctx.set('data', { @@ -280,7 +280,7 @@ module.exports = async (ctx) => { 如前所述,我们需要从用户输入中获取 GitHub 用户名和仓库名称。如果请求 URL 中未提供仓库名称,则应默认为 `RSSHub`。您可以使用以下代码实现: ```js -module.exports = async (ctx) => { +export default async (ctx) => { // highlight-start // 从 URL 参数中获取用户名和仓库名称 const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -356,7 +356,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -404,7 +404,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -485,7 +485,7 @@ module.exports = async (ctx) => { // 导入所需模组 import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { ctx.set('data', await buildData({ link: '', // RSS 来源链接 url: '', // 数据来源链接 @@ -504,7 +504,7 @@ module.exports = async (ctx) => { ```js import buildData from '@/utils/common-config'; -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); const link = `https://github.com/${user}/${repo}/issues`; @@ -543,7 +543,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; // highlight-end -module.exports = async (ctx) => { +export default async (ctx) => { const { user, repo = 'RSSHub' } = ctx.req.param(); const link = `https://github.com/${user}/${repo}/issues`; @@ -596,7 +596,7 @@ import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析 import { parseDate } from '@/utils/parse-date'; import logger from '@/utils/logger'; -module.exports = async (ctx) => { +export default async (ctx) => { // 在此处编写您的逻辑 ctx.set('data', { @@ -618,7 +618,7 @@ import { parseDate } from '@/utils/parse-date'; import logger from '@/utils/logger'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -673,7 +673,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param(); @@ -700,7 +700,7 @@ import { parseDate } from '@/utils/parse-date'; import logger from '@/utils/logger'; import puppeteer from '@/utils/puppeteer'; -module.exports = async (ctx) => { +export default async (ctx) => { const baseUrl = 'https://github.com'; const { user, repo = 'RSSHub' } = ctx.req.param();