diff --git a/lib/routes.ts b/lib/routes.ts index 314ff617b9..64564096de 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 cf37b050fd..9d130df1ec 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 b95ff1686e..ed0e3c3945 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 1839e7de04..f00ad49846 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 43b70ef7d7..e986b4842e 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 45b3b913a1..cf27ba013d 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 48f2527d6e..874c04fa6a 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 91a6a84414..6f45ba54b7 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 04f0b24012..00292dfcf1 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 91a6a84414..6f45ba54b7 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 4b358d8a52..36b80bafe3 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 c7bacc6a8b..cef7251e5b 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 8580432b9d..213e8c70e6 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 4ee406af75..ca0a837686 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 283fdd29d9..4198622529 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 8391d9a61d..4dee490d9d 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 49abeb9b6a..1ccec04a89 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 7c89723f84..6791738cbf 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 54acfdc44d..58e9bc693b 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 010ef8e6fc..3f5e3bcbb1 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 00cad4e5e6..ab08bb3bd3 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 b2d453e975..7db04339a5 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 44a5613d66..fbc97c929e 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 6896d61f74..f39593f292 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 32d4caa819..f097f950ad 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 b5446fbe9c..8a4372fa1f 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 b85570d2b5..f70cfdf82f 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 46c178bf9f..2e092c349c 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 ef1485e4e6..59b231c45f 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 a05db6c5b4..003b55a49f 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 5e321d8fb9..7ca981aec1 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 2c01ed9df2..c0d2ff02ff 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 7220f4d95b..530fe4c846 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 9f37497d59..578ff1b74a 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 028c447088..8cbf4389b7 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 7715208401..9bc8c038a0 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 be23573a81..a17d0675b6 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 bda8e27b2c..e8e581ad8a 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 c3257e4005..980db60d25 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 074bd7d3a8..e5f05a2244 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 7031faf80c..abe7deb075 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 5717066666..75b01fba35 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 d981a68ea0..0dbd420b6c 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 586e3caca6..e37d23a111 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 c8035aa473..f20fd4f137 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 c34676efd9..28cef7111e 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 2a7e12b6fb..418ccc5d0b 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 5268389d3e..e6c7f98314 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 9b1881685e..393196e14a 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 189ed3122b..ce24090299 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 4703c7240d..4ec00c4c2d 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 ae30b9d68a..b3f4b35f8f 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 ff634bebd8..44049e8e3e 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 129d668519..247a4d5505 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 e80251b694..4384c5f071 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 ce0df1288f..4f00f6c846 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 b11f4bbb23..b248d16bd5 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 3dc7631a9c..85dc5c61ac 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 d61d3ebacb..02eac48d3d 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 dc4c8f5cf6..f70cb95490 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 27c59d7896..ef765954d2 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 48862b0f0c..fbe01a2d75 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 376ded9fe5..915d40205e 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 437defa713..31c0a615a3 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 51e2486248..5c7b83ecc9 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 ac131412e4..614635cd73 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 f764412d80..dc9be176aa 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 14198223e3..8e8df76fdf 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 1498ead368..423fec16f8 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 1f56d45001..81cdfe6917 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 3f016a0f1b..8854834fab 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 cca8817bde..bf2d5452e7 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 9492e563e3..a201e3b7c6 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 970248acf9..0da3a23591 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 13bd5d41ed..3f05855804 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 15755d3540..c83e9d545d 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 7be2293b85..a45fe42492 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 b29db20a1a..b48fc200ee 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 932d151cab..b10b8cba26 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 4074d0543d..ec1bfd6e40 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 644e5112f8..2dfd9817a4 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 151b5753fd..87181718e0 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 ae25139e6c..14e612b98a 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 2e6259aa13..68bddd4931 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 91a6a84414..6f45ba54b7 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 ffd6c27462..cbea98d92d 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 86a3bce3a9..49e420246a 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 14297e7df5..1cd6375953 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 29085d755d..2bb14d40de 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 d2405b8f96..b4112480aa 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 0074d06ffd..aa6d88a438 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 70a5086ddc..029aef75ec 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 c61e8cacaa..e0b1375ffe 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 e6cd4f6254..abbe2965c9 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 befdb07fc2..17260b3e35 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 3e187442c3..69e5191b01 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 91a6a84414..6f45ba54b7 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 242946bbce..963ba84595 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 89acec5aa7..247ec29074 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 a51cf9dbc2..e29f710fd8 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 ad402868e4..40a9ed2454 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 7055da0e17..3dac4a6671 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 1b37220116..296af37dee 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 50ef64c147..a674bc3b9a 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 829101ec2e..6983d696d7 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 588fcad5be..11e6fe3259 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 e18ab00e96..8059453034 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 56b183011a..053ae4cee0 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 257cef01e4..6be4ec49c3 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 5c89b51900..cffd8f2def 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 55f43ed817..31623f5dd0 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 8baa7b7a6a..1bb71e38e5 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 9203a97a94..5e4b7f6b57 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 37566a5a49..abc26382cf 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 ff7be9a1ee..cd31412a35 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 49100cf79c..8340f2e727 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 d781817318..1d1c8d8b3f 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 af9231053b..cf0a9daaef 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 02677367a9..1ee007347c 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 422838520b..f4b7cf4f52 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 d85ece4e7b..8f54088dac 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 299d1d6b68..486f5842c9 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 fe7a6d9f1f..eec9d8a66e 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 38ee120f45..736d8da35a 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 f8ce37d609..fb654040f9 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 63454f2c61..7026d3b4da 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 12f566d0b1..44de818fb8 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 de87b52670..c79f907ed7 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 800fcb458d..d262d4772e 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 c8be8bd869..2f9b26e3f8 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 a9e2fe51eb..3709804fd6 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 8e79ab53a6..89d4938217 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 e0154d0ee1..90dcb2b320 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 e8ac81cfb2..378024d7a9 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 73e5d1472c..cb7c17b0d8 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 931d32e7f2..672901d57f 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 22262a6dc7..9e325d1e01 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 07e4745bcf..8b2b38cd80 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 cf227695f2..5ca24ae562 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 7d445cf451..3f0ce2e94d 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 c800b6ea0e..1dbe8bd1b5 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 c13ccb0564..f04646f89b 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 bd25c22a2f..3c9877e17c 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 1cf7cbc408..c7aaccbb12 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 4296c8c197..611f80b11b 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 8024343baa..3a2c157793 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 033bb5c47c..56f7ab431f 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 aaadf47c83..33b4a3af45 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 0d08fa87ce..6fa12feeb1 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 3f6920c32e..2d7b0079a1 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 ae6fafdd6b..79a14f01d5 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 3ad71f3179..be8a3e99f7 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 f130c6d398..2c2de0abb6 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 73c23528e6..1a04fca20b 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 a464993a1d..b3ad0e5bf7 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 84a8b163bd..a019b490cc 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 c3b6ffb51e..677dfd592f 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 e5cdef3ba6..342e134b91 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 8f86930db6..868acffb21 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 61745dbf67..7f26e6419a 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 51a35c6612..be9061249e 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 774ddcd037..06b2206281 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 a126f29432..6ab15dd410 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 de87b52670..c79f907ed7 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 6991430d0d..38670d543a 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 e8e17681b0..81356dd427 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 7593674c33..77261f4e55 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 05683e2034..38d40b3613 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 cea513802e..b514310426 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 67a2331e65..bc407336ed 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 465f86cdb2..74cb5a1500 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 314a8eb61e..73a8fdaa6e 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 251cbe74c3..a2a79c9106 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 a38cdf8979..9653428592 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 91a6a84414..6f45ba54b7 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 518decb4d7..d1328889de 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 bb0fcab415..f4ce96520d 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 c0a6f4e42a..5e2de9230d 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 3a099e6f9c..c834c976e3 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 ff93df804e..454ddb5114 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 ea3e78a3f8..6e95d15a0c 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 c8aab7f692..3daacc74c7 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 8dc914a1c9..9a3c86b5ea 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 806e83ca66..1eaf72d104 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 148cedc79a..e732b467e5 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 3de8ec86b5..5a078badda 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 de87b52670..c79f907ed7 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 a38fc81213..73bf773993 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 914f67bd93..9e83217f8c 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 0f50a7a20a..e77742cd51 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 226be9f865..6cf820db5f 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 110a1eca4d..c656723101 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 64c14b6331..503b943cce 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 e08aa77694..da5910733e 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 8848bc2ddd..65271e3ce1 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 f9c4043c3e..f1b40401b0 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 9659062a03..5fe41a1725 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 fab93da48c..81e7006077 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 bbddfd8421..e86ac0c41e 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 a4f6f3eb86..d8dd2a29f9 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 73c6cb4699..21587c3468 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 331ca0c581..9a3852ddcd 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 1005ce7d1d..e7b5f1bd5b 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 32f0a41e0a..394d840011 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 bb93386669..0bcd82a5c2 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 a74a9d218e..4111471413 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 ec490cc373..518f9c4f4e 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 37e11a1d23..064fca7f3f 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 daa5683a26..a95cfca21e 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 79bc3ddce6..6a235812ef 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 82591cc74b..fab74cfdba 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 c1754a9d5d..61efd4ce7b 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 8fdd6be4dd..5ba4f259f3 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 57005a13e8..937bf79aed 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 6ab63a8cf4..172a8983ce 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 4c61c7c887..0ed9a40993 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 27ce925391..bc16285988 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 1dc702b63d..1fa99517d3 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 4556db1474..286675c2b0 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 3adf9a8a7e..967807b85f 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 5a29dfceed..598a58cf86 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 c6175f5f11..cc9a72280c 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 8f8b44dc80..e5ba33ae4d 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 3f98fd793a..7ce33495ff 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 7d71f0176d..d34e36e21c 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 5c89b51900..cffd8f2def 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 50ffdfa21a..bcbc1d3e4f 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 a2568f8c7f..cb3d3d2617 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 1de580e27f..d809f73620 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 b5787856fc..03247a4c94 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 615046bbe8..c735a53ff4 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 e074313215..69bede3cdc 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 8460fefce2..edd7e1d8ce 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 b610024188..74ed533fca 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 5fb17c70c6..2f3385d8bf 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 9be0c05f65..46ea4ecbd0 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 ccaa078f35..b62d2c7458 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 0a5c4a5482..e8565078a1 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 2b72efcb27..ef5edfbde0 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 e08aa77694..da5910733e 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 1fa1adef8c..9455156ceb 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 91a6a84414..6f45ba54b7 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 aceb3acec6..ee43f352f8 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 fa990c286d..32a2038816 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 6ae5b41901..247f6b2f35 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 c254fc310c..a41c9d35c6 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 94409d83fe..de3af370b6 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 0dc037fa70..a85005362d 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 484f01c066..3df50f2561 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 3398e32355..3cf2461d75 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 039df6b9e3..1179f9e602 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 efe29739d3..129888253b 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 6d001c8f11..efbd73d361 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 17f6200775..18023044a1 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 9de661b18f..33b5e931de 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 c5db847a9c..6c8929ce8e 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 d82f111268..52a0b8a5cd 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 733c1313af..fb92b7a2eb 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 956a6468ed..bf1d8a41aa 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 2174a80e9e..65ff398177 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 b8440f91be..a7268fca0d 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 9c918fce99..b81da07d65 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 906bf1ffb7..7289a292b2 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 ae29d29a2c..412ad9e8eb 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 573f84aced..06aaaa45a1 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 ab3025d920..ac92dc0a5d 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 91d024751b..805c4ae71d 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 49374ae089..81a6f908c8 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 c34676efd9..28cef7111e 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 93b2e3e2bc..4645460cd1 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 91a6a84414..6f45ba54b7 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 a7d48a52b4..cb71539b4e 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 2b4adfb5d1..8f6a333a5e 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 ecef0ffbf3..9eda004602 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 bc9de1afca..3c9877e17c 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 8c4df68fbd..4427969211 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 af8cb3304b..320452cf00 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 8234f3a361..831b60dc3c 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 e22abbf5c8..2e367b46ca 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 3ec8d90767..3b8e372aeb 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 b2ce5631af..bff3ebf291 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 99fe5f8175..11608fd668 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 6ec2c5ed9b..b9fc4def17 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 28d786c13d..4bfe406d36 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 f710875706..f6ac19a0d3 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 c6677074e4..e8f740afd8 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 9256677c5b..80d64c6b3c 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 34335379b2..35b388dddb 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 372f6c4acf..4725be4648 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 f46d5dd9d0..62b67c2d66 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 49af37fc56..deabec6a12 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 454419ca03..9656326023 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 2f7223b4f3..b782b028cc 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 60963e0e35..6802f15ac8 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 dbdcc51268..32b6f523be 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 7b84873c69..698c8e8597 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 142a5bdfeb..b34b59cf96 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 2dfa7cd486..cc115c3dbc 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 57c6357b79..99051037c2 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 d93291113d..89bd6c4d11 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 640bd3594c..5818f4028b 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 7e95fbb58a..1d02e87f6e 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 ac68314bed..0a3311ffd6 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 915c8d9996..40337aacde 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 6321f65238..cd9b223b20 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 45b1e984ae..60bf7f1175 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 230ed09e86..80b1abac61 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 a01cf91341..06c415d001 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 c4941bd052..155ce7373e 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 3fc1ba889c..125a73556f 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 8b6f220860..0b3aaac351 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 540902a76c..29fccf3149 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 537a858d72..12148bb018 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 67f66c48d2..726c31b6ff 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 4c4bc259a6..e5c23e7980 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 d1daf11e8d..bab0a5bad3 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 67412cf41a..5574d0da6f 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 343f664a18..739d7fa2ea 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 c4eca69bc8..168e4ab5d5 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 67350a60b3..eb240417ce 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 f004d0b43c..3c307bcf81 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 de2ecfc11d..4a03702173 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 54d120956f..cd4e028f57 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 b061f0a4ae..0d93f9d7be 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 47901f3ed3..673f8e4cb9 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 30c2a30c0a..d0ec308558 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 2e1a12d92f..09957ba2c4 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 ccee8f790b..00127ec9f4 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 0fb3de86b5..5d964cfa8c 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 cbe8e4b9f9..f3971bbca9 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 53fd0d5c7a..6631156114 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 15393da3d6..0b562c0f77 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 b76c09255d..6ab3757347 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 bbe809bb15..c50dd54b75 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 6766c5903b..acb3bc1b05 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 96aba37e96..3a58e71c40 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 91a6a84414..6f45ba54b7 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 d10de38d0b..5474cf928e 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 7eeec9028c..e123520f29 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 1e3d23a2cd..9519830f56 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 c2164bcac0..1cd05f9109 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 4280961512..705fd438c8 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 8ea1fbe636..c9e8953733 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 f6725d6260..14b196951b 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 52d02438b3..cddcd86010 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 cea9b41c25..763b74e597 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 e08aa77694..da5910733e 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 7c0e687fcb..3f83ddac7c 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 924cdbe8c9..51ba73124d 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 278fed8bc8..830bdd1d28 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 70c0daf3af..d103fe7ca7 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 97f1cce820..c865d7bfe7 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 aedd1dd40a..672ff1f3e3 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 1fe5601b82..b880c4ccf4 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 6b4fb49a47..412c32ba30 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 a4cb0b838b..11738bd348 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 3147c21e20..a16a6a8646 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 2b97bb9493..f93111e209 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 5d7dc35d6e..c7b6ee3d6a 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 47ce2498dc..6fd05f06e1 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 68c83c6659..aebcfae20c 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 62eaffde74..95d2ece934 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 943c3af936..09a9e4904f 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 02b19006ea..144683a6b9 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 680974dc73..49a7c04ba3 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 10be26eeac..8e69a74d28 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 57012e2a77..8653013060 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 b009a2e803..dcbae601d0 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 c04e485341..5c0002974a 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 4bd14cd650..6386f8d3f3 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 6d63ebe10d..19d6801d06 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 b43b54d783..f3e717ba88 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 30c419ee45..8f54ae1232 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 c50ebe38ce..5e23aec8e9 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 780e7f2c3b..78a5f410ef 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 bb9844a2ce..58fe3a6d41 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 3b47dfa4b6..56ac52358f 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 706ed26f89..5cc4e62f04 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 de958e2e6c..11abba62a3 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 abcbee61b7..308dc2f1d1 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 cc1ab22c44..5a9ec53335 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 91758d38a2..cc70151e46 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 68c9d00dc6..1997c6f5e8 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 9371f3176e..3e817bd67f 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 16bb1314bc..3e2577f35d 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 5db50869af..0bcd82a5c2 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 5e11421763..be94b9f5f9 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 625259564f..cd57ba05cf 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 a74dc25b20..3b6bc3215f 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 ca342afb7c..80cefced5d 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 9ea4bb936e..6b79c09973 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 4f214af449..116808371d 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 4eee56c442..2fc29d2a1b 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 ccee9994b2..b0b261f4ec 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 2ebca4c265..0f98787ca6 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 881c2da55c..c027e63d50 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 bb93386669..0bcd82a5c2 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 d7f7ddb7a1..33d976d917 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 a8388f1d74..572c3dae8a 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 04b1889032..9f7be9e857 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 66a8994ff3..05a5904a1e 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 c7b7500ef6..16346ab70a 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 fb63984e68..80f48cb711 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 47029fafb6..023a5755a2 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 6f9b795152..7ff565c6b1 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 c3df8d0618..9cd07e1c41 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 3a9d936920..5edb67a2c6 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 4e016214a5..739a5c3117 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 09d5232b74..ced2307f8c 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 c5064c5f39..4ea8ec25e9 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 202640a4df..6536d5745b 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 e832ed962b..95d32c1519 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 e9a5b6af29..f4101100e9 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 0e1bdc5ccd..1c91640fc7 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 b610024188..74ed533fca 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 34e6b711d5..a6c3c5064e 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 2960bc23ff..e7f4e94e0a 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 bbceaf2c8a..4509721016 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 8ca3a5cf95..4ae374a975 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 47c05bb279..fe527ba17d 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 bb93386669..0bcd82a5c2 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 41c7311912..a23b0f79ad 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 385bd1e6e6..6536d5745b 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 2b195e1769..3963632c13 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 55b34fb824..a748cfb4be 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 6336bf4a13..c4923bcc7c 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 3d96e03539..dc9d1ddaa8 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 5bc3a6ba52..1b096eff97 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 e86078db27..f2e6ad78ec 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 6fcedfd701..bf6ac915e7 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 82182fc0f5..aac758fcad 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 c596a72f72..3cf97dd4ad 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 d9d312e16f..cd57ba05cf 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 31b19352c6..b91166d6ad 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 c34676efd9..28cef7111e 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 c46d5c0dc5..edb9eb9601 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 21b60618f2..0142a3c1d9 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 7159865633..e85bebb88c 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 5e90b73098..4b9ff0ae81 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 40d1ad88ad..a0a40bb65d 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 0878a0faff..b41f515a79 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 13a796cb2d..97c771694c 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 1969245b16..a5bbeeddf6 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 441eb0600b..d4eb3f0307 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 30e6bfc80c..f8cc91ca28 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 0854bc475c..cb0164c4f9 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 df0359ddfb..29075a980d 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 d8e9b4d866..f69d45bef4 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 86340220c7..699c5cf13f 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 d0dc5a441a..9dfaab0cb0 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 c884c525a5..d3f2afcc4e 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 18eb11e3cf..d13af1255c 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 6389b9fe3c..53b6d9a744 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 5db50869af..0bcd82a5c2 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 c2cb4a092f..bf8715acf0 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 6ea9e73a12..3e16705b55 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 9659062a03..5fe41a1725 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 5bf78c0f85..54ce396148 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 7102dee136..0374fc7114 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 bb93386669..0bcd82a5c2 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 f0c89f64f0..40df892fe1 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 323c3ca6f1..b84c130aa1 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 25dc76664e..0645276587 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 61439a0318..3ffecf2b1c 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 90ccdb7125..43570014de 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 d5f332d29f..0596db8970 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 b8cf49ca75..44c8b249ed 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 66c8a74399..79a6d0aa70 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 bde4a80402..24094a74a1 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 a3db0b7af5..b83167dc0b 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 2c6014fb36..716467bafb 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 b7f71e315e..b7b9c985e8 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 20bc460935..7e157f6715 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 d0b4a46d86..9b78e725a5 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 c4ad5e17f0..bb216cc987 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 b870d81b6b..5bdbab9f69 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 0915cfed75..40b899d0d6 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 64fff4574b..4a7def7787 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 7f3759fe7d..02536979d0 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 0868ce8438..22684639cf 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 27109efe55..f7c882eb37 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 aeb99acb55..34a9ddf8cb 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 5137c784f6..3e67a00edd 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 7e8d920a86..a6ce27db1b 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 b2426f4222..0aa30aece8 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 c34676efd9..28cef7111e 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 b7fc58d2ab..1e87007528 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 f17c8b2ac9..bc350ff95b 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 d5326c8999..862f00e925 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 887a32a463..2912b16688 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 1a8ec793f6..7640f0b481 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 05664377fd..d4c60d4a80 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 6ddaf8cb9a..02608aeb7e 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 b66582a08a..895f6dc12b 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 ee20bcfbc7..b00fca6005 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 b08a8c850a..a425675ad4 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 3557b8c2a0..e195634a91 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 a212765c3b..8a502f1a10 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 9ac86ef9cb..497e358d08 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 6a5c9a29a8..85b714e7f8 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 d843249f6a..ef34beadae 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 b73ccf36c7..2336cfdd67 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 a3bec6fb86..5fa05ed442 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 317e8ef405..ff40be1bdf 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 6b47421168..e8504ac871 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 20e39afb2c..529e39674e 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 41b6068fe3..d47f73c44b 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 35cb22ba9d..1d95f2b280 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 166a656589..ee4223bada 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 9b0d40b771..cd9dc6066b 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 e7e31b425a..f0293e8968 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 ffaf9450e8..80e799986c 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 904a3272d0..04356eab14 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 08a906c972..95ac6c24f5 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 dd8215f6ed..1611fd8569 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 76aab4e98d..a1515a4834 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 23b388684b..d826825a1e 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 323c3ca6f1..b84c130aa1 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 55be0483e0..540e97ed3f 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 9a89c08e93..6c52c5718b 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 b77fde37e0..181ed65b14 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 728775facf..82e4b54c03 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 78af74c062..0f27b53e16 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 323c3ca6f1..b84c130aa1 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 9b5aa3ccd7..dfdbb4af50 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 70c3c41f07..444d5437c7 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 70d8782160..617ba832b3 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 335af3d090..6c0d57b8ae 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 3de621d298..53a2347395 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 ee20bcfbc7..b00fca6005 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 a63eff722c..dbe53e8353 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 80bf1c2c93..06c4d3ca19 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 45bd73aa2f..61a360270d 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 6b650ba448..841b649dea 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 e0a3ae3011..f8c9d83e68 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 87d6590b48..eeaf8279b4 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 de958e2e6c..11abba62a3 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 2da9b34289..689b6c5cb8 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 224a767669..97c415314d 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 e0420d9613..28cef7111e 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 8400895724..16deacddb4 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 455a33773b..0e66db68be 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 a2ea020239..6ece3b6baa 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 6a20367845..d93a94ceab 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 81d0ce005f..bf5f0b92e5 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 49d4978b2f..95926ceb59 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 78fe301190..e3e7278484 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 179b310d23..2ff6f9d14c 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 e08aa77694..da5910733e 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 31a1fe28a9..90c66ec78e 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 d0e4298422..7bdc514aae 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 ba575a18e1..3ec3224465 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 df5c593274..6915ae34cd 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 19e00b0d1a..e30b515175 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 2bc54d1302..f067105bdb 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 d2435646c3..2e40d56104 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 af1fc16e31..d78ef6be00 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 a7252a003b..4b3e22ea74 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 83c90bd9b5..9a797dbf8b 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 79e9a3eebf..47201f03f9 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 2d9095f937..5dc900cd25 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 f628a642af..54ff8dfd3e 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 152674dd2e..772e0c2869 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 1723179ba0..412a4d036b 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 b5ad68a741..806f509d58 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 0fd159e67d..4348d5ba35 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 73bf5d6451..1a464e16ea 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 5d85e678f2..d1122ad859 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 8a8e46b4df..cb6c82cad1 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 f091a5de22..bdc0146f73 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 6a5036591d..e09a11683d 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 d825dbbcda..4fb631623a 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 971a6ae3c4..220528d801 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 7a2cc28f7b..5acb6bf57d 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 6a69ed1e33..4a99c52dbe 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 d56df7088c..2b96944c91 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 fe35fcdeee..d432c5bbdd 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 0953100229..8034f2f1c5 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 90e0af5a5e..b1afab9433 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 6ab3c88e82..98d772d60b 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 56b183011a..053ae4cee0 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 38e2607e8f..baee834445 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 54287cfb81..93581cf875 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 20bc72f245..aacd29ec9b 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 c28fa3c4f7..e8ee53fa5e 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 8620e5d8f5..c508827e37 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 3190ab5e16..611f80b11b 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 8b42eb36be..72441f5c6b 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 e7ee9aa57b..98a5ec9fb1 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 84e9655564..2c6edd825f 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 01b75bbd29..4929d9f60f 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 a2585f740e..5eb44250a2 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 0215d22405..fa02d29a62 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 013be054fc..b79340dcac 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 242670ed33..f15faccc56 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 1b1b0636e2..10fa80c1dd 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 fd54ced0f6..ccb09a9471 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 23d19cc9b6..0c7d802086 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 cc76466443..b9687b52f2 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 2a211958dd..e0d08ed187 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 35468b07fa..7283f7029b 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 1d9c5508e4..e237750dd3 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 9bea67680e..1bfe70d5ed 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 beba4f3fec..7ce45f0c71 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 08d5f62fed..8dc9e2e2c3 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 a69b8abdf2..127bd410e2 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 74ed06b680..9520e18b9f 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 f718cbb1ae..6ed469db11 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 4dfb78005a..0d5b2da9b6 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 fac7fb1a62..59b1674da0 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 9486a9c06c..60f5a37bba 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 ad5f6eb976..57d2da0bba 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 0e3d64a08e..bfb1aac105 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 52e12d77e7..4d0fd2d2d1 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 d9b312005d..86e018dfec 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 b39c207b5e..b8665610a1 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 99f7d04265..1bc6a3f6b0 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 48614260a0..990ed2b445 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 47ce2498dc..6fd05f06e1 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 208726a820..ffebecddfd 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 bc9de1afca..3c9877e17c 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 79e4bbf4ad..e460f30803 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 6551c4e307..5c29e60f15 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 81dd31b33d..2030bfd425 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 a19819fc81..43e7c58a8c 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 82329f33ba..e75fbd6e30 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 47ce2498dc..6fd05f06e1 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 495563bf9f..8cdb87864c 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 59c55af9a8..bed4f0ea27 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 8ee02b4fd3..05675bf274 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 25fed9b475..8555983556 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 c25fb54b02..b5fdd0b02d 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 f008755dfb..5be0ed8cc7 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 2334d3e4e6..742ac57c2a 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 2f2d694cb7..3c447e7203 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 9fc19339d4..f994ea4a80 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 340386363f..26e9832abc 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 5779100ae8..6c806bd0e6 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 54cc6456e1..ca3e65042d 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 6da147060f..f51c2d8a20 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 804dfa6c2d..4dcbeea03f 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 1746c32011..1043570032 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 c34676efd9..28cef7111e 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 5a0f986c56..a125dfc524 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 cf1c90e4e1..57553ccd9e 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 f3be3558f1..46de38c932 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 189dcb92f6..eab313fbe7 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 f5e6937eb6..dc4557e3f8 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 b8b9026e85..3eb67b2b4e 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 895ce569ec..462d4b218d 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 b6bb67c490..7e094ab36d 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 ed709f330a..a7fbaa70aa 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 f6c553e45b..0814992c0c 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 c7b9995ad1..23fc07ba25 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 646d5210e4..30fd063164 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 c2107f7a85..991f3912b1 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 f566072145..86665fb6e0 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 16d8df1bbf..3d716907fe 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 46449992b0..ddd9308f0f 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 a31f1d2cd7..d78893fc0a 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 caaf8acac9..2f9b2e0d9e 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 009bbc834b..c3f8923162 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 42f020d911..5ba631b1ed 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 63e2a2ab17..3ced832a5d 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 e55ba6d7fb..fb9044fd06 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 9ee95834fd..67ca83c08d 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 dc358986d3..5b2264ae0e 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 d911f6629c..e7cab19c7e 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 47ce2498dc..6fd05f06e1 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 0e0ec2a542..02d30d4474 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 d469ebcd1a..95e4ed8391 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 696459adc3..4e49cd94e6 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 f595a54ab8..ba08a20704 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 4cfdf814f7..fbb70d93e6 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 bfc3fcad3c..31e02da698 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 b43ac2fed3..acf4f77ed5 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 981bc29b69..f6059dca5c 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 d16a816d3b..753605c6e2 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 c9a463ef91..6d8ad29b5e 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 c97a6976c3..b89a202c16 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 4f20efa98b..ef9b4e2f99 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 e9c52c6aa3..e533a250a7 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 9a150750d4..9ea1ef15a5 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 2b01ed033e..908c3aa7e7 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 0865a50ff9..9974b8a619 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 d92ad1b6be..9f66b3af3a 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 7f9f66b4af..acaa3393bb 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 e35db84231..8ec4386b64 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 8d0b71b35a..db9ee6e679 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 e964328ccc..a2fa170674 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 ff3708200b..7c74477e1a 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 4bbff00998..b30ea12936 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 369d05cbda..68bfd1fd28 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 529ad6af47..73961ec778 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 ac923297d6..aabcc6fe94 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 e51016ca9a..59494d73ce 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 542e4d72fa..10b2cba667 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 fd3ffe2f09..db0ebf7215 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 126a4cfa0d..438fcf3264 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 49b42d478c..5b9de0a5d3 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 a1ffafb5be..eb2e6ac172 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 7b11c9dd91..d30b59e4fb 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 1473153d35..21d4a467d5 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 7a0d9f379e..e2b85fac1e 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 e08aa77694..da5910733e 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 e668bb1138..3a2bcac481 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 e08aa77694..da5910733e 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 90d7babe30..18f8687fd5 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 e08aa77694..da5910733e 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 1d8b198b6c..f174804f70 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 91a6a84414..6f45ba54b7 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 fb87ff442e..5793162a24 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 fe85131a1d..28215a60cd 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 6e76408146..485e7c2a18 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 0385ee14cb..683a49c0c9 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 043966e71b..8d91d91b0d 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 328354473b..08d8ad8e85 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 9ff1b00760..87ef0cb6a0 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 f44bf3586f..a62147db6e 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 f96453cace..1e78f886ac 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 bc9de1afca..3c9877e17c 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 9577811b6a..d8161c87e3 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 3495c2678c..6c4f8d60dc 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 aa0fda7481..81f8278d5e 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 1c134cb755..daf05c89b2 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 550a8fa7f8..ee535c1613 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 7c71effb11..5f4b923dc9 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 fc50454000..187287dc8a 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 d4e9e943d2..f284234c9e 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 2d54e41c6a..fd8327057f 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 082ee7d78d..df85a13b06 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 9311419fc0..aa19e42375 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 01f774ae7e..f7f4ad8a47 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 323c3ca6f1..b84c130aa1 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 b8fc63f7af..eb85afb8ef 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 29f238038c..22dfff62dd 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 30af047eb5..cb2aad17ea 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 7e7e6f384d..4535da2c97 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 77ff0f7ab8..151d49e094 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 adb85a4eab..479c08295b 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 3a80e677b0..9aedae6ac7 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 72394130dc..ce4b2fb37e 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 94e58c83a4..ec7c5eda5b 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 35a3283307..3acf430d6f 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 396def5418..6d93649e3d 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 676ee5f00e..2ca19c6309 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 82ec203e8e..0354c963f6 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 0128597f0d..9f595fb55f 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 bb301da151..76628fd416 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 fb28c1ba33..264c5d00c0 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 72016fb115..3404bbbffe 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 5da5762ce7..c120fac13f 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 f35b396d41..b9db381694 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 c544a7093b..189469e019 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 bf9135e999..7e2f4af5fa 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 6bfaaeddd4..e1b4e216e5 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 18a6e6d779..8af476d8b3 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 55ee1b8d66..a05b65de46 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 bc6043a424..d0c979c26c 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 79fbef5d1c..94abec61ec 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 0fd99a80fe..f114f35e90 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 b81a05e551..dffa9a9da9 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 6bea7a44b3..4dcf2d4e24 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 5b21a3b0b8..b9a0772cc2 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 916a4d8b92..d6f4602239 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 bd25c22a2f..3c9877e17c 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 88db290011..b7c80a1190 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 fc53fd1e86..94222a6592 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 6770a0e9e4..6ba4d9ac45 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 4fd8444208..95a7b23a15 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 ce2c1f392c..4bdfd27cf0 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 8e42cedde8..e0bec26042 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 aa0202df7d..bc14d98fcc 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 7ac8f3f9d7..31880a9215 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 7145ea8655..b36fddf46a 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 7aafe25078..3d3ac3b80d 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 61372ca2a6..b9610d60bc 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 8057b04da9..6b40df4477 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 072ab230d8..1da37f54ef 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 81868a487c..7937c36641 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 696adcbe55..af2abad59b 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 d03d3fc1af..b656dae54a 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 29d38f1e43..ec9ec8d2d6 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 7b98d14c77..b85af49cea 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 ad9e11b556..2951b6b9de 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 2ee3fa5e19..fd5ca29b7b 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 1f9dd992e6..435a4f9cb5 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 f06a0fe97b..c3ba61df55 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 21739d9b99..f244c71881 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 ea3cd581d9..14249af0b1 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 177e2cab62..089eb59ace 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 8d753e0300..68d7816851 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 54f07d1611..ed36ec1930 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 1a3b59603f..4c43dab320 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 4bbb454e93..2ae067d550 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 c9783493ac..ed1a3a18f8 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 63d992af80..29c9fb7d18 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 2c0468e75d..237ec69da0 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 e2c1c82114..f20ca4ad1f 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 11d841a549..bcec5f3ffa 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 179be7a694..0ddcb5e48c 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 f7990e2399..d5ccb390f5 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 5dc871fae5..1763838c80 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 a1de87d7b0..16cd6a82a3 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 02abc62b3f..0d185d085e 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 1ced515b81..dda8f68cfb 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 b77d23b5ff..497989e3e6 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 5728784ee8..9737fcbbd0 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 70b0c41854..2807c69d5a 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 4d16284831..ae50c87fc9 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 e62fa21403..6d6e5810aa 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 44e5667a17..1533163df7 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 80d98ef6d9..51c7ef570f 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 07af9906db..ca33823f37 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 a840d2ce95..38a45b7bb7 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 0ea8de378b..425d38f576 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 c57b4b9b66..8591b50620 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 e1b3e12426..54182f20c9 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 d9f882b753..987dbd204b 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 c05d27fa4c..b4bb14b94b 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 4993721719..6340f71ab3 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 8e696e70ca..e1ea344d89 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 27b91186b6..5fbd2c2a35 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 e509522385..88a096cb0a 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 e90c10dd3f..02bb81bef1 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 6417509293..f9c7f8a92f 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 0da7c155c3..d87ae47d2f 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 05045b720a..505206d5aa 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 2e298c8fcb..16aebafd05 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 bc07ff04e4..9d8a254ac7 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 70a2a0f045..c63e40dfe6 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 6bf3f17386..06ed1359f7 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 d61ecbbc1a..60b7a33b4c 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 994c83adb5..da195d0783 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 8b0cd08b0b..cb933d30e9 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 ec1881f753..56df988951 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 4e33f23638..25bc5a2955 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 112c756873..2cab9e4ac1 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 3c2915a00e..f266025a8d 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 d609d88e66..fce23df056 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 bd890625af..070314ef76 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 e5ec4ad9d9..304f0031c3 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 e6986463c4..4db89016c5 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 2c52fdd466..b8d2fa3579 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 88ec065875..a9db29accb 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 dfdc12988d..757f5f51a9 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 6a7a636ab6..fddf686c0d 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 4abd036953..c65ea24a41 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 7ff9d2f2c4..d49f55ee2f 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 eb7ad0c4d3..8b215a98e3 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 7acdd684e1..1357b61713 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 c93f5655f0..52d568161b 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 9888faec71..d6ec8f7c57 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 9c66d1c249..0bff6e7806 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 53a7441250..6e2e6c9f72 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 009b65a8e0..461dfc1620 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 d36fa1a0bc..78b6037fe4 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 8ba3d2be59..a89fde1f21 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 9985ef2956..4fded878c2 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 3223b3141b..eb8d7e06db 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 f0c99f621b..a62b0bb52e 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 5aa023ee4e..adb63a2f39 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 7db606c90a..737fe485d2 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 ab18cd9081..980a9129ea 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 3e990bd301..fe1635b1a8 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 142b5bb383..f91498d347 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 45a568a03f..7869f5d92d 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 8e36c80e09..4d51e8ea19 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 aa0797dcee..23a9d67f87 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 f4d2eb3511..d130b8c743 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 68fae7b7fc..91d7c9ce60 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 3ea6fb9c1f..df93baf043 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 b1570402b5..c6ab0aaab5 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 b41683869e..9d7eafaaf2 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 02031caaec..f85bbe8091 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 bc0a414392..bcf0891faa 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 331e92ef3a..53af2d054e 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 8d1978820a..267cd0a6aa 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 ac695b9762..6f893457d2 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 6ffe1e350c..e8852809bb 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 3d39f0010d..566fc3f85b 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 d2219ba26b..53712ace90 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 452c00a539..2d623464eb 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 b4948de1a8..45d0d38fd0 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 e03ef6efb9..247e4533db 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 013bfc2fce..e8da2631f5 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 e9f93e0777..91db82b06b 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 3b9aa47b95..b34522a6f8 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 078f560e00..4b2288e5df 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 67d7919af0..93064748e1 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 a35b0b3a5d..b6a6109be5 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 78a4c23d23..ce6c46d468 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 5e095972fa..f97f3480f5 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 7ebb103240..17f363c219 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 052c5af571..5efe5bd6af 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 4decbf8a35..4765fc5e75 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 be5606675d..972238c2f6 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 bf38efc04b..19ad701832 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 6a58e9d757..7d18552d82 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 ae69fb8f1c..f7fa910854 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 47120a85d9..47ecfe8637 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 b7ed2a88ab..569b405803 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 196642e196..497e0fa154 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 fbad7777ac..6c174c7d9f 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 d3ef0df20a..f8ecc54115 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 4ae2a78407..aa406de8e6 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 38fc18056d..e5eef68b83 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 bd25c22a2f..3c9877e17c 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 2641d499d2..9fab39c5d0 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 323c3ca6f1..b84c130aa1 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 fa8c5c419b..ae56e418f8 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 b610024188..74ed533fca 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 4274793861..46c0744cc2 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 45821709cc..20ead7a535 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 0feea795a0..dcdb400fb9 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 17acb258ef..82355f0dbb 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 bb93386669..0bcd82a5c2 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 f202935cfb..2ce97cd083 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 ee85269ef4..0634798a2b 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 000f18686f..886acf47b6 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 cbf54ec092..c23c86f994 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 5eb5ddde12..e50a512813 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 12567547c1..9da2ed9de2 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 72d3ab8189..ffaad0befa 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 decdb39ad0..d5afafba4f 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 c490e0d607..e7eb8b6a66 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 67ae41319c..59086cafef 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 718003fa05..02a3844b7d 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 0e7f7fe1d8..c263617e53 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 95ae29a800..5e912c78ab 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 1ed29a4450..faafda4bb7 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 63ecf1e472..42bb4e4a25 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 2c3b6b9f3f..9fb54e900b 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 bb93386669..0bcd82a5c2 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 bbf6c64a6d..98915a9fd3 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 de87b52670..c79f907ed7 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 42ffe3a854..09c585b573 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 70da6d197c..5b5785a8ef 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 54672e7ce0..d95c4db2bb 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 25aacbedfc..45e64fc93a 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 eb14947328..2f036fefe0 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 bb93386669..0bcd82a5c2 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 4575412a99..415a562a35 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 30bd3e4aff..ccc3d8314c 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 3882224109..29648a7b88 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 01b9383f7e..7828053289 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 9ee72111f8..dc82f6e699 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 ca0eca551c..8c971b2ebe 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 d9d312e16f..cd57ba05cf 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 2f01598b11..48a8b171e5 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 74577fbf63..78b25f978b 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 7c567e04c8..f7d1199e10 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 6ebef7346d..eb5dfecb72 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 3080a61eed..dcf1d44256 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 1289d27024..6ad68243cd 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 0fc6fee4e2..8c71702997 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 3cd5e8b551..89186a042c 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 5244842b32..d0686b64fa 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 500760904d..e3680504af 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 ea7e7fbf9f..bd3d99c686 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 f5461602bf..da5d2b272c 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 a2c68a94ec..bbf28d3ce2 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 398ac14fd3..1fbe48e555 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 2d4184fb24..3d3e1b4e41 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 323c3ca6f1..b84c130aa1 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 0ec49069ec..3b97aedd17 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 a105ef7f20..c7fcbd9d9a 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 27210bb099..ff2171233b 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 bd25c22a2f..3c9877e17c 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 869725e7b7..fafa2fa59b 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 1576b0490a..8649b60524 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 394758b275..60e6d43f50 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 19e42ab62f..c6dae62f13 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 c57b4b9b66..8591b50620 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 7bc483d383..6f2f6e6d2e 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 09adc8bd4b..2607cf611e 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 be8d442a6a..bceca64570 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 df2f64c09f..63f29ab3b3 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 6bd0fec71e..3ab27f475a 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 5ea86daea3..478f6fd4f2 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 8476d261b2..e06ed2e1c2 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 28580e6e4b..17730a1b84 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 1f7f3e3edc..caccbe9ff5 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 9a89c08e93..6c52c5718b 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 2f2aa21fb9..d8fbf442ac 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 41ed55afca..aace2d89fd 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 4742b34eaa..b0b07cbb32 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 c62a0024ed..7f5d25daba 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 826a85d7ee..48636bac69 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 0622136e58..e970012325 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 3a2bf59fa7..81c8bf46a2 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 f73acce6c1..8dbdfa086c 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 73b2da194a..30b0e35e8a 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 e52d7c576b..299cf64c99 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 60a9b00c8c..10341fe286 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 1d9f17cdc2..19aa5e245f 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 48f3254c5f..4f1ebdba88 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 323c3ca6f1..b84c130aa1 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 83184f474b..2ef392edc2 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 2bc6cdcd22..294eda5f5e 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 ed709f330a..a7fbaa70aa 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 68d015f5eb..da7c972cfa 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 d46c2005b1..e20a395afc 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 07a7a2990c..ec7c5eda5b 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 3c9185d602..deffdfb804 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 c5249110e5..1a464b51fc 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 c7865a098a..5dae915dab 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 4339b0d236..6e5f5c1959 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 7a97be09c4..bf9123ed10 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 709362d85d..9ab870de28 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 1753f301f7..0044eccb2b 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 4358e423d3..bac3c769c1 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 37b43f2cee..8fe7b2ee95 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 0ca65b6cdc..21769dd9fc 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 753ed8fe98..11846cacf2 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 fefddc55ca..c411f1891a 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 babca852ce..478aaa43e0 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 d53d9d1825..5f00314e6b 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 5ef68c601c..af98c7154f 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 b28fb96c4b..a1acedb368 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 4d50012b46..39be02d582 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 96a0ca660b..9f96b399ff 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 a3832ad4c5..4811c0bb2a 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 a3977b6313..21e40c99b5 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 e2d3cbf2af..ef5b7fdce1 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 99d9c60ea8..e28cfbdee8 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 b2f967b307..d501d24531 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 537b5bb266..9177359d7e 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 846ed6f2f7..1c6443ed30 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 a188f68204..d6fbbd67dd 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 94ac8e04f3..3122959d30 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 c7151bcc4a..8e830fc8ab 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 b104fbd13a..c67e53e487 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 8860aaeafd..f15cf51c5b 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 212a50f9d2..de7a5e2de3 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 4b741d9e18..91b515a820 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 d586df53d5..10d72dee51 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 71bc97a358..7f5485088b 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 5a190b3ca9..0e5050f410 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 71c1909bce..8e975f6c44 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 222678a43f..5b8aa52b28 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 2c021bbe65..2a95e1d740 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 5a6e930181..d774277208 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 fbf9e17698..6185459f5d 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 057c6d332b..d8eca8d93d 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 7d51909082..951aceb568 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 f04aadebc4..49f51f7f43 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 4fb3c0559d..0aaf602b49 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 9035aff54a..13ccbab296 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 e96d44f475..c0dd45fa01 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 3c846e901c..7770caeac4 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 15d1e73826..905b31ff17 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 586a3d53f4..e040ff3105 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 b5724daaae..9398107850 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 4b16791aea..8a857f2349 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 07321a43ff..7fa9508281 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 ce60118463..913bab1737 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 8f5702a064..db82fcdb06 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 64bf4812a6..f7fc8fa78d 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 269d795c97..fd50957c51 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 46736de0c9..1e19bff26d 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 7c0512001f..d3c4bbb0d4 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 6f0d828509..4d770d9412 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 46b827571f..0bbb949c59 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 6367846fc5..a09d4c0173 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 d9aa738ed4..3f4b6435a6 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 dff4caa3ba..1463f4b67f 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 3c1f7dff0e..f3ce9f77fe 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 c5df245ea1..60e56619c3 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 1eec510be6..6ae2b1869f 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 26fa2884c3..5eddb57787 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 92b0a4769b..cdfad97231 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 1e30563526..51da0f6d2c 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 a5d6349f93..b30d21a42c 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 9513438b00..945566e5d7 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 84028d063b..e9a3c842e5 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 b8978af2ca..3cd4c90052 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 055d807b8c..ce1a99fe3b 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 6711c5f852..1d52183392 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 80f18519e5..84c95aa929 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 af1477f5e5..dcad5bfc81 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 6dab58fe1e..f6560f1249 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 4a51e050c9..c321808381 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 550650eb30..3551349053 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 83f6c7210f..23d1e4ca61 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 d494e34dd3..4f5c3d7552 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 4e4402d50f..9ca30007f2 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 fc38749d5d..43345c1cf6 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 13fc650241..df51ceba52 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 ab9a2e3c7c..810ab8e765 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 3b538938c6..9e34f34976 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 aaeabb7d1e..9573977551 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 68ff003fdc..b83385934a 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 80b764d043..25dda0427e 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 9afe84bc19..a6bf1e7809 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 af1a2cc709..ff60600454 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 9b2adee528..7787f2954e 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 f0a32dc859..9e41408d98 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 85af02b49f..b9ddaf05cc 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 0dc3aa1f5c..1f95a16949 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 e026d2d16f..28c76cadff 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 7a7697c423..da85c494f9 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 da3057fb35..12fca9ab87 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 2ac4201896..dd3912e8ec 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 f902531815..d48c93701a 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 d570ee1252..b16d653d75 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 d8a464487f..9daacd6996 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 71810f4f9f..9347975ffb 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 025e8f42ff..2aa988fa13 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 67ce94625c..5c12983fb6 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 c913a51f75..38a1e283bb 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 7bbaddf2dc..010d54d72b 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 a56d401c47..4a6a0775ac 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 48c1bb87ff..e4bfc0ec86 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 975c5ce925..52893bb78e 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 a62606183f..75a1f1e938 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 5491ea066b..c2b6c7d2b2 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 3d1648409b..8be2c5c3fa 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 6a5cc29c53..a0ca5bca63 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 532dd0aa5e..131c032b23 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 7622fe528a..7aaaf931cd 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 a945de715a..4b37c2a103 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 9b527d51cb..9ebce9673b 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 d466683414..091ebded82 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 319e46c47e..ff2ed31c25 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 26770f2b92..460d8a630d 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 6c3a962153..9cbf65051a 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 fb8339d1fa..f8e0aa9d7e 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 336c56fb57..166c513f91 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 7fd6fd8e6b..8836f83c7e 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 0027fc8cf3..9ec3a6d12a 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 60ac0a61c0..dc36e188ba 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 f07f5c7a74..9c34b82796 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 2f8ae9637a..52a54b9921 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 34201b2512..dd70b6e98c 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 16f123dc83..79ae7e7cb9 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 65b58b7165..25ef2827d7 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 43b0219bc9..90107cb281 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 55184c1732..d4d16fc88a 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 bb2c387689..429b008d06 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 0b95061165..a752c2fd0d 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 e392359ae5..3dd492c3dd 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 a04f7243f9..6167b1ff1d 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 e3d544c624..9f1eaa82d9 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 bbece179b1..0a230aab43 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 dbac67b4ad..d68d23eee3 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 2a309fd499..b2367dec45 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 2c0a81dbf8..0ed51e36bc 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 b8e0e1a682..eb10991237 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 463da224e5..f4eecb5298 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 f67eb791b3..0744371858 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 0bf7dc6f00..f625e936ba 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 ec2a001b21..1a668754c4 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 0b3eec7722..8812d05954 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 5de40421f1..52eb6df63e 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 728162f171..6ad5de05aa 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 cb8d43cfff..89c6baa3e4 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 9f1f20a032..8335aca80f 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 a6c1598dfa..c3d7ab3053 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 30200d82c3..63af86b904 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 d0ac8a0ec4..56999ef7d9 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 d7756988fa..b84c130aa1 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 445fdccec3..4a71e98ca6 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 155fd407f4..6f282dee09 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 73058ced0e..c79a7189f4 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 e9fa34af69..7f20c4117b 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 54bed7e05e..d12aac9957 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 86b7a9d85c..857547ef61 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 d5abc171c6..bcf1cf31bc 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 1593fb0dfb..295a429d5b 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 98a110a022..55b3238abd 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 4d79ef1c32..70b0bfaed2 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 cd1fe1c248..3a8b6d1b01 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 17d24164d7..637c0047f7 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 bd25c22a2f..3c9877e17c 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 d391380768..506ccc9aa6 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 d7756988fa..b84c130aa1 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 5d472bf003..731633f659 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 c585e4fdba..16107c61f9 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 18805135a9..b95eb8df4c 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 793a9ca372..f95a831de4 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 715ec4f85a..9d1ce84958 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 eaecd668bc..ff2c4cd3b2 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 3cd068e457..c8784c505a 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 90bcf6f979..8f9885e9ff 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 fb77dea751..5e299e876a 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 9fe24b001e..32fd0f8cb7 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 59d75aca41..467893c573 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 bec0575c60..a376839f99 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 c208fb5cb4..406aaa26ee 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 df95531b0c..870ee6756b 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 041c2381ec..39012a6afb 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 0e9dd2e6d5..46c8a63351 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 fb129cd9cb..371eaf7256 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 85ae4f9e6e..f3a766fe72 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 323c3ca6f1..b84c130aa1 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 d41002da32..4cad38f5fb 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 16d0a8987a..c5c0b0a45e 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 ff38e0b5f2..6c405c437c 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 0cd899de56..e1866f4d2e 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 85509617d2..8d194f317d 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 3dddb73b93..8e6cf2f506 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 d7756988fa..b84c130aa1 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 acf4fa3b82..8f7afd5a37 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 4880153cca..eb19f8f1f6 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 659c6e74c9..10f00d72d5 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 5586ebbd28..480945028d 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 d880cb6695..206a92740c 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 898eab712b..da9b4fd235 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 f6916ff79d..398bea22ad 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 6ce7fb948d..d0c4dcbdf7 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 913222f5f4..fb26701158 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 697fa2c76f..529f278ed5 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 f68226bcea..ebe3694cbd 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 81d0ce005f..bf5f0b92e5 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 d6365133ec..15a0c870dd 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 a5e20adbcf..a0d71ede83 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 d8084b17e5..cc34ba8535 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 c7db47711d..16d9de1d3d 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 6708acd372..9f35887a3d 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 ee34d6c6d0..aef886a39c 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 16ef8a4174..505874853c 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 eabc3ae84b..18ca8ee30c 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 ae64e0dc40..740294fa70 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 12487956e2..afb57d801b 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 c9d47e66b8..147645105e 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 b3ec47a767..7ca26c3e75 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 384b0c3f2e..552c58d03b 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 084d7594ed..551c7dc337 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 7dca462a42..1423f009ae 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 ed3511ea89..f284b2b136 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 510e8e1e6c..c037330e2d 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 42ffe3a854..09c585b573 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 a466855ee2..1a2917f1fe 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 daf809d8f9..90bc5a0d31 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 7fefe09fff..cef9ff0a59 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 e2b9230a05..d1333d6c2b 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 9a5e50440b..0edb34c9a4 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 0ce4647299..502fe48bd8 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 32acfe388b..1dc2175c55 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 41c0066a60..9cc40b9165 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 d56aff4af7..e6faaac0e9 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 40cd90bf27..dfe811d408 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 06faf78303..c582a661cd 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 d6cc878337..80359b3c50 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 3c44ae776c..41031b8078 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 804c880e27..699c5cf13f 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 d856b1e13f..e999ead023 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 9e926f48f6..526ddaab80 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 2bd1e34325..e4fde5765b 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 ce9d74f972..65c4240308 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 69bec07708..17bf1a2ca5 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 6dc7ee38af..a5668853c5 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 aa45929315..60cb9043e4 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 5a35944fb3..c2231b6e85 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 bb93386669..0bcd82a5c2 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 94f61bc63e..66d77548bb 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 bb93386669..0bcd82a5c2 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 233cb60e0b..8a82e481ef 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 5db50869af..0bcd82a5c2 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 b4b8819317..8be8dc20c3 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 323c3ca6f1..b84c130aa1 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 0004c6a755..87c68a3d61 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 1b16278068..f040859ef0 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 cf7a8b1508..fe345f00d8 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 c34676efd9..28cef7111e 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 2c3a83533b..d6bbd217cb 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 b26a3bd3e2..c56679031f 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 549acc531d..c291c0fae2 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 cabc7fdb17..f7dcc2e8a6 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 b1ec4059f3..73f5ab695f 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 e3e252ff02..9aba97983c 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 39e31885db..dbb60c0794 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 c0c6188b4e..8a5140e03a 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 bdd848e1d5..759b9f20fc 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 5efac27180..49a5b2d1ce 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 90bf4d8edd..271cee69a4 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 8bb3a9abd8..900a0bcebe 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 b943aeba3d..8a39e5e9f8 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 328a7dd998..1e6a342733 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 59667588e7..f168af11e0 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 226f796677..a336aeab91 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 42ffe3a854..09c585b573 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 25d25d5340..7709dee755 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 41934c19a1..84c84a3ba8 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 863d21ec4a..ee898d2773 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 8eb61c2986..b753e6a30b 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 867e11312d..3dfb592f70 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 ed3c3c9c88..4db58d80af 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 a6ad74370c..536283a73e 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 a89f180a3a..0b9c8b4dac 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 8b0cdd556c..1e6c4835a8 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 b4bf2a84a8..777369c51c 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 0da7551973..1327a051db 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 343cd4e06a..a0a65bb67e 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 4fbc912f1c..cacd891bcb 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 abbe8fc2ae..3df7c8db55 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 d0c7113a02..3410168985 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 b33bf28410..bfdab7f0ac 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 8b2c58be93..dbac12cf46 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 348c0f2747..19a640295b 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 4b3455a9e2..17c5ee70f5 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 dac2198d0b..25b207caa2 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 1ebce09f91..3a770fef7f 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 aeb0ffd0ed..200d6d2255 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 76cd998482..f74a19089c 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 f1f7d69e85..8014590b9c 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 c41fcefe5b..a7ee231d0a 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 75b6dc945c..0933eb59d9 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 02be743636..9803a4b6fe 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 c3e23585f6..3b1a576254 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 8bbc76d1c5..c84e680233 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 d894546312..27b14da153 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 14597a162c..b7a7b66771 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 d0c301ffc1..5e7501a790 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 1295668819..5f7ba7ef26 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 2027e34b83..180bdbb504 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 1b904f2d8e..f2ce8a3cb8 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 58021143b4..ac8e403fd7 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 00121e8fc8..10996518ca 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 912376a364..c4e3d96d4b 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 e7f706fe90..5aa03896ff 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 1c9fa39ce3..f3e071cfb6 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 e34f8c26b1..f8e28ea921 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 f51b2123bc..9148786980 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 328171653a..dd0ae4889c 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 b6f67064c0..3d1b539821 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 509b3bee6b..b433771d17 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 720de968c4..6326877ff9 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 d1000769d9..b655315bff 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 80d4430443..280e384424 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 67101c4214..a8e1c3f61f 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 7162b570c0..7f562e2136 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 b610024188..74ed533fca 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 2995f05322..8b3e367790 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 7aa8cbf998..d203e3a251 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 de958e2e6c..11abba62a3 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 e1361a799b..69d65707a2 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 eb868e8f71..ff6325cf26 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 bc9de1afca..3c9877e17c 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 ef86430f77..6c66d4f1ef 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 75448fd441..388bd54460 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 498a19d9de..99aad48d16 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 914a8bd29b..f0c4fae9b7 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 be56843c1d..8e12fa41b5 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 7f3e4b9550..df7b9bfee9 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 0b134468f9..6ccb03b763 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 323c3ca6f1..b84c130aa1 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 8e652a20f3..3b711e32ae 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 005e54c7c2..278d52cf38 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 e4fcfeadb8..cd224994e7 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 26069db728..a62a3f5e1a 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 a1e6e41487..c17992cb88 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 24324eaaf9..ce10d89ade 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 0276165aab..b955ceb894 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 9e732de795..9ea0a45223 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 323c3ca6f1..b84c130aa1 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 0b9d146974..b9634b1a96 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 db5a944cdb..890c7d05d8 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 467f8ea3eb..9b74856290 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 40599d8c13..5a5a375f61 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 7ffda32d41..6d5100e5cf 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 a07e87de54..7fddc4a21f 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 863a60317e..e2d4264bab 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 d64ff96287..697b95cbde 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 6ca5557861..4951f8a809 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 f6fc628137..e0393787aa 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 787a77c58d..55a2d8b808 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 d9d312e16f..cd57ba05cf 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 3a2886d516..1d64bf79bf 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 da0c805a7a..09d72d4e63 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 ad6ea6748a..2d3745039e 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 d7e9110a42..388de398bc 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 8a72edb9fa..b794ee51d5 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 d38e76c483..8f32f718aa 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 9a393dde67..2a73869aae 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 f568f88fd1..1d79036a3a 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 69bd6d2f75..aeb257dc6e 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 086a1ff25d..72955ecfe4 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 4994a02721..52f4835295 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 bb93386669..0bcd82a5c2 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 c931f9a941..3967b5136e 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 c772bba02a..ab15edb6d2 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 0e35b11943..a945b34e9d 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 84b72e35b7..a43bc2f551 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 602471cddf..8d52ec0093 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 05bc02d893..ca3f669d7d 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 7bcd1bfcaf..36b811c725 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 c0b52cc9e4..bfb67f4af8 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 99210833cf..d76c1d18c3 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 f9ff01f01f..d990c6707e 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 b3428a9bd6..55afd85684 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 924e4499fe..eee0f746ef 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 73445484d9..eaed7032ae 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 43384b2a0e..9d8677fa1b 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 d9d312e16f..cd57ba05cf 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 de03d5e626..7293e1b6af 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 4d8ca88b01..d094047d32 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 8e4c2d151e..eea2a1e713 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 a3c07644d2..44771e9f69 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 1ba0ab1cd2..ced85d7aaf 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 fe588c5675..7f3a139426 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 df89ff1e72..554f9312ce 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 33d043323a..a1eb78ac28 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 2fb5aa865a..24de8cf602 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 7085099a7f..9ee728e52e 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 010da5c286..25c9c2e9a2 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 f0e50e36b2..23d00f49ec 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 38105b5037..de6203069e 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 859b11bd43..fae8f19feb 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 e730a43382..e74caaace6 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 214d991596..9495645f72 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 5864ba9908..993f10b5d6 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 cf93ad55b7..38a01318c7 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 1787a9d524..2e9264acb1 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 35a6c5d36f..049b7e943b 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 0e6a6b7ac4..4cc0fd443b 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 7f4ba29851..b4779feafa 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 09374d834c..7e8803ba6b 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 ff8832e952..fb35366511 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 c7874d3032..0624a076f1 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 bb615ead60..310cd5b9de 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 f54c509e0c..6f45ba54b7 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 766340e99c..240999c406 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 7f38440e0b..8dbb49c65d 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 ac0ad46383..454f9c7c6a 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 43285a0424..70e56cdac0 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 105f33a68c..295d44a0c5 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 5ea30b99be..88b4fc1b3c 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 3821585a57..9ce1cdeed5 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 768598ae29..f00c5a571d 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 03f7dc9595..a4c75e439b 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 32a30eb2e9..8c38568262 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 8d94e46e38..12883c4721 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 986b27368f..d1c6844dfe 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 ad9cda1caa..371949514d 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 fa7acfdd29..999fb13dd1 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 1c10f0359f..bf91ba9d7a 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 403a017182..d968098c3c 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 cc5cfa4b7d..ad229909c9 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 f326f3aa6f..da57053991 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 4794c73235..296e1908df 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 cea772666c..85514cc7ca 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 72c245939a..a71ae8b54e 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 1353c16bf4..0e9d6f8aba 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 f0db73acec..57c059f1ec 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 3a5dd943c6..5876eb5414 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 fd3198d295..d54a4959d8 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 a8b088bcee..f50ec4559d 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 a43044463b..87d84957ee 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 d106f70c69..833ea3a009 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 f26663990f..27b9702547 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 d7756988fa..b84c130aa1 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 7de9f745ad..2643565da7 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 5f1d502c4d..fabfac1a63 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 a5fac5501f..5a448fbbb9 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 dd8838380c..dcbfc63aea 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 91523f45f8..f04cac51a1 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 d8e1d604c6..4c56d1f11f 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 4e3e6a8524..4021c58cd4 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 dc277d8744..8993a91981 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 bd34163d24..ab0046c3aa 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 416552604a..423de44095 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 8815778e7f..ce0c0d8d1d 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 5dd0a36fb4..b16bca015a 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 4407067cc2..761be76b28 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 2510d8a0d9..cbd1660771 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 d61b28d203..6504c45b1f 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 b7f41033b5..03a8d21eb4 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 d2246041b7..9dfb05f32e 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 993b6040da..6e32dfdd07 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 9cb27418d0..c9c9f4f7c3 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 6d85e714fc..0d8d6697dc 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 2aa0026b50..a528645a7c 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 950d6cf1b9..7c3f12b7d4 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 0d0cee6a63..1c1f4a67e1 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 944c0ba37a..20adad212e 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 b2405a9539..c66f035b04 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 27850a08c5..eb19f8f1f6 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 3419ec3b0d..73b49a7915 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 98b9d289d3..111e0a14eb 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 95c136bb0f..3cff70d5d6 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 73d18a4618..29f50165e5 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 3dfaca70de..3eef70e559 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 5efc66214f..1aeaf0ba3f 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 ba8a42e6ae..681d54aeb0 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 aab2685355..5888f89f29 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 c746597974..0998400cda 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 8c6bcf4caa..0ee4e42023 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 3c820d2336..59ff81f8bb 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 b216c24f6a..24adcc55a8 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 c24f41f3b6..21b5cdb80f 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 0d4dc45207..b89752c366 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 19a93b31c5..54b52e52f6 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 186e2329cd..4bfa1f771d 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 0db406f5cf..930ca90f0b 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 9079e85699..86776bc11c 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 137c584987..9b57beb2e1 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 94e58c83a4..ec7c5eda5b 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 04719df4a1..4cb5d270d9 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 2730e59e57..4ab9c9bb81 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 cfb6ef68a6..18e7046bb1 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 fd52b670ee..0f6175ef60 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 f2abb29bf8..8cefbbf66b 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 94990ccf41..09ccc44f4e 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 a5490e1c00..0011c4977a 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 4a28b64608..aa03eed967 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 c856a1aec7..aeccb06f57 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 b437231e22..a7fbaa70aa 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 d632608ee7..9debc62709 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 ae4869f5cd..04060dd3e3 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 ecb9465f8c..d8c52182fe 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 7986d1495c..042bfa0521 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 092ba654d8..c25af847db 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 8abdc7337a..ce0d14036d 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 a43119c2f0..fd57823ac3 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 463e70a231..fb2c5df685 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 6ea9e73a12..3e16705b55 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 84b3333109..bf1711a7b7 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 3f6061550c..41a4446188 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 6f2156b5eb..12847871e3 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 e0e8623f1a..d7585fccfa 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 3c06812cf7..ff8ff1bd4a 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 e42d177a43..dd197da45d 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 c739377c9b..f96dce2a0c 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 42f2034569..7994940cab 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 b390edcae9..15dc929d78 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 06e6f6c8d7..52c6622539 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 5db50869af..0bcd82a5c2 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 d075ffa398..1b921cbe69 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 7d8737f25c..43245151b1 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 bdd9e9b821..1200aa0751 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 4d3b1e694a..c79f907ed7 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 42ffe3a854..09c585b573 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 3f0c63123a..666788273f 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 9683e0ee2b..7531e70e81 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 3eac4ca2bb..c6e4965a3c 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 9a19610ce2..565482ed44 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 5e097ebe78..565d1138b3 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 3225cec17e..5962287aa4 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 5420ccf217..a08dfd324d 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 7a11a616c3..f0d6f1d4d4 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 cd97eb99c0..a575ad3c90 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 89055b0f3d..47652a6b5d 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 e532ed03af..997113cbf9 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 b0821f4c77..d23fc937b0 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 24002efbf9..33075c5d60 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 52bece7da2..f5d9668406 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 d37c1d1867..23a701b1b0 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 19c7b19aed..db106b1d86 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 a37828a8fe..4f183c2206 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 768343786e..2ec1e36340 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 37e81bb65f..66d6fee63a 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 3c4e86572a..481c24fce1 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 67e1636026..d98a0835ed 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 206f3ee0b1..0ef0ee66b4 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 fee6a1170d..58af9bba48 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 7a93b6c637..69d8012bdd 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 e406c6fe5b..1b72b24f27 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 64bb016fe7..3dfcd30209 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 ace037211b..433c7db774 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 36453e66bb..1f76acda19 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 5cc9d102b9..b6b96e5269 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 5387f1e0b2..8ae7869b6d 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 2f51ac5130..c438ca00af 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 437cd7e844..76041c6f4f 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 b9ab9aa9e6..29b3561417 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 327e96625c..fa5ef5d51e 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 63da1a2315..0c0d9006d8 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 4d45c464a8..f0cd8acbe4 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 7a32d7ce0f..978671fe05 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 f50d05f773..a8d94b9777 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 284459c77a..2eb1dc9d4c 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 0eb02ba2d1..dd852d9fca 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 3f32db02c2..0daea2e8cd 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 077797fca7..c48620bee4 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 cf1594052b..ff5b32ca61 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 cf6250930e..861239182a 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 88730bf242..607e372d2d 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 fddc7d1b6c..735385dc21 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 a3b3eba39b..b5eefcbcc8 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 24d814aa34..d688f0aca3 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 ba8b16c5a0..aecebc81e7 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 37d5a09c26..5638a79796 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 5f9144201b..dd304b67b0 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 5e1770a9a1..30125c2431 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 ee60aaf814..5130adc763 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 2939f35007..fbf09e5c54 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 a7703083d0..02f90e5f18 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 c86cd5ec1b..4b6d2be02a 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 d3e364c968..425afe2004 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 9e6b8210c8..6b5cc57470 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 d7928c9f29..9e26b6b5a4 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 a066f81f7c..c71213e05e 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 848bae446f..c80cdc3267 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 14299837d0..bea475a12f 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 cfc92cc98d..0c9af68467 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 9a8584a4f8..a8e9cde484 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 2fb44da0ed..81716427be 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 6ddada6d57..5891cf22d5 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 3797d2650a..a05c897975 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 fbb4b80304..5421415a9c 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 b6d9cd65a1..edcaa6eb9f 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 2f82924a30..8b99444937 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 34eba4f220..e2f6c05fe2 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 07a7a2990c..ec7c5eda5b 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 b35e2672d8..97483a1772 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 97249a4a0d..e9d193c7e6 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 526f5f7121..0e0e0ffc5a 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 91eceaebd3..a3debb2217 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 0fdb70b8a6..b18930ab70 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 b4f0f92b54..367f97d1a1 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 c6117e06a9..d0561bc26b 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 2cf26bb0d4..1413a1b850 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 285e83ab29..6c72d71067 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 7b13ca7325..49c4e708d7 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 0cd80a561a..ca5abb5679 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 b05c7ce784..4c7c594bf4 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 0022ae1996..8651158c9a 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 f4918d400f..dad96f3e50 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 8808e39801..9e5f177cec 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 d926f5e0b3..a54a67ec6a 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 6bc2289ac4..d430282698 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 278f379061..21f3856bea 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 721528bd63..83fac1471c 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 658bd725b6..57dbb82f8d 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 b514948995..fccbe3a58d 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 e824551f09..c32cf8580b 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 24a47bb2ca..da5910733e 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 1a184da05f..af0da5c970 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 42df73db66..8cadc6c4d4 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 f389024499..0e2ddd5b64 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 e3dfd883cf..6ceebb8c0b 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 4e2747588f..62dffd95e8 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 5c8a66ba1c..6203133c51 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 d9d2afe28d..ded4cbf4da 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 0f5f92513c..d2c2ca54b5 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 4332307d19..493099a751 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 3a18a40c31..f9fdd78179 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 7430009c92..78b5f14cbd 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 0fe544d7e7..3562246b21 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 fed877ec9d..43effeb1cb 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 b7f998ea66..7c2de61db1 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 e3f5e07f9b..57ac3a6a71 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 050a2ebb03..4b21a81b5e 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 d7adb19919..973a0f8bc3 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 cb1deeb9fc..1cb3a50b41 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 e1fa719593..79a0dfccd8 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 a449013305..160ae620f3 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 9a354e46a7..3fa4d3e73d 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 7148520c80..c20cdcb03b 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 fa68f6c001..7b23bc66c7 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 bc60719b9e..fa93efb97e 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 49f9cbc2a2..29ecd76ca1 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 29ff0a9e73..2256d71d40 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 be7fda7fbe..ab020ddeb3 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 d4262c319d..e3f3554cb3 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 61646d40da..4ce3c55231 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 af02d036aa..719fe8e08f 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 e6e1839289..8bd5fb4f1a 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 7a8a6f8c7e..6e3ac8cd16 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 9a8f7770ac..e4c9d54ec8 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 2e555b3a24..61300f6d28 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 ae35918b4f..c63105b224 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 ff3396d619..7dc05b2073 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 9411645bc5..c4223ab36a 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 c256c419c4..84d35e3806 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 ca342afb7c..80cefced5d 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 08a50d6496..24890d9331 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 5fb0f9a879..925a7f6711 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 4882793b02..13a84ed643 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 abea838cb9..fc96d8fe0b 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 5871b97590..a5c0cd0ef0 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 23bceca5f4..b4a4f25831 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 9618915d01..41ab69ffc5 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 84148af757..d3cd4faa5c 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 89e1f9864f..61a919031d 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 19abba14d2..6b11823f5d 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 e224e7aad1..66109a2016 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 bb482dd588..10a717a5db 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 6383638a8e..eba6d5366c 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 c57b4b9b66..8591b50620 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 5ef1e43b32..ff7db76c08 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 de87b52670..c79f907ed7 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 a90c323950..dfc9b79eaf 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 7ef289f869..b850a6c370 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 e5dd4a1a83..12245e99c6 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 390d9404f5..e91487e3fd 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 76c8b2e672..038737f104 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 ace1433b9c..e2f6d76d38 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 d690e89e0f..4271527cc4 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 8b09b1efde..2d7a70a211 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 e03a81d1a5..b9f5c8ad5d 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 87f5571d9b..1cc16a91f0 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 66bba2758e..34d1558ee1 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 ac28bed7fc..90c912bfb1 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 c300534bea..ffd73aeb64 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 97aa628947..5ef5a762a8 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 f2eb2cc11d..fc17bcc697 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 0d888053b1..fd0f19b940 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 0d5654bd3b..8ad67fecf6 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 8c1be8edc4..18f2af2267 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 c05ba4abe5..3367aab42b 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 bb93386669..0bcd82a5c2 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 a31ea6ecc9..a697868a91 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 869d3e3866..a3db5318d2 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 1e2f18541d..7811c54a75 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 8ff3505de4..80088f700d 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 53168ee8b6..478f6624e4 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 36b81c7932..06bc5620cf 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 5db50869af..0bcd82a5c2 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 222e201d35..8889441bb4 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 bb93386669..0bcd82a5c2 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 349878f099..808c6e7b34 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 ca3a91f60c..14a4545755 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 53ac512cfe..409c00c5b6 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 b8cac1f131..a802b49c33 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 eb24af94ea..6d6acb599d 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 f0e3584a14..e669290e3e 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 2e284ad82b..4a21404ed5 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 131b84b6d9..e892c0f35b 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 22891612f2..cd2f44358e 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 a372dae05d..aea58bea53 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 b5d2239db6..1a029804c3 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 e8801ca2c9..ac107baafa 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 4fb2a0e181..cd7e499d16 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 a4d846fb3d..572dacb8c8 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 a7bcf9b791..c363505fd6 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 b2db07200a..d37488c74b 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 e22b2b4bab..243cccc7d0 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 999149f4fb..bc1837ad24 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 ded9bad7af..944b920ea4 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 d2cb84c8e4..2397a98808 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 26cb29ebe2..e93a2f2cc9 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 3066088f95..61bbd78bd3 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 209cbac945..6ca7e0685f 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 2963f47efa..1cc71ddb08 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 6df738fbac..f31e23b84d 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 438bc4c430..d92e4cf40c 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 ce0b894aa2..b624ebaf41 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 c4f948cd9b..077f060aec 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 b1c7746969..f74be80b97 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 dfac4ae0d4..289e80afef 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 44d84f5447..cea838f264 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 cf045af096..254254ed42 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 f46f5d44c3..a5a5398d83 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 fabb8da768..3d4568e084 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 74756a2e88..016eba827d 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 e4de3045ce..1791ad018d 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 1f2cd5a811..d389d0913b 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 d2a44ad2c0..5152f0ae5d 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 e2d52a407d..83b9dae976 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 9d3992003e..fc640401ca 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 72d58adc84..49fd899096 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 f3ad44fc29..01caf42501 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 635440384a..1b3d4a0318 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 1bcb74badf..2f4b6036dd 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 f23ddaad77..542a85d08c 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 b63acb9da6..f83778c503 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 66279212b5..60721aeaac 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 ffc587c8c0..f1ffdd8d17 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 4527907205..6d2776bed1 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 db1aa38504..7b2b26ed2e 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 bdd35cd3d9..12c515b0c1 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 53e0d63007..012dd57424 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 808a6b124d..a7f7315751 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 98d9256e06..fc61eee2d1 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 d43890aa99..6a53513099 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 64e8cf65b0..df876e9dbb 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 e98e1e4e8e..f15cf51c5b 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 c0dfe16261..d39a3ea329 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 c6068ed3f7..6ef3ea6fc1 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 ca738d4c1c..bd331e19b4 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 36eb2ec137..ea4a1889e6 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 3a5dd943c6..5876eb5414 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 74446acf32..075cde9381 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 0f38493829..dd3cc884a5 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 2e71eaa67e..02867e685f 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 5c954e3a15..abc05ba3c9 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 11c34fe7be..02ecdd277e 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 c81dd2c4e9..20c0c91a1f 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 bb93386669..0bcd82a5c2 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 c7a07ecebd..66dd17fe25 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 bfb28d49ad..adf2083a8b 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 1c101144ea..65103a5e99 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 97a07d0d58..95b2f653be 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 6bb653e141..64bc54b422 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 186d2ada9d..2ae9e21cbe 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 d87bba475e..4e1686e358 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 c692f4aa73..5a5811659e 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 bb93386669..0bcd82a5c2 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 8254105171..df61739a61 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 51e80cc463..dbf21204d0 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 42771af945..c510b54c71 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 9e8a81a21e..108e3f1e85 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 22bddfc7e0..d5e7ea3c45 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 ff7a74a2c8..3f02e824a7 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 edb52a4057..59d050e648 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 b09bac3931..13d6c89920 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 1cd31f2e0f..1caac6bd05 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 85081c6297..5ea6da4591 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 c5b821df7a..e45248836c 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 77f8f3ce84..06ee6d497a 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 fd31633e27..e72f13ee1c 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 9596e9466f..b92ce5582d 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 a614bfbaa6..ab8322ad54 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 e8c0470359..396f3bec8e 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 e3b7fb23c3..52fe50d3df 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 a138370170..c3c9f6ab49 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 2fbb27730f..b64c8476aa 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 83c8cc2116..c551fcfe75 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 e503e6ee33..8a5227ee20 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 698a183cf6..040c52ab60 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 b0a0eb7fb1..4fcd014118 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 deb421fff5..c8dd5971fb 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 46c098c098..ced9f9985c 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 a860e8b70f..065314a1b8 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 0418a3ce46..7a5bd4d028 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 bb93386669..0bcd82a5c2 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 da77c1e5d1..7588cd42df 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 d277a97ed7..2adfd5a2f2 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 14d65b9fdf..1d3d286710 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 cef2597f18..5e409bb57d 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 b3da834d87..6175a6e714 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 57bb707c79..66fb4efbc2 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 b8f30195cc..67244d78a9 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 ff2b4451d2..d8c7565fad 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 c6fa09e4c5..f6020b6a0b 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 86c4d1c4e8..c60cd495c6 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 aad47c04a2..1f31ccc955 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 63ac6195cf..10cfa61144 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 55ee68085d..5b7699cbbb 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 a2d717a70f..2b0f14dc01 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 60d3932e93..6322150683 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 d4c6b5667e..803dcdb329 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 280da4ea78..e411b2bc96 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 c1f8cb0ab3..b7c14ea5cf 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 e9b7f615a3..e2177177ed 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 0594892d8d..96e56baa2b 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 be82bb47c3..26948cd0b6 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 e3c95b6d90..5482efef2f 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 b1a728ef27..113f51ecf3 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 095654ecc6..27a20410b0 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 7bedb03980..1362ea35aa 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 c86dc3b299..85091c3c07 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 6e50f58798..c8574de0d0 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 9a618855a7..c741c5f28c 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 fde04df4f9..e52fca04ed 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 8495d1e3a3..c94e3d90ca 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 4e3d54e35f..82c04add2d 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 213bf81c5d..e172d9ba29 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 19a26c630d..3d2e25fc1e 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 049d00b085..5dfdf8ee33 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 583b28389e..ff85d1abdb 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 d6e4704754..a4142a1a79 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 a6b38fc6a4..0bcb9439dc 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 94e58c83a4..ec7c5eda5b 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 189215aaab..d74d623d2e 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 b79885e160..fb223e8b12 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 f4bfd9081e..bfa010c211 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 d4fdc9516d..46410d3d1c 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 21022789c1..7c9c128e1b 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 b68d96e035..1f035eaeec 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 2047a87cad..f055a2dee0 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 04ef7506af..31539db216 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 e51e0daffe..dfa98abf24 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 7711288c76..2c24e61560 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 e1b9a5f323..1fbe2d7ed0 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 823c99a57f..9667b0b3c1 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 d2b32b0a9f..078dfbde50 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 35c2b03e3d..1581c1c5cc 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 0fb7d624b9..ea7f3d6f38 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 2ef9b05da3..2b85d3b870 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 7619e61047..4aa10bfd62 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 23d692746a..8c3ebbb763 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 da43c5a16e..5cc704c126 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 ec0f02cab5..4568984b09 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 2199c91ec6..5e2ff68364 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 c721ff4534..c8119a8a95 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 1a99dc9c3b..03da709285 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 ac217ad5a8..3b6c5f1c3d 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 2c3a8e3916..da2caff132 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 c04bc0b2fd..8aff1a5f9e 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 be82f2ed87..5c218bb8b0 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 033afe10c3..d44419d439 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 15d2023c5a..55433aef50 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 7a684b5060..65448c4ba0 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 f8fe85528e..7c36fa37dc 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 91668931e9..f1e32b9dbc 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 8f3bc9b1d9..86956860cd 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 8e22bebb87..7e0c6dc947 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 5cd70a5a17..48a0218cf1 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 286b7a4dbf..e09c30bdba 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 ed22329880..1671cc9ff8 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 3ccac38d31..5a58f69ce3 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 8f10769e00..bc787602c9 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 290125e959..83a87bd247 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 5c58d4ebfd..bfafdb4b4a 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 608d11f4b1..9585dba88f 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 d57531cb94..17187c37e6 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 03cbf3c183..b4744aa80c 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 b9db319ae0..aa0b759f06 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 92bf851101..ba30f01814 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 ab62fe1fea..5ee9868368 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 5935ea0aaf..b2a995f068 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 90a29f9b3c..872c7309c8 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 f1e3b88d68..cb6660b000 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 c4cf0820f4..839a2b9db5 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 8c547e5b39..90dfef9a4e 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 1f4e55f0b0..a9543e13e8 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 c5c7ddd67e..56fc7e2cc0 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 5070c2742e..86544838f3 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 e0f9f91f1c..d9bd21e547 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 8d78f94f3d..191f9459e1 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 5ab89a85c2..e250f049ad 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 9187a20a8e..ebf7fe86d3 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 1439882fea..13eb91b1ee 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 5372eaadad..53b983c16b 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 d52c90968c..f2c54c29d0 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 22f2481887..0866a9d13e 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 84f0cafe9d..5e2d2f17aa 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 07713a26e9..4e515c6408 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 9f4eb01cb5..b7cb56df50 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 ce75735888..b6977a7a7a 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 1a21bea46a..5ac13030c8 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 1c7097ca66..ec258d9232 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 a8b713666b..449f046a99 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 28a25bc8c4..77d15e6f53 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 d21a34d535..b1fde73048 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 0f4e260ad8..deec272d2d 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 c4336285cc..d8324ea274 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 1a87966b76..6143b8556d 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 bc9de1afca..3c9877e17c 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 2da0e7e613..b3f0ff2248 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 1de56ebf0b..d726e61d94 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 1347bebfde..391b9314b4 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 3b516e8a16..d61db06e6f 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 b4ef832b48..fcac0aef31 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 05e34b6f51..6a519630f8 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 9cbee47883..33fc38e255 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 e74a372033..e661601bcb 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 ef4ea1eb6b..07ff8e7222 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 4d3b1e694a..c79f907ed7 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 aa038c2c30..aaf8a876e3 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 65d4ae11cf..5092b66e26 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 fe01fc3d49..877fd72fe9 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 aab2bb047e..b0dac120b3 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 e7bc4b1a25..c2e1ef6757 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 e85762c099..4ab3a3417c 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 7f2803ba7f..ddc7db6d04 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 c5c6220bb8..26dc16c7cc 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 b8db5816f3..d36ca5ce21 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 ec0b792e37..b6add5e08e 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 ae37744467..12824e0874 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 ae32edf2d9..c2062f29fe 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 b544fb3f4f..3cfd941f42 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 fdadf6988e..949c8fcff5 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 26839b1fd9..89f329927a 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 8c869d1f4f..bf761ffdcb 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 92d9771127..528558e571 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 6caf6af1a1..ba50ff5b72 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 ffd459ef00..7d181856f1 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 fa6d0dccb2..368bf9b05e 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 30b73ae13a..553db0cf90 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 5e30597b84..b68af541d8 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 5ef2431c2c..281b92222b 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 d43d216276..d012344d34 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 d92d0161b8..6d7cb82d29 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 2755098ed1..30beb1cc99 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 300d71c254..66cc99ef50 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 255cb332e6..84f6485164 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 8a9c1503cb..b99c746b43 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 593388bb0b..93f7b3949f 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 a94b89a0b3..10eab9ddae 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 5c89b51900..cffd8f2def 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 203b11bd73..cebd175663 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 e745b3efa6..15ca739574 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 b6b7483b36..4823c2dc95 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 7e561d52f3..b6757400a5 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 13a5d5176b..8f1a40b67e 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 befb7acb0d..c239f63c36 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 a38f47f032..1899ea1436 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 c639041e56..2ce60784c3 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 d05cbc2888..100dfd7778 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 e262625ab8..47a09d3b74 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 c6ccc0a288..68df88d48e 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 cc40ac4250..dfe478caae 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 d17e40ace9..6a66bc46e2 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 6b23712b42..6f2aa9bc48 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 5b3fc8f419..f89770363f 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 1feb8eafcc..a7ac0aa6ba 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 84b47cb10a..485a8765f6 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 9fd4c80f36..f56e6903e8 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 065e0b0394..0a5493c46a 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 335be9d9e6..6d90d6ff64 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 0bbad6e79d..f2a5f687bb 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 20e7c7d84d..c2497aeeb8 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 ed709f330a..a7fbaa70aa 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 c0ce13df89..8ca5947d5b 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 3a9269ade9..d602de7867 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 97e20b0188..5673f37e15 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 bff58000db..0f90eadef8 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 7a7ef26340..8c4f03e0d0 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 2e05417bad..84b464161c 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 3525dffd96..43b7092e0d 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 754322f559..5837f6cb57 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 5b1a0dfec7..42a0bc0256 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 73b725b642..3a75a2ed24 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 9f6afb29a6..132adfabdc 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 3efa06de3e..8ae9e64875 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 325ee54edb..7ef4927fa5 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 0c7cf55879..3ebb95ead9 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 a8b1c9297e..9c2a2543a4 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 0b39decd05..1860b96aa2 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 ea5791c9f0..67d5c14aa7 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 7a8f7fb59b..1bb0df5813 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 ef24d57c86..e686386458 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 4afd87f1b2..e5c12571a7 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 fff4129300..e825db5a85 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 8ecfd30b17..ffe010782e 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 e5d3d766ad..1ab8ed2a52 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 5d06a217f7..36584bd4c6 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 a0ecf3fec7..5536e15657 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 d90e4c08db..000c03b4ca 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 c71d8147b2..a442ba56e4 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 d1b12c0d8d..2c15a13553 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 3004da393c..cf54e64079 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 59d81501c0..511d4da78d 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 ace5db7010..d425d48721 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 df065757c5..93dbd57501 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 d8bc65896b..dfe720b833 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 0da532df2e..7b109b8f1e 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 894a582c31..fb436b2d83 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 20a5589130..1575454cfa 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 52b6c41590..0a43862146 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 3845eb5d9a..5175c29940 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 ca80203f84..083b6fa0c6 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 a4f0a062e6..d0e6970f82 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 71d8b0fed3..ecb251ac4c 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 40e29526be..7d934c69be 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 0b724ed499..08b64c5ceb 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 42ffe3a854..09c585b573 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 d6a7e1de20..2b90bced9d 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 6c1cd3fe54..33499e8cec 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 0220921cb9..cc256338b2 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 134711b76e..06471a6083 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 aa2fa3ab9c..36278fc14a 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 f2052ad7cc..29e7d026b3 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 6467630d46..586013ed0d 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 555f3ac602..6cd0a5a6a3 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 0b12f16694..84e35c94b7 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 68cb201c9a..23efc96e0a 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 a46c1a0190..83ffd0cdd0 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 42cad5bbe2..d91730e8b7 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 ba90f95b3d..1635d1d4fd 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 d716db7403..7a0a5d655c 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 4dd9a40b47..5cadad72bf 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 c9483cca7f..05bf2e74ed 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 d285fe97dc..b421d6a666 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 f7b23518ae..44e01072e6 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 2f07446256..578543abed 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 f1a4bcc1f3..26822698d1 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 c35fd6bbdc..b24e24487d 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 bc9de1afca..3c9877e17c 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 45858b034f..c582a661cd 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 92a5907aa2..bf21e53d19 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 5c83a1351c..51bc1a0eeb 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 36bc34aeee..4651511fa8 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 28df49fc4e..c25f1f6181 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 4e6adc974f..02fe3d4510 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 bec1723198..9123f3b82e 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 2bfe62b841..dde7b7080d 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 9fb4fd1f2a..206c6b9e14 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 91d18f6af3..017040b300 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 8ccc49e3d3..a78a929cc5 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 2efa02d0a2..c5bfb1e044 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 97836256ad..210061d847 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 6bcd2718bf..08fa6ceaaa 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 d47a97c8b0..2613e22805 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 80cffe3b1c..3a46a99272 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 3900e395c1..bf657de153 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 65698aa1f5..b32fb1f118 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 64aa39773a..9a6bffbbbd 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 7a4ffd72fe..164278fb48 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 0b0f7a85dc..cd8b4742bb 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 26ff0170f4..154405601d 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 bc9de1afca..3c9877e17c 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 70a487131b..d4cfa6792a 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 3b0fa14bf3..b6bd78b6d5 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 c673847cb2..926e6fa0bb 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 0dc2227bff..1a49816ea4 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 9174b8479d..0b591ce95a 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 34accb7f9e..30c5f8e382 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 37b75fabda..a1018f4d49 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 f3ee20f775..cd36a2a6ea 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 f15d5d333b..98476f1f9a 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 02ebe0efe3..867f3c8826 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 e6662c6a1a..685b433ed3 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 5b4c9660cf..2f4daaf10d 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 2e93a8c1e8..34b00bf6d9 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 fd9ba1d404..09687ce210 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 d35843a4e9..c47412e673 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 1939e9dae4..8d88c1560b 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 897058c8c3..f1f70e0e63 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 23787e85c6..d5ed7f4ebe 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 cf03ea4490..8d10a6f3bb 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 d486d2c17b..ed714aa8fb 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 8e1bc0f39a..dc4c588f17 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 d40d26fbe5..6d64549cf0 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 f23ddaad77..542a85d08c 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 6b425931ef..2645a18ce4 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 07a7a2990c..ec7c5eda5b 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 f4c79be13f..f3e32c73c7 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 30dcc8b250..050980f827 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 c93f0e33b5..14797cace7 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 6727a021c1..e863215c19 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 e67500d695..3d5265dde3 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 3c1f323eae..d0d92f1c1e 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 f7bd183d63..919335c80d 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 a64a3b1024..2df8021623 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 dd4e0b33c3..fc39d0e260 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 e169f496bf..d54f069dec 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 12dc5233e0..313cae3db0 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 b1bfb61ffe..473d1e1694 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 d33189cbdf..50d69a6db7 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 78909cb301..527c6ad1d3 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 caac932c31..fd303a0c7f 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 483f337f8b..18aa5a6236 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 cac2ff0f12..1d8a9de9e3 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 b610024188..74ed533fca 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 12bc6bdb3e..fd0b6de8de 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 87213a9062..74ed533fca 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 7e223f1060..f93afaf082 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 dd748664d1..7a9858a933 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 42d98aa5b7..36d8c1059b 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 60471bea90..19703281f8 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 a05d68c5d6..d845d5f435 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 8c11b31c9d..7ca03a24c4 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 1f4e4533d6..05192b0249 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 37b4349f5f..855416e9f2 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 dfbb471ce9..ee6ce68777 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 d452162155..2e05629ac9 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 4a7bb731f1..804319d2a0 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 7d2d8b7ea4..1c11d39d50 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 b290e44781..3fc1fec741 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 57a27331df..e51bb20a69 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 4580042e04..d71b6870b9 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 b277d59977..8a1996760d 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 7587a37e95..64b0319be9 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 d7756988fa..b84c130aa1 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 cca99a3720..db66760a37 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 631bc5b68b..9d3f900c80 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 53690f69e0..aefd7e0a2e 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 74f53423e3..747da842cd 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 2433949851..6b687169a4 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 3415305915..6aefc032e6 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 78109abc5c..2213dac1e0 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 b458c2fa38..8204b6f664 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 c3c097f664..b1b3fc2770 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 7090ca5290..8b52d6ff2d 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 fcebef04ec..697b95cbde 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 4205204848..aa9e0d6c0c 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 6d88b77e82..e591369ddc 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 2efa76ca1a..a9039829ff 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 344a191dc5..a4bdfe3bfe 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 f1d3e64aa1..c835400579 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 0c1d559590..e68be85e4a 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 71b22634c0..d242b9ffe8 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 936fcb687b..3e1602cde1 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 06e0aa59a6..93410ef377 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 012eae3fa3..760007a32a 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 48862b0f0c..fbe01a2d75 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 5e51baf3eb..5209278538 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 6e81c22e9f..5b0be5e7a7 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 b7ea372f60..34d116eb18 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 45127ce4dc..818aef1c71 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 ebfef0f14d..7724b8feb1 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 d39d9e296c..87fb6e33d6 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 5984b5639f..91db71e612 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 ef2d75f909..1092016375 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 6cff1e5483..0b679cf007 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 37749e042d..0ee1d89c5e 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 0b1df80794..4d8b82f38f 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 1b8ef55030..482454a33c 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 d4143c4720..9d3444e4da 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 77998f6e3b..5afc7dc5db 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 bc355fc083..9bb955a178 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 87f1ecef7d..87e983cff9 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 49d8a6c78b..8eda3f9717 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 5d4eefdc40..fa2a5250c8 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 2506d40140..82d438e8cb 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 eb558dca1c..49f2ac85db 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 e51016ca9a..59494d73ce 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 607453aa1e..b2d9902655 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 90090d76d9..9c69a9e509 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 a2713f6da0..8bc20073b1 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 7a841e088d..bb737212e6 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 8dd5b096e2..98134845b7 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 ad9a51e3f2..9f840498bd 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 5d86ce749d..74ac3f8eba 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 034a3726b9..3c346ff8b0 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 40c4169537..0bde67f48f 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 386b590091..722a65337d 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 fe0396afd1..a5def11c93 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 fb6bcb4209..a338f3b188 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 d7921d23fb..b0781951a2 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 539aeff910..1c2756e6a0 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 95742e0822..510089aaf5 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 70d97e750e..a105b9f541 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 ccdcb470b1..3c7af34ee4 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 e98fd14b00..4cef4c2e8c 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 2b931a24e9..92e478c84b 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 997f340e86..c4e549275d 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 1762d8efcd..5b9440440b 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 63454f2c61..7026d3b4da 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 c681eb7b73..abb7634e3d 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 c215334340..b9a93d117c 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 e716f6047c..b4ba161d6e 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 125bb2cc36..91452f7f4a 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 68de9f4245..4d029b2573 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 8e96c204be..8dce8942f4 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 a0afcfa306..f4df43ec43 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 7f1fa92645..16db6bc98c 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 df1272e339..7006cd4fac 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 e36cf95ff0..e791b8b3a5 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 17eaf697b6..e770d7535f 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 56cadfcd4a..ed09f72d17 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 068e1d88f5..3122134d48 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 51971cceb5..7497234294 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 9ec671b251..f725a95de0 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 ddda6b1b76..7041e18f8a 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 a0315104aa..58b502278f 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 302c0debbc..02744641b5 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 719ff3ff98..0b1ccb8304 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 9aa1e26974..9315f80fe8 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 39dfde15a9..06ef5bc754 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 03def4ae1f..951f253e8f 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 c0574b829d..0fd30cf9df 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 1a721b9b5f..9fcd76423b 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 2a9eab9a50..366423adbc 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 16295527b2..a56359d665 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 5c6cfe4f60..4d38ae01ad 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 cc202f4081..ada03ff2f0 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 51f403cb55..a23e92262b 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 19122b5f32..757c9e492b 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 d4fdc9516d..46410d3d1c 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 0d08a56ef6..3c61d0cad8 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 bb93386669..0bcd82a5c2 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 59c5266c11..2e932d8a94 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 2e3f1e6694..c4f6d20c53 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 37b8155e80..0007ce6047 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 665ad4b0dd..383cae8065 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 201586fa53..8957cc10e2 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 f11f2fcb8d..e033bffe9f 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 ce44237afc..151935db56 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 c039b55dac..c60b89e141 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 e9a8d7c51a..119388dd63 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 7efcf075a8..4fb5f8d2b3 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 64b6dd359f..f1f031a956 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 1c2bb2027f..dd0c9ca544 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 0dc3963f08..cc284c6f1d 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 6f2a502e7a..cf84b1e27d 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 28fdc0e8ef..570ab16773 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 82b71578b9..ba9e164e5e 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 77a0a1236a..742a89106a 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 ae23232c95..aa08f9e03f 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 453ac52d48..330fc3569b 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 0918b8b228..18e6159ffa 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 6908a1f52b..fa9ef63562 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 8f6ddcdf43..7f3d9721c6 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 0da1e5ddbc..1dfaf4d85d 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 fb1a4d2fd7..d0853b60c2 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 e42305c859..5035632ab3 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 8fa3d21ef2..38d28718fc 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 124fb3df76..6eb0545d93 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 56623e5983..acf01c343d 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 9b01cecba3..15a5a2c8b6 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 5f088745c3..38c1e21bdb 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 213b2de015..f529537651 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 456bb7e895..5f3a337fc5 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 3f8e1b6547..bb3e7971ec 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 31485062ca..1faa752d43 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 66696ee973..2d3718243a 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 323c3ca6f1..b84c130aa1 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 a3e119104d..deaed62e88 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 6fe097f595..0b74ca1db9 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 7b1d16f2bd..da96d503a6 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 d5252c6506..f2ac1e6274 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 7f14f14b85..8bb350dbdc 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 2f2dd42035..5b63e9fa91 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 bece6dc010..37e524f0b5 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 5db50869af..0bcd82a5c2 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 ca5b90d143..3ac7d537d8 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 b94e530639..990585835e 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 1559d1fd41..92bb28ef5f 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 e54d1b0b87..9edf6ab2d9 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 eb2fd7b100..164ae44ec0 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 904be8e6b5..61f838bbd5 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 830a77ffa7..9dfe5beaa2 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 5e5893e62f..bca9a7c789 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 91a6a84414..6f45ba54b7 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 23534dafcf..7f2b06aeb4 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 71de63f97f..fbe01a2d75 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 56bd37f0cc..d0cbee929b 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 d7599148d3..0c764f4429 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 272b728a97..1b9204bc48 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 6522fa2df6..4c637da36d 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 d6626d8b76..b17bea1e61 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 b881ab7046..32a85f360d 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 3af029f6f5..9f0512b64e 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 0dd3ae3c93..adf4cfbfa8 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 421c1f24b2..4683b7804e 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 ca3929c7a3..e8d2669326 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 29f238038c..22dfff62dd 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 c44532a203..21b48710de 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 171b49a700..3b4a9b0bcc 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 f8727ef64d..aafd0467f9 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 27b9774a96..48264b0f77 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 1b931fd2d1..9664789e0b 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 005206caf0..665db0fccc 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 e34c6281bd..bc1cab07c3 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 3191a60dab..b81754ec86 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 c45f1f1ebf..17ba3f8c68 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 d1c453b563..f4ffd41745 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 78ce2497f4..d941bb5621 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 6819d5d703..648d1ab024 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 1a30b5c356..06cffbd4aa 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 69b3b79e6f..a43dbc2876 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 cdfe06a4ec..a07db9d91f 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 175015fa47..16409db0c1 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 ea9ba517a7..166c440926 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 1b2793f318..bebc122866 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 489b978598..56c2c95620 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 4a8bb1f2a9..227d20a1cb 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 484c26a51c..8d05d9f96b 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 7d65623054..4a01f99dce 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 83abc79fc5..c8033fc607 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 f86b873975..2ab074810c 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 676a095a70..b638b44642 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 5a03f9f86c..1c2aa31e1a 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 e3bea43ec2..d7d3b5462f 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 90486ec1b0..ac7fdac5e5 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 c80bc19d6e..c4a77f8fbc 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 709c7d0702..d9a4140556 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 014121bde1..5480a50b03 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 d3a76d1259..a69e2e0c7c 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 417a4dc84d..ecc2c3112f 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 06570120e2..fe2a8c0b13 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 9b9429dddc..32a5fc2bb7 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 86fe4507d1..74eeb22470 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 ba5b4fd1f9..d4d3ce9b2c 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 ee48a34e2a..d88a348378 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 34cb509938..93e5624a4c 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 2e5224320f..e569eccedc 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 13fa640533..1f8b3546d8 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 d57015dd75..a44a5b3b96 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 0e75f93be7..0dd9c461f6 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 090f9af146..44bbb6295d 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 28d2ca9a2d..5c63dceab5 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 fffc794334..fce7a7ac73 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 7e0777f666..7dae61605a 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 0bdcce64f1..8d94a30fb1 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 2e5e170677..610d5cec5d 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 bd25c22a2f..3c9877e17c 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 76be341eea..a411e78501 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 00a9d4d878..e57ad2bd0c 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 d467d54c9c..d185bffb55 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 5f8ecb356c..d3df7b3fcd 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 aa3b9e01d4..8b1b7ad67e 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 742e8b4b03..0c8a375082 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 28634e43ae..2b6b2e36ee 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 56b37eda83..3fabb9b1a7 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 abe6adfcf9..c2201716df 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 128df48d40..641d23d6eb 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 8a15d71331..fa4f5f59fc 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 a724cb8c6e..e36a7f0ac3 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 77e2cd5716..2fb2466e05 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 f8ee94bb81..475645b4bc 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 e0c1faa084..4156337478 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 8344833548..d548036990 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 af9ddf4b53..29783c283e 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 bb93386669..0bcd82a5c2 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 5aa1e945fd..0936ce2d34 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 6c66cfe0cc..67db2e22dc 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 e51c2dc514..9a45d796f8 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 b903f0b84f..c47f0828e5 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 c34676efd9..28cef7111e 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 378db8f257..02daad34ed 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 91ee3274c2..b21ecddfab 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 70a96d44f8..a9d9a43c63 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 3c9fd78ef0..88ac8f443f 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 aaac0c5494..89a43bcc28 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 60026e0fab..e2e0861940 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 8b2965d1d8..c4f12355ee 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 56b183011a..053ae4cee0 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 617fbc60ac..62024429b1 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 d99d6c6e8d..29bab8b8c2 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 b9a99dd47b..9c140dea92 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 61c4dcddc0..0939b8880c 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 41fdea4bd1..34ce5b45cf 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 a87becc00c..5fa17cdbb5 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 eac05c9c6e..8fb2f89954 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 24377bd03f..c4943130b6 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 4e5c71235b..a2760af03a 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 56d23ce817..dba7e2be8c 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 c57b4b9b66..8591b50620 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 e96eaeb754..829117ecbc 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 cb3ef67c7d..52abf75ffe 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 7f573146f1..87b28bab07 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 67627080fe..9132415163 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 1f1092baf7..77c97e32a8 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 5c19999a56..6d4b102033 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 830f639829..d0d147792e 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 4348ab7bf4..11514d5f5c 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 ad3f2964f3..522c668abc 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 a98ac5343e..2e488f3cf7 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 d4d2fb7175..58669f6d5a 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 379cafe324..b26aaf0d59 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 754209431c..b6fab24688 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 133ca5ab4c..2538444eb5 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 e077d39e85..87f3690c59 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 d56467de16..3110124998 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 8ea6672fa3..cb4ad56aba 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 389a247284..649966d3da 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 55768e37a1..201bbb39cd 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 f0fde8fa0f..92df9d0631 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 ce9f8e3d88..2707d43703 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 f62c1c3869..ecb8f062fa 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 5eb509774a..4f054a6049 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 8dfbb13f86..6ef0cc09f3 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 898eab712b..da9b4fd235 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 9a562ee29c..00b129d0c7 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 f064e40f05..bcf348ae66 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 0f99c034dd..00a28cb9a7 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 fb45c47e30..fdaf97e733 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 230781fbb6..702f7c71ab 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 3a561238be..22edb102a7 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 b59718fcf7..1569f521b8 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 97cdfa9d0a..e2b4ab7579 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 9a96550888..9127a78656 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 b26efb4c9b..16f4540c1d 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 1c708b0eeb..3076fe3f42 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 03b671d380..8dfa559d07 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 394a6f6550..14dd0bc2c1 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 f6dae6753a..f382bd3df7 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 7723944cbd..92368c7b21 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 bb93386669..0bcd82a5c2 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 df1ef3e0dd..47537d54e2 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 f6898bcbec..72bc366caf 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 c0cfc1b8f7..43b4690e17 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 ca5aa6f212..67f8349c17 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 b53bd5302d..79b04389a7 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 b54c758da3..f3167485fd 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 037cbd3c2d..6f174da1bb 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 eb642b81ed..e9573ad18e 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 1f6cbb064b..743a474e90 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 25434f5a61..22d62f19e4 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 c5d037377b..009a87867a 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 d8af4b1bd8..ca0697bb04 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 bc9de1afca..3c9877e17c 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 fbf18a8025..76efb37152 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 7cdf32023b..b233173d95 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 ac9baeb924..f4dd69e120 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 a8833a2a6b..f95fe5bf9f 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 8353715098..f85661a3a3 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 fe479108f4..d5f8ecaba6 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 fd17a19f00..9fc93962f7 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 a04ce149f0..0f40a16244 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 ac49353049..d8fb9beb64 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 9cc949a708..266ae5c59a 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 eb54d36e50..6ef68a6ab0 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 f8904701cd..ffe122a1fe 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 8671324d2f..a06a612758 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 066a82a2c8..5dae045658 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 f462518536..444880c9ee 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 a9ecb2f392..45407731b6 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 07d1ff3e36..95a4b56db3 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 6ba7c6b6b5..59acf790c7 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 b6d532180e..9ce6634619 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 87974f7639..389e576b63 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 e18b398675..8c43f865f1 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 fad4a46068..0770b34a0a 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 867bab157b..bd412c1fc1 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 74ae212458..e5ed780179 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 de87b52670..c79f907ed7 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 c89c579a93..87aec2d2e6 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 448b5302a0..1599d971e5 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 12976d99b6..bac5ce1607 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 800f892141..3eb67b2b4e 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 de7709a500..4055513c0e 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 c5ea6ab21b..0b562c0f77 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 0f83788227..ef0582f1ee 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 f784587525..7dadc4b850 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 a0975eccc0..87caf6c0f9 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 59ecbc2c6d..f067105bdb 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 f4261ff357..b90fa69a32 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 fc5ecfb226..913a322aad 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 03e4d9b729..a762f7338e 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 24f5f12fcb..82f55a4a71 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 367c902df8..cdbab79279 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 bb204c3168..6123076e52 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 daf0dd0c7a..dc5151e5f5 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 bc0b85f386..360a9eebdb 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 0a935db690..7df46f7356 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 6885fb5386..fca2a690b5 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 760b926469..0f91ed818c 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 91a6a84414..6f45ba54b7 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 19a1132c49..c9debbbc4a 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 0fbffeb70e..f1edd5ede8 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 2a3c9d6a88..52c8caccda 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 1f768f7a06..b968ff5900 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 861ccd9982..f0e507a50d 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 ab6c9a4c0b..e784565bd9 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 9b274317e1..fb498f89be 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 f465ee884d..01998a0ec6 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 dd55fad4ee..a668168fb9 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 2fc2c26245..11a64382a6 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 6a178352ab..dd0121d629 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 b610024188..74ed533fca 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 717a2c4929..1367ab1b4f 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 5ec9df85e5..4d67bf6f7f 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 653fc51cf2..6eb805e53e 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 271e1fa779..acbb6a7221 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 a7b9bc1137..0950e9e94f 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 01322c28b4..0b77f185cf 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 17563cf74e..86d9e90f3f 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 4880153cca..eb19f8f1f6 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 9482ed57b1..3582c49461 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 5c1938d441..f1b047cda2 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 ac9f2ab042..c9ea886554 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 8f2ec3a742..f37e25cee2 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 16a1290ce3..5163099f54 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 bf3cb14fdf..0fa1b4598c 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 03a2fd17e5..b396300a43 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 288b350a0e..0e93dbe6b6 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 3523fe4887..2108ea0165 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 0d2dc4e45f..60e445a271 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 251d23ba31..f87285b2ea 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 ecf6b10595..0be09b1aeb 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 bd70d5e2bf..c6b84202c7 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 904eb4c0c8..3cb597ede3 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 7943d18727..1f1cba2b4e 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 d97bbb0282..d514945596 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 89cc4743af..5280a3eebf 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 2c768374e5..1b3e733017 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 62de6e1ead..c06e6b151b 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 fb1283a64c..ec8f0b3513 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 7fae8aa74c..7683ad8db3 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 ae8178ebd1..d1dc5cfec3 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 d742b8acd5..35d7d5ec8e 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 e1c224864a..3636d223ea 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 45dc92f99e..642c0de63c 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 681d39cfd1..7e5ae4db06 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 40e3e5b041..ac7b8624d7 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 d7f8bb4f1e..f4daf7d9b0 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 c7eca7b77c..753172aeff 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 27412d4e17..9a7c328a0c 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 dbf301a768..82774a018b 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 b2f8c5a784..97280bb867 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 48b291ef4d..36ec27b03f 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 7c5f6bf4b4..143f5d833c 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 493ef07b95..f9f6d1968a 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 1d1f373355..4d10971624 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 cf525abf8d..c960331ab2 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 ca80361bd4..5f1d0d3db7 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 7a20ac6b5c..507aa32a72 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 31925711e1..d23cae06c2 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 1286b80f34..244b0937ca 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 826c21ae93..8c83b5062d 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 6aca423ff4..1638fa1a6e 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 f72b34ed3b..bbc9d99def 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 b781a5c1b4..1dfd553d2f 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 19fba46a1b..fc53d7c674 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 e6b198c729..282540890f 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 5cc8cd41df..e1279c9097 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 105c841195..edeb3796a5 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 3650c44ec9..1d18dbbab9 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 67b8da0734..61ae7ca22e 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 f16a2c6f1c..9e60a8705d 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 624afc0418..af2681b11a 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 6c42358634..85f49f95fa 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 88a9ea8a5d..ba62e95b5f 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 02171a7c91..a03a61f4d5 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 f7b68e7cb9..2fd1705113 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 960a842b11..c434da3ecc 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 8ff46a84ad..8aebe83905 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 5659fb2517..468ec234b3 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 ff7742eefd..76126d2cc8 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 6e7baf6c6f..0658836e37 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 de5b1c5100..ec162b8ffe 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 6267aa0731..a552f99191 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 1aa67b5814..a5f629a8aa 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 6c92469c77..10a03c2171 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 629e5d1300..d65d1e8ea0 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 d600d7d583..a6a8d0f6a9 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 7fb71c8270..e6861df7d3 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 2659c39d1d..2740d2e79f 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 1f7b410e16..420f296775 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 40de9d0ad2..fcc9d16d3c 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 b164668ac5..89baddaeb2 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 4df506b097..5aafa3860b 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 819d0478ba..777e27f22a 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 1ee8a9afb0..c703e2a306 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 0775003135..23cb7c7855 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 fb5fccb1a0..06402805be 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 ad77c45220..3b550b297d 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 92ce19b161..845c16dc3f 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 f3ce55a45b..acd41d5397 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 e869fda230..d0a800a129 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 e605406cae..4e07833775 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 89e2831951..7c6709e0d3 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 2fbfa9721b..379544b555 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 e65b61bd36..45a3c44218 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 4574117b6f..dda5af2bea 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 7ad36f6cc8..6076485226 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 20b0c95252..dd69d8dccb 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 20935fb6bd..c0571cbe47 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 549d4513bc..12168e5e31 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 d39bf52e54..85b1ef336f 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 086a8930dc..f2a36ceaf5 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 64944a8242..58cf685e27 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 0130d27536..b8ce3956aa 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 1e11a514a6..ec08536c3b 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 b872cfdc4e..702b3fc7f2 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 0a492aee5b..ad29df19e0 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 44da04c327..021c6b5bd0 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 231e257acc..22f7afd68f 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 1c4a662dd4..1a9664fcb3 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 62cd2715e4..059b2fe417 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 0a10e3d82b..7402234c14 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 c37428fa53..d0bbdc7330 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 52f147a250..7b120f446b 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 e684139001..fdf200aee4 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 8aa37c420d..0f3220c7b6 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 18e4257e86..deb81d5630 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 b404ea4947..b6a6ec520b 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 f1805cab08..13d2522f93 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 12e09de698..d68a73ce29 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 c0e7b4b748..6f6567d342 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 a951c8fa36..f8fdf566a2 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 a5446e36d5..b646af4742 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 bc9de1afca..3c9877e17c 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 222a6983b9..2b9f250ac3 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 7a4fffb6ce..e917f1c344 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 e5ba9f3971..7c6e02ea0c 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 24b9c22816..722e542dc8 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 4e8ce83564..42009a2300 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 4f013b0699..fc955af304 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 c772c92db3..04e2762f03 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 89a2682284..d984ee3170 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 726a04ddde..50280bdb95 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 2bb6d8f675..d6499be22d 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 c196272cfb..240123336a 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 bd985bf73b..7469da0b2a 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 870c6ae791..a7eceb69d9 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 0d107b8d86..d611f4723c 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 8d60ece462..b76ebb1c60 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 933dee482c..d3d1456b1a 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 5642f33e23..8a663cb304 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 35ed864e6a..c5cd013c24 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 2d8d0071c1..41734e73ab 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 246a480fb7..984757b329 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 330b197c0b..e2e0c920cf 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 a9839affd4..8caa00bac0 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 57e05b4153..f739d75534 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 31c16ade6a..310818c93e 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 52f11d3ff8..d08b423484 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 8543c362b6..80a06dea17 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 9379bbab0a..3591c544df 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 e76f73b769..5dd0cc8332 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 bb0bf22c3e..095a3e6ac8 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 e9c77dfa11..cf27f6c7d8 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 c6704c03b1..2a8b4e273f 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 d30fc7f2e6..d100ac94b4 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 8be4a871c3..063f6c56a2 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 527c9b310e..06be729b7e 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 c79948b846..a4c3e38fad 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 d7756988fa..b84c130aa1 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 820c7303de..04860a977b 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 261d404f7f..dc9cc48f86 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 62fc7ab61b..75848d7e8b 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 90f6210627..31db8d06ea 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 ab5e070d1e..d993b5be31 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 323c3ca6f1..b84c130aa1 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 efd87f27eb..430509fe1b 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 f064a8fc03..e64936aad6 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 f07ad17d10..1cde93eabc 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 929d9596c7..4e8e642710 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 82a3a12fec..6bf48c9de6 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 af5fc1d7a0..c3da5eb4c4 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 62f952d293..cf92315837 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 91060b6a52..6507d86d1a 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 b668d745f5..963539489b 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 8da626c923..b14686fb05 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 ddeff01065..18d6825764 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 237e732bf8..6183d08929 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 22048fd9c3..733f284402 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 57e60df94e..c2ccf24312 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 40f05f1f2c..db080d2cf3 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 690204949f..e0aabb0cb9 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 8ec52c04e9..db8d66dbb9 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 d7756988fa..b84c130aa1 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 476f98ba1e..1005a5cbb5 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 5b75d92ff0..725c69d1ad 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 aa24f1840d..fa0d3bce29 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 7e01defb99..5f7459b8c2 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 759bd1762f..f6529f48ea 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 bd25c22a2f..3c9877e17c 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 88b8bed7d5..684258b395 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 bc9de1afca..3c9877e17c 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 61d30fcee8..f78e62c7f3 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 03cc0a456a..79ac1b5741 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 4ac05cf7d9..b1c735d970 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 91a6a84414..6f45ba54b7 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 14c2ad43f0..289a8b5963 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 2e3ba191e8..9757d40491 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 63b301b1c6..f7ea11069a 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 d1cc688228..253e09eb2c 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 1f90368704..efc25cd7e9 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 28782cb9fb..695358d9f0 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 62dec9ae30..705de4e3d4 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 3f8e7ed393..16d33293fd 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 4b8f5cc36d..825009e39c 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 03118f6ff5..dfd173eb38 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 931e52a9b2..8fedef9a9b 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 e9c5c8a694..6f466d9073 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 9d585af91a..794d995b69 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 bf4c44e3d1..07ba3bb287 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 5115efed48..ade3396c39 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 e51016ca9a..59494d73ce 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 466c23e6c1..0fc7771887 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 8acd47e810..e95d71eb01 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 633b456b13..3f9e1fe175 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 ca03980468..5d87997860 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 68a456848a..cbf69fdb7e 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 a12a3d1a75..5e1f55fcfb 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 185d396a4c..d87b3c7690 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 23ff67ba5b..65ca825158 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 74a2814380..a68b633c5e 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 b86892304c..e3be78aca5 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 16324a1dea..840d285189 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 8587940ddc..2270012c29 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 4c2a83f043..96801b2684 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 384fa84e3c..b4fa0a92d3 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 bd25c22a2f..3c9877e17c 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 d6740fb4a8..8f83d201b1 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 c006cea93f..4a62025436 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 057a5241a2..63345d14bb 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 cf7c39a4ea..7e5965a678 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 9ec0bf4bb8..25f8028f9b 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 78402d7c87..b27219ca8b 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 c0c0b8e85d..5d4d2dd43d 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 3729f92877..f0513be82b 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 005f5ed4ce..500a43d77f 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 6605237121..d3cde57815 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 220f9af15c..70db9fdaec 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 6652127238..0e8dbbd459 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 8b0fafe4b2..b36bc59031 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 21c3201013..86140c616a 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 8f842d56b4..2ba9b44d75 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 4e5eabf56e..2a68d40918 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 54fbb060bf..f6278b7a63 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 77513190b3..e24728aae3 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 3f535c99b1..1a6565eb83 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 23abb19ad9..01cd9db5f5 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 8dcc1af0d7..e846e0c934 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 d709e50e24..798f17cf3a 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 90260d2731..791d47e798 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 2eeaa35aaf..5d9de76c61 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 09f5294121..204156cc44 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 9f4f521786..d6d6ce2dc1 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 eb2f665ae4..ed30ab2989 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 35adeb24cd..a6eabdcbbf 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 6855a981ca..dab26e1f98 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 6ab4b99e69..93e6cb0636 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 dcaa685426..47c58ab516 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 58d8cdfbb6..17bbbd45c8 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 ae06a6f375..e77fa3ff7c 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 312c317747..ae615c8af3 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 85efcbecf2..8f325747c3 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 1f7557ea74..cc9d3eda15 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 9983d6adb2..0011c4977a 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 85229c535a..3e71f5a13d 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 4880153cca..eb19f8f1f6 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 c974d68a00..1f10f65cce 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 55392c6ab4..32bafcff98 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 84f0340364..11bcbc1819 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 fdd79f6b86..ebbd2cb472 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 32413a4b4d..ac33a2762b 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 a7105025c1..934b4df88d 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 4880153cca..eb19f8f1f6 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 3948a409fe..b481c756c7 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 d65c5445d8..0cc2ba52c1 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 d47ad06879..37bd14d0a8 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 0f6e9055c2..940e4c782b 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 e0420d9613..28cef7111e 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 704ae4fc70..f586887bee 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 e9436409b3..5c986f5adc 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 9d7e8e2dfe..4feddb3b77 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 c05da70656..44de7e5a5e 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 d12b5772ef..5fca51f4b7 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 8a2218b2d4..e08f37b428 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 97321e87eb..02fda23b0a 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 bc9de1afca..3c9877e17c 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 a16f5381e8..113053c906 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 dafa0ad315..cb9bd0d2ac 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 5345bff3b0..fa25c16697 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 bdfe972fba..fd1678fd9c 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 08ebbe3c26..76d43f3d52 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 79bfb44b45..dbfebf5dce 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 c58e92c73d..c28e3ad2df 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 eeb178d0a9..5832bf322b 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 d7bacbbfd1..c037330e2d 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 4cfacb64a1..8b2b98df55 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 3dfb02a13e..63e027c8d8 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 e5198ee991..d7037812a2 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 ea5b11b4be..5ff55ab7c9 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 6a4c631497..ff71ac6779 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 5ff97adcff..6665a81375 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 f1f19b50b3..5db53bf7a3 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 8de603628e..27d51d5e02 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 06b9b68d15..8fc1a95fe7 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 b926dfc614..040da489dd 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 bbcfddc7ad..a81fc1e14d 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 9f04d6491e..b9aa89d218 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 09f3395da9..3608e6fe6c 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 a38efa5aab..68a160465d 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 059607a519..8855117d7a 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 75fcf77acd..c20c4068aa 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 eb6e7a6baa..a7708c0100 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 d13d531f3a..d248c874a6 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 155248e1b1..5944e63a43 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 b7c301f882..4607c5e8a7 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 9f4047faaf..e80b836798 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 b85975f443..9ebc02d764 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 91df4fbcd3..2a73869aae 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 f005be4297..e02f4d65ad 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 30ef947c44..0476ba3dca 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 b366161afd..5c75893d87 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 c155d01cc7..6dbeff90e4 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 5f5fe2af39..bff855ea4b 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 bb34ffeb2f..2aae4fbcfc 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 0713522f57..9a6d054de3 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 f9f4df8494..831c6353ff 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 b178f7b3da..a4d8a44ad2 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 2a836dc0bb..c486e78bb2 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 8a5a3651be..a9e0419b5c 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 bcedd504eb..78a2922391 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 dfd2a698ae..67c8c2cb0a 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 4cd1399064..7ec01d5f12 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 f0afea7189..dce5c89661 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 23aff9fd92..8c1797cd01 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 aa3f03d291..d0ebbb309d 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 4fe3960b00..35ed0fd18c 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 98e97f4894..3093b2e330 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 fb3f76ecd7..0ab616124f 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 5471b6a355..e3e4c69d89 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 f2a758e84b..c2d4e8fb55 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 8d69ca1e3f..ecbc10c67f 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 54bb430679..a9a35b9bc3 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 affc1d214b..df2b8ecb76 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 31d087779c..b850a6c370 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 37c69a1c16..65bd7bb7ec 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 bb93386669..0bcd82a5c2 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 68f6c43915..4ce62fff55 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 a88ccdfe22..0a0cf9edf0 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 57b915f7d2..0ae5869f3d 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 b8717291c2..cc38da57c8 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 40f4efbdc4..a6b2068095 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 5002a7a958..7cd6b3517d 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 a426379d10..2136ea0411 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 7fe2b115e8..9386a0d560 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 1256b8dae3..783379f3ed 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 0e3f6d247b..703144e111 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 522dd9d2cf..200e221ca0 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 5d514f2ada..ce896a08dc 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 8607127d30..1b330bbf1f 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 324309d243..93bd48bdd7 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 175d19141d..d94e78b987 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 7bf9ac8634..4cdd59806a 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 b4ca04549a..14fffd19d7 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 6c699cd748..ff88d8a96b 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 1fa65936fd..eb77a22537 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 8e60c20a3e..dd7c56c758 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 13a3d21eec..c366f7cc98 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 6d9cc07a2d..054388b773 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 24e2717145..482237f251 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 9827308626..6707980359 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 080f889c9f..d9f233ef18 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 fc3f848e95..09629a1dfc 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 93c0f85a03..d3ab637cd9 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 30a6a8617d..009a87867a 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 c5a9a96222..b6c16de43c 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 25a0797281..abe5e167a1 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 50233b393c..b2899e0261 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 70e13875fb..a9848bcad3 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 49c785ca99..d90ad563f5 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 697d6399fc..19af0e2069 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 bdce5716b8..2599fef531 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 f5b32bc5f3..8a76ca4234 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 0aa0872a84..a7b7c6cec3 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 a7a3531597..57ac4664e1 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 d5b4da60d2..d303216588 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 a8225b8fb5..356743b540 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 a88056c16e..6038a22271 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 15880f85e4..d7aa18427c 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 ed8f2497fc..bf8cc03fb1 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 a802f2fa52..24f18b45fd 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 ca8ff327c5..b91e721c33 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 560bdd7380..3b7838fe38 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 9c07a9eeb2..4576bc3a04 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 248a8af6a4..506a52daae 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 d84328d9ab..0dbf96a6be 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 8f960ec659..e5d24c7d99 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 f867a25cdb..4f714f2974 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 a4144c03c0..4f0c310e08 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 20da2d07a7..563ba9ee96 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 9352457f18..545ffb72f1 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 88ad9ea3b0..b9806042f9 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 dbe987a052..13383b97e3 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 0fd497d3d1..8d424d11ce 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 0e329eabf9..51e6bf0798 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 bfb672effb..f7a4463aba 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 033f9c1190..85f4d41f39 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 9307958f95..8c8502b2a0 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 d4c9b8e6b7..f1f031a956 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 cb21dc7bbb..301025bc54 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 357fedd63e..36c4c76617 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 dba85b7d2b..0d7eed29af 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 889a49c7fb..1a80c3dfea 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 68c904215e..24d670f8da 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 17f50c2356..880a5e5611 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 f77b0e77dc..e83c0c1c57 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 a0c8945fd1..bd1620e4e9 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 d6451d32df..4265a3d5d8 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 2afcb40c58..beeb11bb62 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 5c7d0b6da8..141d9dc8dd 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 33f4bfe60a..118c839312 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 d1d0029b70..7500df198a 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 194a54aff2..689be40681 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 c517d8994d..aa30ddd877 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 980a5c3364..f3e2556265 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 fe4eb8e9d1..9e9665b07b 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 1af906047f..84bede1227 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 c3f45cb200..206b39e909 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 3d9c2a9a25..4f159c2ab5 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 0022d4b07a..b299d09921 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 a9a5e6180c..5c607337c2 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 50965ca0b4..4b2ef5bc5c 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 9b851014d9..cbf435bc2d 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 e57d08de6e..be10319a83 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 f4af0962a2..8c930d1d21 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 5ede288173..51aeaefcd9 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 b515ebbcb1..3fd88dfb39 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 8e9f3812c1..b4f4461dd6 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 e17aeb5f48..6440d49186 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 1374fc40ae..d812203264 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 265d7c3ec4..4dbd9f5d3f 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 8092c1c2eb..7213adc8dd 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 93d90e7ad8..18d52c5ed9 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 63240f0ab2..ef69b58131 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 1f8549ff1b..b93a12ad0a 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 68b617e029..67eca0a5de 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 792d121956..a044eb58c2 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 3e4b60473e..1526cdba65 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 a1efbc0ce9..7ad53da162 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 60255cdade..c42c94ff66 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 7d529ab33d..3415b9f75b 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 d9045e8318..5ff6ab4220 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 15ee58b9b2..f7fc189cb0 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 d6c948cbeb..1aad3cec57 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 26667826ed..312a5435df 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 250c517b49..7d18d5bc89 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 afcc326cf0..4456ee4703 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 d5870766e3..fd1317a76e 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 b50db87646..199dc6885c 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 02c3301dae..06763d9f45 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 2ec86285ee..9771b197a1 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 316b72d5bd..404a7a0a37 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 a91173110e..9c67432d51 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 f705a33a32..6a1640d32a 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 f952258636..f55167e0da 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 66b368e283..8f6fdd42be 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 a7d980952f..2cd45023a7 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 47ce2498dc..6fd05f06e1 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 0d3ed72596..3055a5b828 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 e7ee9aa57b..98a5ec9fb1 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 f26d7a348b..70a4cd0e56 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 3a6bf93972..e5c071724c 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 53fd97ac21..b9b6227339 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 5a8b7d92f6..78726cdfa2 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 29bd4e2935..0643b1cccc 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 f59d536a5c..bf83b7ac6e 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 100ee5e2f6..35b917cf45 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 f1af200f25..03ca97ca46 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 e08aa77694..da5910733e 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 1163120880..ae860d3138 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 da5dacd8cd..4b9bc76fa1 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 62b9483018..dc368bb5ae 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 e46733b800..4fdf7e7a86 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 574929e02f..692ecaf4aa 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 4637f0b265..3a0704c3b8 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 9cf3f38454..2f7e77e1bc 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 25ddffef8f..542a85d08c 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 7986c2b5ae..7566336b93 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 9fc11b5663..7564a96068 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 e3405968c0..44a7f9b74f 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 39fb30d21a..9e2dcaeb54 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 91a6a84414..6f45ba54b7 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 ab2f44a803..0fc948b860 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 4994074df7..3ae929b356 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'); };