diff --git a/lib/routes.ts b/lib/routes.ts index 314ff617b..64564096d 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 cf37b050f..9d130df1e 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 b95ff1686..ed0e3c394 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 1839e7de0..f00ad4984 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 43b70ef7d..e986b4842 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 45b3b913a..cf27ba013 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 48f2527d6..874c04fa6 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 91a6a8441..6f45ba54b 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 04f0b2401..00292dfcf 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 91a6a8441..6f45ba54b 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 4b358d8a5..36b80bafe 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 c7bacc6a8..cef7251e5 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 8580432b9..213e8c70e 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 4ee406af7..ca0a83768 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 283fdd29d..419862252 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 8391d9a61..4dee490d9 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 49abeb9b6..1ccec04a8 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 7c89723f8..6791738cb 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 54acfdc44..58e9bc693 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 010ef8e6f..3f5e3bcbb 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 00cad4e5e..ab08bb3bd 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 b2d453e97..7db04339a 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 44a5613d6..fbc97c929 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 6896d61f7..f39593f29 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 32d4caa81..f097f950a 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 b5446fbe9..8a4372fa1 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 b85570d2b..f70cfdf82 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 46c178bf9..2e092c349 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 ef1485e4e..59b231c45 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 a05db6c5b..003b55a49 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 5e321d8fb..7ca981aec 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 2c01ed9df..c0d2ff02f 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 7220f4d95..530fe4c84 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 9f37497d5..578ff1b74 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 028c44708..8cbf4389b 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 771520840..9bc8c038a 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 be23573a8..a17d0675b 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 bda8e27b2..e8e581ad8 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 c3257e400..980db60d2 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 074bd7d3a..e5f05a224 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 7031faf80..abe7deb07 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 571706666..75b01fba3 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 d981a68ea..0dbd420b6 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 586e3caca..e37d23a11 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 c8035aa47..f20fd4f13 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 c34676efd..28cef7111 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 2a7e12b6f..418ccc5d0 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 5268389d3..e6c7f9831 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 9b1881685..393196e14 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 189ed3122..ce2409029 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 4703c7240..4ec00c4c2 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 ae30b9d68..b3f4b35f8 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 ff634bebd..44049e8e3 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 129d66851..247a4d550 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 e80251b69..4384c5f07 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 ce0df1288..4f00f6c84 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 b11f4bbb2..b248d16bd 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 3dc7631a9..85dc5c61a 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 d61d3ebac..02eac48d3 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 dc4c8f5cf..f70cb9549 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 27c59d789..ef765954d 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 48862b0f0..fbe01a2d7 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 376ded9fe..915d40205 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 437defa71..31c0a615a 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 51e248624..5c7b83ecc 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 ac131412e..614635cd7 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 f764412d8..dc9be176a 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 14198223e..8e8df76fd 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 1498ead36..423fec16f 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 1f56d4500..81cdfe691 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 3f016a0f1..8854834fa 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 cca8817bd..bf2d5452e 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 9492e563e..a201e3b7c 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 970248acf..0da3a2359 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 13bd5d41e..3f0585580 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 15755d354..c83e9d545 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 7be2293b8..a45fe4249 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 b29db20a1..b48fc200e 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 932d151ca..b10b8cba2 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 4074d0543..ec1bfd6e4 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 644e5112f..2dfd9817a 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 151b5753f..87181718e 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 ae25139e6..14e612b98 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 2e6259aa1..68bddd493 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 91a6a8441..6f45ba54b 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 ffd6c2746..cbea98d92 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 86a3bce3a..49e420246 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 14297e7df..1cd637595 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 29085d755..2bb14d40d 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 d2405b8f9..b4112480a 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 0074d06ff..aa6d88a43 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 70a5086dd..029aef75e 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 c61e8caca..e0b1375ff 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 e6cd4f625..abbe2965c 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 befdb07fc..17260b3e3 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 3e187442c..69e5191b0 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 91a6a8441..6f45ba54b 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 242946bbc..963ba8459 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 89acec5aa..247ec2907 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 a51cf9dbc..e29f710fd 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 ad402868e..40a9ed245 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 7055da0e1..3dac4a667 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 1b3722011..296af37de 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 50ef64c14..a674bc3b9 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 829101ec2..6983d696d 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 588fcad5b..11e6fe325 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 e18ab00e9..805945303 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 56b183011..053ae4cee 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 257cef01e..6be4ec49c 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 5c89b5190..cffd8f2de 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 55f43ed81..31623f5dd 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 8baa7b7a6..1bb71e38e 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 9203a97a9..5e4b7f6b5 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 37566a5a4..abc26382c 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 ff7be9a1e..cd31412a3 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 49100cf79..8340f2e72 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 d78181731..1d1c8d8b3 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 af9231053..cf0a9daae 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 02677367a..1ee007347 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 422838520..f4b7cf4f5 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 d85ece4e7..8f54088da 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 299d1d6b6..486f5842c 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 fe7a6d9f1..eec9d8a66 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 38ee120f4..736d8da35 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 f8ce37d60..fb654040f 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 63454f2c6..7026d3b4d 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 12f566d0b..44de818fb 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 de87b5267..c79f907ed 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 800fcb458..d262d4772 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 c8be8bd86..2f9b26e3f 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 a9e2fe51e..3709804fd 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 8e79ab53a..89d493821 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 e0154d0ee..90dcb2b32 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 e8ac81cfb..378024d7a 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 73e5d1472..cb7c17b0d 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 931d32e7f..672901d57 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 22262a6dc..9e325d1e0 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 07e4745bc..8b2b38cd8 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 cf227695f..5ca24ae56 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 7d445cf45..3f0ce2e94 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 c800b6ea0..1dbe8bd1b 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 c13ccb056..f04646f89 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 bd25c22a2..3c9877e17 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 1cf7cbc40..c7aaccbb1 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 4296c8c19..611f80b11 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 8024343ba..3a2c15779 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 033bb5c47..56f7ab431 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 aaadf47c8..33b4a3af4 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 0d08fa87c..6fa12feeb 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 3f6920c32..2d7b0079a 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 ae6fafdd6..79a14f01d 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 3ad71f317..be8a3e99f 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 f130c6d39..2c2de0abb 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 73c23528e..1a04fca20 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 a464993a1..b3ad0e5bf 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 84a8b163b..a019b490c 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 c3b6ffb51..677dfd592 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 e5cdef3ba..342e134b9 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 8f86930db..868acffb2 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 61745dbf6..7f26e6419 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 51a35c661..be9061249 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 774ddcd03..06b220628 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 a126f2943..6ab15dd41 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 de87b5267..c79f907ed 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 6991430d0..38670d543 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 e8e17681b..81356dd42 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 7593674c3..77261f4e5 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 05683e203..38d40b361 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 cea513802..b51431042 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 67a2331e6..bc407336e 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 465f86cdb..74cb5a150 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 314a8eb61..73a8fdaa6 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 251cbe74c..a2a79c910 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 a38cdf897..965342859 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 91a6a8441..6f45ba54b 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 518decb4d..d1328889d 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 bb0fcab41..f4ce96520 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 c0a6f4e42..5e2de9230 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 3a099e6f9..c834c976e 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 ff93df804..454ddb511 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 ea3e78a3f..6e95d15a0 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 c8aab7f69..3daacc74c 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 8dc914a1c..9a3c86b5e 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 806e83ca6..1eaf72d10 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 148cedc79..e732b467e 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 3de8ec86b..5a078badd 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 de87b5267..c79f907ed 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 a38fc8121..73bf77399 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 914f67bd9..9e83217f8 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 0f50a7a20..e77742cd5 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 226be9f86..6cf820db5 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 110a1eca4..c65672310 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 64c14b633..503b943cc 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 e08aa7769..da5910733 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 8848bc2dd..65271e3ce 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 f9c4043c3..f1b40401b 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 9659062a0..5fe41a172 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 fab93da48..81e700607 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 bbddfd842..e86ac0c41 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 a4f6f3eb8..d8dd2a29f 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 73c6cb469..21587c346 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 331ca0c58..9a3852ddc 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 1005ce7d1..e7b5f1bd5 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 32f0a41e0..394d84001 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 bb9338666..0bcd82a5c 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 a74a9d218..411147141 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 ec490cc37..518f9c4f4 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 37e11a1d2..064fca7f3 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 daa5683a2..a95cfca21 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 79bc3ddce..6a235812e 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 82591cc74..fab74cfdb 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 c1754a9d5..61efd4ce7 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 8fdd6be4d..5ba4f259f 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 57005a13e..937bf79ae 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 6ab63a8cf..172a8983c 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 4c61c7c88..0ed9a4099 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 27ce92539..bc1628598 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 1dc702b63..1fa99517d 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 4556db147..286675c2b 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 3adf9a8a7..967807b85 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 5a29dfcee..598a58cf8 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 c6175f5f1..cc9a72280 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 8f8b44dc8..e5ba33ae4 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 3f98fd793..7ce33495f 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 7d71f0176..d34e36e21 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 5c89b5190..cffd8f2de 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 50ffdfa21..bcbc1d3e4 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 a2568f8c7..cb3d3d261 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 1de580e27..d809f7362 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 b5787856f..03247a4c9 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 615046bbe..c735a53ff 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 e07431321..69bede3cd 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 8460fefce..edd7e1d8c 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 b61002418..74ed533fc 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 5fb17c70c..2f3385d8b 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 9be0c05f6..46ea4ecbd 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 ccaa078f3..b62d2c745 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 0a5c4a548..e8565078a 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 2b72efcb2..ef5edfbde 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 e08aa7769..da5910733 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 1fa1adef8..9455156ce 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 91a6a8441..6f45ba54b 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 aceb3acec..ee43f352f 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 fa990c286..32a203881 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 6ae5b4190..247f6b2f3 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 c254fc310..a41c9d35c 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 94409d83f..de3af370b 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 0dc037fa7..a85005362 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 484f01c06..3df50f256 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 3398e3235..3cf2461d7 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 039df6b9e..1179f9e60 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 efe29739d..129888253 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 6d001c8f1..efbd73d36 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 17f620077..18023044a 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 9de661b18..33b5e931d 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 c5db847a9..6c8929ce8 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 d82f11126..52a0b8a5c 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 733c1313a..fb92b7a2e 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 956a6468e..bf1d8a41a 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 2174a80e9..65ff39817 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 b8440f91b..a7268fca0 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 9c918fce9..b81da07d6 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 906bf1ffb..7289a292b 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 ae29d29a2..412ad9e8e 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 573f84ace..06aaaa45a 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 ab3025d92..ac92dc0a5 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 91d024751..805c4ae71 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 49374ae08..81a6f908c 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 c34676efd..28cef7111 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 93b2e3e2b..4645460cd 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 91a6a8441..6f45ba54b 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 a7d48a52b..cb71539b4 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 2b4adfb5d..8f6a333a5 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 ecef0ffbf..9eda00460 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 bc9de1afc..3c9877e17 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 8c4df68fb..442796921 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 af8cb3304..320452cf0 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 8234f3a36..831b60dc3 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 e22abbf5c..2e367b46c 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 3ec8d9076..3b8e372ae 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 b2ce5631a..bff3ebf29 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 99fe5f817..11608fd66 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 6ec2c5ed9..b9fc4def1 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 28d786c13..4bfe406d3 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 f71087570..f6ac19a0d 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 c6677074e..e8f740afd 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 9256677c5..80d64c6b3 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 34335379b..35b388ddd 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 372f6c4ac..4725be464 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 f46d5dd9d..62b67c2d6 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 49af37fc5..deabec6a1 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 454419ca0..965632602 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 2f7223b4f..b782b028c 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 60963e0e3..6802f15ac 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 dbdcc5126..32b6f523b 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 7b84873c6..698c8e859 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 142a5bdfe..b34b59cf9 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 2dfa7cd48..cc115c3db 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 57c6357b7..99051037c 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 d93291113..89bd6c4d1 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 640bd3594..5818f4028 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 7e95fbb58..1d02e87f6 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 ac68314be..0a3311ffd 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 915c8d999..40337aacd 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 6321f6523..cd9b223b2 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 45b1e984a..60bf7f117 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 230ed09e8..80b1abac6 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 a01cf9134..06c415d00 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 c4941bd05..155ce7373 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 3fc1ba889..125a73556 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 8b6f22086..0b3aaac35 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 540902a76..29fccf314 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 537a858d7..12148bb01 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 67f66c48d..726c31b6f 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 4c4bc259a..e5c23e798 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 d1daf11e8..bab0a5bad 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 67412cf41..5574d0da6 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 343f664a1..739d7fa2e 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 c4eca69bc..168e4ab5d 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 67350a60b..eb240417c 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 f004d0b43..3c307bcf8 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 de2ecfc11..4a0370217 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 54d120956..cd4e028f5 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 b061f0a4a..0d93f9d7b 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 47901f3ed..673f8e4cb 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 30c2a30c0..d0ec30855 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 2e1a12d92..09957ba2c 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 ccee8f790..00127ec9f 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 0fb3de86b..5d964cfa8 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 cbe8e4b9f..f3971bbca 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 53fd0d5c7..663115611 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 15393da3d..0b562c0f7 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 b76c09255..6ab375734 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 bbe809bb1..c50dd54b7 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 6766c5903..acb3bc1b0 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 96aba37e9..3a58e71c4 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 91a6a8441..6f45ba54b 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 d10de38d0..5474cf928 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 7eeec9028..e123520f2 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 1e3d23a2c..9519830f5 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 c2164bcac..1cd05f910 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 428096151..705fd438c 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 8ea1fbe63..c9e895373 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 f6725d626..14b196951 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 52d02438b..cddcd8601 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 cea9b41c2..763b74e59 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 e08aa7769..da5910733 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 7c0e687fc..3f83ddac7 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 924cdbe8c..51ba73124 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 278fed8bc..830bdd1d2 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 70c0daf3a..d103fe7ca 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 97f1cce82..c865d7bfe 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 aedd1dd40..672ff1f3e 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 1fe5601b8..b880c4ccf 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 6b4fb49a4..412c32ba3 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 a4cb0b838..11738bd34 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 3147c21e2..a16a6a864 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 2b97bb949..f93111e20 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 5d7dc35d6..c7b6ee3d6 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 47ce2498d..6fd05f06e 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 68c83c665..aebcfae20 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 62eaffde7..95d2ece93 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 943c3af93..09a9e4904 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 02b19006e..144683a6b 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 680974dc7..49a7c04ba 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 10be26eea..8e69a74d2 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 57012e2a7..865301306 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 b009a2e80..dcbae601d 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 c04e48534..5c0002974 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 4bd14cd65..6386f8d3f 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 6d63ebe10..19d6801d0 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 b43b54d78..f3e717ba8 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 30c419ee4..8f54ae123 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 c50ebe38c..5e23aec8e 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 780e7f2c3..78a5f410e 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 bb9844a2c..58fe3a6d4 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 3b47dfa4b..56ac52358 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 706ed26f8..5cc4e62f0 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 de958e2e6..11abba62a 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 abcbee61b..308dc2f1d 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 cc1ab22c4..5a9ec5333 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 91758d38a..cc70151e4 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 68c9d00dc..1997c6f5e 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 9371f3176..3e817bd67 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 16bb1314b..3e2577f35 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 5db50869a..0bcd82a5c 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 5e1142176..be94b9f5f 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 625259564..cd57ba05c 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 a74dc25b2..3b6bc3215 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 ca342afb7..80cefced5 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 9ea4bb936..6b79c0997 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 4f214af44..116808371 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 4eee56c44..2fc29d2a1 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 ccee9994b..b0b261f4e 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 2ebca4c26..0f98787ca 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 881c2da55..c027e63d5 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 bb9338666..0bcd82a5c 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 d7f7ddb7a..33d976d91 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 a8388f1d7..572c3dae8 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 04b188903..9f7be9e85 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 66a8994ff..05a5904a1 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 c7b7500ef..16346ab70 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 fb63984e6..80f48cb71 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 47029fafb..023a5755a 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 6f9b79515..7ff565c6b 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 c3df8d061..9cd07e1c4 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 3a9d93692..5edb67a2c 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 4e016214a..739a5c311 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 09d5232b7..ced2307f8 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 c5064c5f3..4ea8ec25e 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 202640a4d..6536d5745 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 e832ed962..95d32c151 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 e9a5b6af2..f4101100e 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 0e1bdc5cc..1c91640fc 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 b61002418..74ed533fc 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 34e6b711d..a6c3c5064 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 2960bc23f..e7f4e94e0 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 bbceaf2c8..450972101 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 8ca3a5cf9..4ae374a97 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 47c05bb27..fe527ba17 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 bb9338666..0bcd82a5c 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 41c731191..a23b0f79a 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 385bd1e6e..6536d5745 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 2b195e176..3963632c1 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 55b34fb82..a748cfb4b 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 6336bf4a1..c4923bcc7 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 3d96e0353..dc9d1ddaa 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 5bc3a6ba5..1b096eff9 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 e86078db2..f2e6ad78e 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 6fcedfd70..bf6ac915e 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 82182fc0f..aac758fca 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 c596a72f7..3cf97dd4a 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 d9d312e16..cd57ba05c 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 31b19352c..b91166d6a 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 c34676efd..28cef7111 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 c46d5c0dc..edb9eb960 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 21b60618f..0142a3c1d 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 715986563..e85bebb88 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 5e90b7309..4b9ff0ae8 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 40d1ad88a..a0a40bb65 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 0878a0faf..b41f515a7 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 13a796cb2..97c771694 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 1969245b1..a5bbeeddf 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 441eb0600..d4eb3f030 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 30e6bfc80..f8cc91ca2 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 0854bc475..cb0164c4f 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 df0359ddf..29075a980 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 d8e9b4d86..f69d45bef 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 86340220c..699c5cf13 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 d0dc5a441..9dfaab0cb 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 c884c525a..d3f2afcc4 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 18eb11e3c..d13af1255 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 6389b9fe3..53b6d9a74 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 5db50869a..0bcd82a5c 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 c2cb4a092..bf8715acf 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 6ea9e73a1..3e16705b5 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 9659062a0..5fe41a172 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 5bf78c0f8..54ce39614 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 7102dee13..0374fc711 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 bb9338666..0bcd82a5c 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 f0c89f64f..40df892fe 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 323c3ca6f..b84c130aa 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 25dc76664..064527658 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 61439a031..3ffecf2b1 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 90ccdb712..43570014d 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 d5f332d29..0596db897 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 b8cf49ca7..44c8b249e 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 66c8a7439..79a6d0aa7 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 bde4a8040..24094a74a 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 a3db0b7af..b83167dc0 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 2c6014fb3..716467baf 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 b7f71e315..b7b9c985e 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 20bc46093..7e157f671 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 d0b4a46d8..9b78e725a 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 c4ad5e17f..bb216cc98 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 b870d81b6..5bdbab9f6 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 0915cfed7..40b899d0d 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 64fff4574..4a7def778 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 7f3759fe7..02536979d 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 0868ce843..22684639c 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 27109efe5..f7c882eb3 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 aeb99acb5..34a9ddf8c 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 5137c784f..3e67a00ed 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 7e8d920a8..a6ce27db1 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 b2426f422..0aa30aece 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 c34676efd..28cef7111 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 b7fc58d2a..1e8700752 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 f17c8b2ac..bc350ff95 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 d5326c899..862f00e92 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 887a32a46..2912b1668 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 1a8ec793f..7640f0b48 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 05664377f..d4c60d4a8 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 6ddaf8cb9..02608aeb7 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 b66582a08..895f6dc12 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 ee20bcfbc..b00fca600 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 b08a8c850..a425675ad 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 3557b8c2a..e195634a9 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 a212765c3..8a502f1a1 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 9ac86ef9c..497e358d0 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 6a5c9a29a..85b714e7f 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 d843249f6..ef34beada 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 b73ccf36c..2336cfdd6 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 a3bec6fb8..5fa05ed44 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 317e8ef40..ff40be1bd 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 6b4742116..e8504ac87 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 20e39afb2..529e39674 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 41b6068fe..d47f73c44 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 35cb22ba9..1d95f2b28 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 166a65658..ee4223bad 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 9b0d40b77..cd9dc6066 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 e7e31b425..f0293e896 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 ffaf9450e..80e799986 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 904a3272d..04356eab1 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 08a906c97..95ac6c24f 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 dd8215f6e..1611fd856 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 76aab4e98..a1515a483 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 23b388684..d826825a1 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 323c3ca6f..b84c130aa 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 55be0483e..540e97ed3 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 9a89c08e9..6c52c5718 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 b77fde37e..181ed65b1 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 728775fac..82e4b54c0 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 78af74c06..0f27b53e1 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 323c3ca6f..b84c130aa 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 9b5aa3ccd..dfdbb4af5 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 70c3c41f0..444d5437c 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 70d878216..617ba832b 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 335af3d09..6c0d57b8a 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 3de621d29..53a234739 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 ee20bcfbc..b00fca600 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 a63eff722..dbe53e835 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 80bf1c2c9..06c4d3ca1 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 45bd73aa2..61a360270 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 6b650ba44..841b649de 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 e0a3ae301..f8c9d83e6 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 87d6590b4..eeaf8279b 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 de958e2e6..11abba62a 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 2da9b3428..689b6c5cb 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 224a76766..97c415314 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 e0420d961..28cef7111 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 840089572..16deacddb 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 455a33773..0e66db68b 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 a2ea02023..6ece3b6ba 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 6a2036784..d93a94cea 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 81d0ce005..bf5f0b92e 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 49d4978b2..95926ceb5 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 78fe30119..e3e727848 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 179b310d2..2ff6f9d14 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 e08aa7769..da5910733 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 31a1fe28a..90c66ec78 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 d0e429842..7bdc514aa 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 ba575a18e..3ec322446 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 df5c59327..6915ae34c 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 19e00b0d1..e30b51517 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 2bc54d130..f067105bd 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 d2435646c..2e40d5610 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 af1fc16e3..d78ef6be0 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 a7252a003..4b3e22ea7 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 83c90bd9b..9a797dbf8 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 79e9a3eeb..47201f03f 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 2d9095f93..5dc900cd2 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 f628a642a..54ff8dfd3 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 152674dd2..772e0c286 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 1723179ba..412a4d036 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 b5ad68a74..806f509d5 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 0fd159e67..4348d5ba3 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 73bf5d645..1a464e16e 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 5d85e678f..d1122ad85 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 8a8e46b4d..cb6c82cad 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 f091a5de2..bdc0146f7 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 6a5036591..e09a11683 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 d825dbbcd..4fb631623 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 971a6ae3c..220528d80 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 7a2cc28f7..5acb6bf57 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 6a69ed1e3..4a99c52db 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 d56df7088..2b96944c9 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 fe35fcdee..d432c5bbd 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 095310022..8034f2f1c 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 90e0af5a5..b1afab943 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 6ab3c88e8..98d772d60 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 56b183011..053ae4cee 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 38e2607e8..baee83444 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 54287cfb8..93581cf87 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 20bc72f24..aacd29ec9 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 c28fa3c4f..e8ee53fa5 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 8620e5d8f..c508827e3 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 3190ab5e1..611f80b11 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 8b42eb36b..72441f5c6 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 e7ee9aa57..98a5ec9fb 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 84e965556..2c6edd825 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 01b75bbd2..4929d9f60 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 a2585f740..5eb44250a 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 0215d2240..fa02d29a6 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 013be054f..b79340dca 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 242670ed3..f15faccc5 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 1b1b0636e..10fa80c1d 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 fd54ced0f..ccb09a947 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 23d19cc9b..0c7d80208 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 cc7646644..b9687b52f 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 2a211958d..e0d08ed18 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 35468b07f..7283f7029 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 1d9c5508e..e237750dd 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 9bea67680..1bfe70d5e 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 beba4f3fe..7ce45f0c7 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 08d5f62fe..8dc9e2e2c 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 a69b8abdf..127bd410e 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 74ed06b68..9520e18b9 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 f718cbb1a..6ed469db1 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 4dfb78005..0d5b2da9b 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 fac7fb1a6..59b1674da 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 9486a9c06..60f5a37bb 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 ad5f6eb97..57d2da0bb 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 0e3d64a08..bfb1aac10 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 52e12d77e..4d0fd2d2d 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 d9b312005..86e018dfe 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 b39c207b5..b8665610a 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 99f7d0426..1bc6a3f6b 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 48614260a..990ed2b44 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 47ce2498d..6fd05f06e 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 208726a82..ffebecddf 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 bc9de1afc..3c9877e17 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 79e4bbf4a..e460f3080 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 6551c4e30..5c29e60f1 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 81dd31b33..2030bfd42 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 a19819fc8..43e7c58a8 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 82329f33b..e75fbd6e3 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 47ce2498d..6fd05f06e 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 495563bf9..8cdb87864 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 59c55af9a..bed4f0ea2 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 8ee02b4fd..05675bf27 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 25fed9b47..855598355 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 c25fb54b0..b5fdd0b02 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 f008755df..5be0ed8cc 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 2334d3e4e..742ac57c2 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 2f2d694cb..3c447e720 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 9fc19339d..f994ea4a8 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 340386363..26e9832ab 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 5779100ae..6c806bd0e 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 54cc6456e..ca3e65042 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 6da147060..f51c2d8a2 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 804dfa6c2..4dcbeea03 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 1746c3201..104357003 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 c34676efd..28cef7111 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 5a0f986c5..a125dfc52 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 cf1c90e4e..57553ccd9 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 f3be3558f..46de38c93 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 189dcb92f..eab313fbe 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 f5e6937eb..dc4557e3f 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 b8b9026e8..3eb67b2b4 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 895ce569e..462d4b218 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 b6bb67c49..7e094ab36 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 ed709f330..a7fbaa70a 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 f6c553e45..0814992c0 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 c7b9995ad..23fc07ba2 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 646d5210e..30fd06316 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 c2107f7a8..991f3912b 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 f56607214..86665fb6e 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 16d8df1bb..3d716907f 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 46449992b..ddd9308f0 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 a31f1d2cd..d78893fc0 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 caaf8acac..2f9b2e0d9 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 009bbc834..c3f892316 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 42f020d91..5ba631b1e 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 63e2a2ab1..3ced832a5 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 e55ba6d7f..fb9044fd0 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 9ee95834f..67ca83c08 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 dc358986d..5b2264ae0 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 d911f6629..e7cab19c7 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 47ce2498d..6fd05f06e 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 0e0ec2a54..02d30d447 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 d469ebcd1..95e4ed839 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 696459adc..4e49cd94e 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 f595a54ab..ba08a2070 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 4cfdf814f..fbb70d93e 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 bfc3fcad3..31e02da69 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 b43ac2fed..acf4f77ed 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 981bc29b6..f6059dca5 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 d16a816d3..753605c6e 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 c9a463ef9..6d8ad29b5 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 c97a6976c..b89a202c1 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 4f20efa98..ef9b4e2f9 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 e9c52c6aa..e533a250a 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 9a150750d..9ea1ef15a 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 2b01ed033..908c3aa7e 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 0865a50ff..9974b8a61 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 d92ad1b6b..9f66b3af3 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 7f9f66b4a..acaa3393b 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 e35db8423..8ec4386b6 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 8d0b71b35..db9ee6e67 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 e964328cc..a2fa17067 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 ff3708200..7c74477e1 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 4bbff0099..b30ea1293 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 369d05cbd..68bfd1fd2 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 529ad6af4..73961ec77 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 ac923297d..aabcc6fe9 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 e51016ca9..59494d73c 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 542e4d72f..10b2cba66 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 fd3ffe2f0..db0ebf721 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 126a4cfa0..438fcf326 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 49b42d478..5b9de0a5d 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 a1ffafb5b..eb2e6ac17 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 7b11c9dd9..d30b59e4f 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 1473153d3..21d4a467d 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 7a0d9f379..e2b85fac1 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 e08aa7769..da5910733 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 e668bb113..3a2bcac48 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 e08aa7769..da5910733 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 90d7babe3..18f8687fd 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 e08aa7769..da5910733 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 1d8b198b6..f174804f7 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 91a6a8441..6f45ba54b 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 fb87ff442..5793162a2 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 fe85131a1..28215a60c 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 6e7640814..485e7c2a1 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 0385ee14c..683a49c0c 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 043966e71..8d91d91b0 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 328354473..08d8ad8e8 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 9ff1b0076..87ef0cb6a 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 f44bf3586..a62147db6 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 f96453cac..1e78f886a 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 bc9de1afc..3c9877e17 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 9577811b6..d8161c87e 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 3495c2678..6c4f8d60d 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 aa0fda748..81f8278d5 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 1c134cb75..daf05c89b 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 550a8fa7f..ee535c161 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 7c71effb1..5f4b923dc 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 fc5045400..187287dc8 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 d4e9e943d..f284234c9 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 2d54e41c6..fd8327057 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 082ee7d78..df85a13b0 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 9311419fc..aa19e4237 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 01f774ae7..f7f4ad8a4 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 323c3ca6f..b84c130aa 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 b8fc63f7a..eb85afb8e 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 29f238038..22dfff62d 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 30af047eb..cb2aad17e 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 7e7e6f384..4535da2c9 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 77ff0f7ab..151d49e09 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 adb85a4ea..479c08295 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 3a80e677b..9aedae6ac 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 72394130d..ce4b2fb37 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 94e58c83a..ec7c5eda5 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 35a328330..3acf430d6 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 396def541..6d93649e3 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 676ee5f00..2ca19c630 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 82ec203e8..0354c963f 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 0128597f0..9f595fb55 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 bb301da15..76628fd41 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 fb28c1ba3..264c5d00c 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 72016fb11..3404bbbff 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 5da5762ce..c120fac13 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 f35b396d4..b9db38169 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 c544a7093..189469e01 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 bf9135e99..7e2f4af5f 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 6bfaaeddd..e1b4e216e 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 18a6e6d77..8af476d8b 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 55ee1b8d6..a05b65de4 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 bc6043a42..d0c979c26 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 79fbef5d1..94abec61e 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 0fd99a80f..f114f35e9 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 b81a05e55..dffa9a9da 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 6bea7a44b..4dcf2d4e2 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 5b21a3b0b..b9a0772cc 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 916a4d8b9..d6f460223 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 bd25c22a2..3c9877e17 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 88db29001..b7c80a119 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 fc53fd1e8..94222a659 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 6770a0e9e..6ba4d9ac4 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 4fd844420..95a7b23a1 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 ce2c1f392..4bdfd27cf 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 8e42cedde..e0bec2604 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 aa0202df7..bc14d98fc 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 7ac8f3f9d..31880a921 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 7145ea865..b36fddf46 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 7aafe2507..3d3ac3b80 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 61372ca2a..b9610d60b 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 8057b04da..6b40df447 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 072ab230d..1da37f54e 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 81868a487..7937c3664 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 696adcbe5..af2abad59 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 d03d3fc1a..b656dae54 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 29d38f1e4..ec9ec8d2d 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 7b98d14c7..b85af49ce 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 ad9e11b55..2951b6b9d 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 2ee3fa5e1..fd5ca29b7 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 1f9dd992e..435a4f9cb 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 f06a0fe97..c3ba61df5 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 21739d9b9..f244c7188 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 ea3cd581d..14249af0b 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 177e2cab6..089eb59ac 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 8d753e030..68d781685 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 54f07d161..ed36ec193 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 1a3b59603..4c43dab32 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 4bbb454e9..2ae067d55 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 c9783493a..ed1a3a18f 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 63d992af8..29c9fb7d1 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 2c0468e75..237ec69da 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 e2c1c8211..f20ca4ad1 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 11d841a54..bcec5f3ff 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 179be7a69..0ddcb5e48 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 f7990e239..d5ccb390f 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 5dc871fae..1763838c8 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 a1de87d7b..16cd6a82a 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 02abc62b3..0d185d085 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 1ced515b8..dda8f68cf 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 b77d23b5f..497989e3e 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 5728784ee..9737fcbbd 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 70b0c4185..2807c69d5 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 4d1628483..ae50c87fc 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 e62fa2140..6d6e5810a 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 44e5667a1..1533163df 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 80d98ef6d..51c7ef570 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 07af9906d..ca33823f3 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 a840d2ce9..38a45b7bb 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 0ea8de378..425d38f57 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 c57b4b9b6..8591b5062 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 e1b3e1242..54182f20c 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 d9f882b75..987dbd204 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 c05d27fa4..b4bb14b94 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 499372171..6340f71ab 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 8e696e70c..e1ea344d8 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 27b91186b..5fbd2c2a3 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 e50952238..88a096cb0 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 e90c10dd3..02bb81bef 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 641750929..f9c7f8a92 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 0da7c155c..d87ae47d2 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 05045b720..505206d5a 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 2e298c8fc..16aebafd0 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 bc07ff04e..9d8a254ac 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 70a2a0f04..c63e40dfe 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 6bf3f1738..06ed1359f 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 d61ecbbc1..60b7a33b4 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 994c83adb..da195d078 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 8b0cd08b0..cb933d30e 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 ec1881f75..56df98895 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 4e33f2363..25bc5a295 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 112c75687..2cab9e4ac 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 3c2915a00..f266025a8 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 d609d88e6..fce23df05 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 bd890625a..070314ef7 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 e5ec4ad9d..304f0031c 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 e6986463c..4db89016c 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 2c52fdd46..b8d2fa357 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 88ec06587..a9db29acc 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 dfdc12988..757f5f51a 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 6a7a636ab..fddf686c0 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 4abd03695..c65ea24a4 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 7ff9d2f2c..d49f55ee2 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 eb7ad0c4d..8b215a98e 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 7acdd684e..1357b6171 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 c93f5655f..52d568161 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 9888faec7..d6ec8f7c5 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 9c66d1c24..0bff6e780 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 53a744125..6e2e6c9f7 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 009b65a8e..461dfc162 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 d36fa1a0b..78b6037fe 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 8ba3d2be5..a89fde1f2 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 9985ef295..4fded878c 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 3223b3141..eb8d7e06d 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 f0c99f621..a62b0bb52 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 5aa023ee4..adb63a2f3 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 7db606c90..737fe485d 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 ab18cd908..980a9129e 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 3e990bd30..fe1635b1a 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 142b5bb38..f91498d34 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 45a568a03..7869f5d92 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 8e36c80e0..4d51e8ea1 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 aa0797dce..23a9d67f8 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 f4d2eb351..d130b8c74 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 68fae7b7f..91d7c9ce6 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 3ea6fb9c1..df93baf04 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 b1570402b..c6ab0aaab 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 b41683869..9d7eafaaf 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 02031caae..f85bbe809 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 bc0a41439..bcf0891fa 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 331e92ef3..53af2d054 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 8d1978820..267cd0a6a 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 ac695b976..6f893457d 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 6ffe1e350..e8852809b 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 3d39f0010..566fc3f85 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 d2219ba26..53712ace9 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 452c00a53..2d623464e 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 b4948de1a..45d0d38fd 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 e03ef6efb..247e4533d 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 013bfc2fc..e8da2631f 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 e9f93e077..91db82b06 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 3b9aa47b9..b34522a6f 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 078f560e0..4b2288e5d 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 67d7919af..93064748e 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 a35b0b3a5..b6a6109be 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 78a4c23d2..ce6c46d46 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 5e095972f..f97f3480f 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 7ebb10324..17f363c21 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 052c5af57..5efe5bd6a 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 4decbf8a3..4765fc5e7 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 be5606675..972238c2f 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 bf38efc04..19ad70183 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 6a58e9d75..7d18552d8 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 ae69fb8f1..f7fa91085 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 47120a85d..47ecfe863 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 b7ed2a88a..569b40580 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 196642e19..497e0fa15 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 fbad7777a..6c174c7d9 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 d3ef0df20..f8ecc5411 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 4ae2a7840..aa406de8e 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 38fc18056..e5eef68b8 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 bd25c22a2..3c9877e17 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 2641d499d..9fab39c5d 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 323c3ca6f..b84c130aa 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 fa8c5c419..ae56e418f 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 b61002418..74ed533fc 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 427479386..46c0744cc 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 45821709c..20ead7a53 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 0feea795a..dcdb400fb 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 17acb258e..82355f0db 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 bb9338666..0bcd82a5c 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 f202935cf..2ce97cd08 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 ee85269ef..0634798a2 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 000f18686..886acf47b 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 cbf54ec09..c23c86f99 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 5eb5ddde1..e50a51281 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 12567547c..9da2ed9de 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 72d3ab818..ffaad0bef 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 decdb39ad..d5afafba4 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 c490e0d60..e7eb8b6a6 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 67ae41319..59086cafe 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 718003fa0..02a3844b7 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 0e7f7fe1d..c263617e5 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 95ae29a80..5e912c78a 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 1ed29a445..faafda4bb 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 63ecf1e47..42bb4e4a2 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 2c3b6b9f3..9fb54e900 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 bb9338666..0bcd82a5c 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 bbf6c64a6..98915a9fd 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 de87b5267..c79f907ed 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 42ffe3a85..09c585b57 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 70da6d197..5b5785a8e 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 54672e7ce..d95c4db2b 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 25aacbedf..45e64fc93 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 eb1494732..2f036fefe 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 bb9338666..0bcd82a5c 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 4575412a9..415a562a3 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 30bd3e4af..ccc3d8314 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 388222410..29648a7b8 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 01b9383f7..782805328 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 9ee72111f..dc82f6e69 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 ca0eca551..8c971b2eb 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 d9d312e16..cd57ba05c 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 2f01598b1..48a8b171e 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 74577fbf6..78b25f978 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 7c567e04c..f7d1199e1 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 6ebef7346..eb5dfecb7 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 3080a61ee..dcf1d4425 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 1289d2702..6ad68243c 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 0fc6fee4e..8c7170299 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 3cd5e8b55..89186a042 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 5244842b3..d0686b64f 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 500760904..e3680504a 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 ea7e7fbf9..bd3d99c68 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 f5461602b..da5d2b272 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 a2c68a94e..bbf28d3ce 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 398ac14fd..1fbe48e55 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 2d4184fb2..3d3e1b4e4 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 323c3ca6f..b84c130aa 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 0ec49069e..3b97aedd1 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 a105ef7f2..c7fcbd9d9 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 27210bb09..ff2171233 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 bd25c22a2..3c9877e17 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 869725e7b..fafa2fa59 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 1576b0490..8649b6052 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 394758b27..60e6d43f5 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 19e42ab62..c6dae62f1 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 c57b4b9b6..8591b5062 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 7bc483d38..6f2f6e6d2 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 09adc8bd4..2607cf611 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 be8d442a6..bceca6457 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 df2f64c09..63f29ab3b 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 6bd0fec71..3ab27f475 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 5ea86daea..478f6fd4f 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 8476d261b..e06ed2e1c 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 28580e6e4..17730a1b8 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 1f7f3e3ed..caccbe9ff 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 9a89c08e9..6c52c5718 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 2f2aa21fb..d8fbf442a 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 41ed55afc..aace2d89f 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 4742b34ea..b0b07cbb3 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 c62a0024e..7f5d25dab 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 826a85d7e..48636bac6 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 0622136e5..e97001232 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 3a2bf59fa..81c8bf46a 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 f73acce6c..8dbdfa086 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 73b2da194..30b0e35e8 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 e52d7c576..299cf64c9 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 60a9b00c8..10341fe28 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 1d9f17cdc..19aa5e245 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 48f3254c5..4f1ebdba8 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 323c3ca6f..b84c130aa 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 83184f474..2ef392edc 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 2bc6cdcd2..294eda5f5 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 ed709f330..a7fbaa70a 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 68d015f5e..da7c972cf 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 d46c2005b..e20a395af 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 07a7a2990..ec7c5eda5 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 3c9185d60..deffdfb80 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 c5249110e..1a464b51f 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 c7865a098..5dae915da 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 4339b0d23..6e5f5c195 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 7a97be09c..bf9123ed1 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 709362d85..9ab870de2 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 1753f301f..0044eccb2 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 4358e423d..bac3c769c 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 37b43f2ce..8fe7b2ee9 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 0ca65b6cd..21769dd9f 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 753ed8fe9..11846cacf 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 fefddc55c..c411f1891 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 babca852c..478aaa43e 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 d53d9d182..5f00314e6 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 5ef68c601..af98c7154 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 b28fb96c4..a1acedb36 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 4d50012b4..39be02d58 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 96a0ca660..9f96b399f 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 a3832ad4c..4811c0bb2 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 a3977b631..21e40c99b 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 e2d3cbf2a..ef5b7fdce 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 99d9c60ea..e28cfbdee 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 b2f967b30..d501d2453 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 537b5bb26..9177359d7 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 846ed6f2f..1c6443ed3 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 a188f6820..d6fbbd67d 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 94ac8e04f..3122959d3 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 c7151bcc4..8e830fc8a 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 b104fbd13..c67e53e48 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 8860aaeaf..f15cf51c5 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 212a50f9d..de7a5e2de 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 4b741d9e1..91b515a82 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 d586df53d..10d72dee5 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 71bc97a35..7f5485088 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 5a190b3ca..0e5050f41 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 71c1909bc..8e975f6c4 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 222678a43..5b8aa52b2 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 2c021bbe6..2a95e1d74 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 5a6e93018..d77427720 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 fbf9e1769..6185459f5 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 057c6d332..d8eca8d93 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 7d5190908..951aceb56 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 f04aadebc..49f51f7f4 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 4fb3c0559..0aaf602b4 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 9035aff54..13ccbab29 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 e96d44f47..c0dd45fa0 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 3c846e901..7770caeac 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 15d1e7382..905b31ff1 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 586a3d53f..e040ff310 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 b5724daaa..939810785 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 4b16791ae..8a857f234 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 07321a43f..7fa950828 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 ce6011846..913bab173 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 8f5702a06..db82fcdb0 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 64bf4812a..f7fc8fa78 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 269d795c9..fd50957c5 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 46736de0c..1e19bff26 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 7c0512001..d3c4bbb0d 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 6f0d82850..4d770d941 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 46b827571..0bbb949c5 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 6367846fc..a09d4c017 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 d9aa738ed..3f4b6435a 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 dff4caa3b..1463f4b67 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 3c1f7dff0..f3ce9f77f 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 c5df245ea..60e56619c 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 1eec510be..6ae2b1869 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 26fa2884c..5eddb5778 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 92b0a4769..cdfad9723 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 1e3056352..51da0f6d2 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 a5d6349f9..b30d21a42 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 9513438b0..945566e5d 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 84028d063..e9a3c842e 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 b8978af2c..3cd4c9005 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 055d807b8..ce1a99fe3 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 6711c5f85..1d5218339 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 80f18519e..84c95aa92 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 af1477f5e..dcad5bfc8 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 6dab58fe1..f6560f124 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 4a51e050c..c32180838 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 550650eb3..355134905 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 83f6c7210..23d1e4ca6 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 d494e34dd..4f5c3d755 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 4e4402d50..9ca30007f 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 fc38749d5..43345c1cf 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 13fc65024..df51ceba5 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 ab9a2e3c7..810ab8e76 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 3b538938c..9e34f3497 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 aaeabb7d1..957397755 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 68ff003fd..b83385934 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 80b764d04..25dda0427 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 9afe84bc1..a6bf1e780 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 af1a2cc70..ff6060045 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 9b2adee52..7787f2954 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 f0a32dc85..9e41408d9 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 85af02b49..b9ddaf05c 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 0dc3aa1f5..1f95a1694 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 e026d2d16..28c76cadf 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 7a7697c42..da85c494f 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 da3057fb3..12fca9ab8 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 2ac420189..dd3912e8e 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 f90253181..d48c93701 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 d570ee125..b16d653d7 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 d8a464487..9daacd699 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 71810f4f9..9347975ff 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 025e8f42f..2aa988fa1 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 67ce94625..5c12983fb 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 c913a51f7..38a1e283b 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 7bbaddf2d..010d54d72 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 a56d401c4..4a6a0775a 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 48c1bb87f..e4bfc0ec8 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 975c5ce92..52893bb78 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 a62606183..75a1f1e93 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 5491ea066..c2b6c7d2b 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 3d1648409..8be2c5c3f 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 6a5cc29c5..a0ca5bca6 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 532dd0aa5..131c032b2 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 7622fe528..7aaaf931c 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 a945de715..4b37c2a10 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 9b527d51c..9ebce9673 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 d46668341..091ebded8 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 319e46c47..ff2ed31c2 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 26770f2b9..460d8a630 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 6c3a96215..9cbf65051 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 fb8339d1f..f8e0aa9d7 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 336c56fb5..166c513f9 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 7fd6fd8e6..8836f83c7 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 0027fc8cf..9ec3a6d12 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 60ac0a61c..dc36e188b 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 f07f5c7a7..9c34b8279 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 2f8ae9637..52a54b992 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 34201b251..dd70b6e98 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 16f123dc8..79ae7e7cb 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 65b58b716..25ef2827d 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 43b0219bc..90107cb28 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 55184c173..d4d16fc88 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 bb2c38768..429b008d0 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 0b9506116..a752c2fd0 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 e392359ae..3dd492c3d 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 a04f7243f..6167b1ff1 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 e3d544c62..9f1eaa82d 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 bbece179b..0a230aab4 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 dbac67b4a..d68d23eee 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 2a309fd49..b2367dec4 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 2c0a81dbf..0ed51e36b 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 b8e0e1a68..eb1099123 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 463da224e..f4eecb529 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 f67eb791b..074437185 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 0bf7dc6f0..f625e936b 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 ec2a001b2..1a668754c 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 0b3eec772..8812d0595 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 5de40421f..52eb6df63 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 728162f17..6ad5de05a 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 cb8d43cff..89c6baa3e 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 9f1f20a03..8335aca80 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 a6c1598df..c3d7ab305 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 30200d82c..63af86b90 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 d0ac8a0ec..56999ef7d 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 d7756988f..b84c130aa 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 445fdccec..4a71e98ca 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 155fd407f..6f282dee0 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 73058ced0..c79a7189f 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 e9fa34af6..7f20c4117 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 54bed7e05..d12aac995 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 86b7a9d85..857547ef6 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 d5abc171c..bcf1cf31b 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 1593fb0df..295a429d5 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 98a110a02..55b3238ab 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 4d79ef1c3..70b0bfaed 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 cd1fe1c24..3a8b6d1b0 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 17d24164d..637c0047f 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 bd25c22a2..3c9877e17 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 d39138076..506ccc9aa 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 d7756988f..b84c130aa 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 5d472bf00..731633f65 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 c585e4fdb..16107c61f 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 18805135a..b95eb8df4 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 793a9ca37..f95a831de 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 715ec4f85..9d1ce8495 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 eaecd668b..ff2c4cd3b 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 3cd068e45..c8784c505 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 90bcf6f97..8f9885e9f 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 fb77dea75..5e299e876 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 9fe24b001..32fd0f8cb 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 59d75aca4..467893c57 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 bec0575c6..a376839f9 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 c208fb5cb..406aaa26e 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 df95531b0..870ee6756 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 041c2381e..39012a6af 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 0e9dd2e6d..46c8a6335 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 fb129cd9c..371eaf725 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 85ae4f9e6..f3a766fe7 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 323c3ca6f..b84c130aa 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 d41002da3..4cad38f5f 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 16d0a8987..c5c0b0a45 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 ff38e0b5f..6c405c437 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 0cd899de5..e1866f4d2 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 85509617d..8d194f317 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 3dddb73b9..8e6cf2f50 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 d7756988f..b84c130aa 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 acf4fa3b8..8f7afd5a3 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 4880153cc..eb19f8f1f 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 659c6e74c..10f00d72d 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 5586ebbd2..480945028 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 d880cb669..206a92740 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 898eab712..da9b4fd23 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 f6916ff79..398bea22a 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 6ce7fb948..d0c4dcbdf 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 913222f5f..fb2670115 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 697fa2c76..529f278ed 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 f68226bce..ebe3694cb 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 81d0ce005..bf5f0b92e 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 d6365133e..15a0c870d 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 a5e20adbc..a0d71ede8 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 d8084b17e..cc34ba853 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 c7db47711..16d9de1d3 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 6708acd37..9f35887a3 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 ee34d6c6d..aef886a39 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 16ef8a417..505874853 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 eabc3ae84..18ca8ee30 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 ae64e0dc4..740294fa7 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 12487956e..afb57d801 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 c9d47e66b..147645105 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 b3ec47a76..7ca26c3e7 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 384b0c3f2..552c58d03 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 084d7594e..551c7dc33 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 7dca462a4..1423f009a 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 ed3511ea8..f284b2b13 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 510e8e1e6..c037330e2 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 42ffe3a85..09c585b57 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 a466855ee..1a2917f1f 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 daf809d8f..90bc5a0d3 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 7fefe09ff..cef9ff0a5 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 e2b9230a0..d1333d6c2 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 9a5e50440..0edb34c9a 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 0ce464729..502fe48bd 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 32acfe388..1dc2175c5 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 41c0066a6..9cc40b916 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 d56aff4af..e6faaac0e 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 40cd90bf2..dfe811d40 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 06faf7830..c582a661c 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 d6cc87833..80359b3c5 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 3c44ae776..41031b807 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 804c880e2..699c5cf13 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 d856b1e13..e999ead02 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 9e926f48f..526ddaab8 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 2bd1e3432..e4fde5765 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 ce9d74f97..65c424030 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 69bec0770..17bf1a2ca 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 6dc7ee38a..a5668853c 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 aa4592931..60cb9043e 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 5a35944fb..c2231b6e8 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 bb9338666..0bcd82a5c 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 94f61bc63..66d77548b 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 bb9338666..0bcd82a5c 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 233cb60e0..8a82e481e 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 5db50869a..0bcd82a5c 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 b4b881931..8be8dc20c 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 323c3ca6f..b84c130aa 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 0004c6a75..87c68a3d6 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 1b1627806..f040859ef 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 cf7a8b150..fe345f00d 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 c34676efd..28cef7111 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 2c3a83533..d6bbd217c 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 b26a3bd3e..c56679031 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 549acc531..c291c0fae 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 cabc7fdb1..f7dcc2e8a 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 b1ec4059f..73f5ab695 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 e3e252ff0..9aba97983 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 39e31885d..dbb60c079 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 c0c6188b4..8a5140e03 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 bdd848e1d..759b9f20f 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 5efac2718..49a5b2d1c 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 90bf4d8ed..271cee69a 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 8bb3a9abd..900a0bceb 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 b943aeba3..8a39e5e9f 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 328a7dd99..1e6a34273 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 59667588e..f168af11e 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 226f79667..a336aeab9 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 42ffe3a85..09c585b57 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 25d25d534..7709dee75 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 41934c19a..84c84a3ba 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 863d21ec4..ee898d277 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 8eb61c298..b753e6a30 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 867e11312..3dfb592f7 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 ed3c3c9c8..4db58d80a 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 a6ad74370..536283a73 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 a89f180a3..0b9c8b4da 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 8b0cdd556..1e6c4835a 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 b4bf2a84a..777369c51 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 0da755197..1327a051d 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 343cd4e06..a0a65bb67 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 4fbc912f1..cacd891bc 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 abbe8fc2a..3df7c8db5 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 d0c7113a0..341016898 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 b33bf2841..bfdab7f0a 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 8b2c58be9..dbac12cf4 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 348c0f274..19a640295 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 4b3455a9e..17c5ee70f 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 dac2198d0..25b207caa 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 1ebce09f9..3a770fef7 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 aeb0ffd0e..200d6d225 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 76cd99848..f74a19089 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 f1f7d69e8..8014590b9 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 c41fcefe5..a7ee231d0 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 75b6dc945..0933eb59d 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 02be74363..9803a4b6f 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 c3e23585f..3b1a57625 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 8bbc76d1c..c84e68023 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 d89454631..27b14da15 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 14597a162..b7a7b6677 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 d0c301ffc..5e7501a79 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 129566881..5f7ba7ef2 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 2027e34b8..180bdbb50 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 1b904f2d8..f2ce8a3cb 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 58021143b..ac8e403fd 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 00121e8fc..10996518c 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 912376a36..c4e3d96d4 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 e7f706fe9..5aa03896f 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 1c9fa39ce..f3e071cfb 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 e34f8c26b..f8e28ea92 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 f51b2123b..914878698 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 328171653..dd0ae4889 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 b6f67064c..3d1b53982 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 509b3bee6..b433771d1 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 720de968c..6326877ff 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 d1000769d..b655315bf 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 80d443044..280e38442 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 67101c421..a8e1c3f61 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 7162b570c..7f562e213 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 b61002418..74ed533fc 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 2995f0532..8b3e36779 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 7aa8cbf99..d203e3a25 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 de958e2e6..11abba62a 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 e1361a799..69d65707a 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 eb868e8f7..ff6325cf2 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 bc9de1afc..3c9877e17 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 ef86430f7..6c66d4f1e 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 75448fd44..388bd5446 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 498a19d9d..99aad48d1 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 914a8bd29..f0c4fae9b 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 be56843c1..8e12fa41b 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 7f3e4b955..df7b9bfee 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 0b134468f..6ccb03b76 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 323c3ca6f..b84c130aa 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 8e652a20f..3b711e32a 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 005e54c7c..278d52cf3 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 e4fcfeadb..cd224994e 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 26069db72..a62a3f5e1 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 a1e6e4148..c17992cb8 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 24324eaaf..ce10d89ad 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 0276165aa..b955ceb89 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 9e732de79..9ea0a4522 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 323c3ca6f..b84c130aa 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 0b9d14697..b9634b1a9 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 db5a944cd..890c7d05d 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 467f8ea3e..9b7485629 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 40599d8c1..5a5a375f6 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 7ffda32d4..6d5100e5c 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 a07e87de5..7fddc4a21 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 863a60317..e2d4264ba 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 d64ff9628..697b95cbd 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 6ca555786..4951f8a80 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 f6fc62813..e0393787a 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 787a77c58..55a2d8b80 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 d9d312e16..cd57ba05c 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 3a2886d51..1d64bf79b 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 da0c805a7..09d72d4e6 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 ad6ea6748..2d3745039 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 d7e9110a4..388de398b 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 8a72edb9f..b794ee51d 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 d38e76c48..8f32f718a 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 9a393dde6..2a73869aa 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 f568f88fd..1d79036a3 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 69bd6d2f7..aeb257dc6 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 086a1ff25..72955ecfe 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 4994a0272..52f483529 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 bb9338666..0bcd82a5c 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 c931f9a94..3967b5136 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 c772bba02..ab15edb6d 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 0e35b1194..a945b34e9 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 84b72e35b..a43bc2f55 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 602471cdd..8d52ec009 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 05bc02d89..ca3f669d7 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 7bcd1bfca..36b811c72 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 c0b52cc9e..bfb67f4af 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 99210833c..d76c1d18c 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 f9ff01f01..d990c6707 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 b3428a9bd..55afd8568 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 924e4499f..eee0f746e 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 73445484d..eaed7032a 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 43384b2a0..9d8677fa1 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 d9d312e16..cd57ba05c 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 de03d5e62..7293e1b6a 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 4d8ca88b0..d094047d3 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 8e4c2d151..eea2a1e71 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 a3c07644d..44771e9f6 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 1ba0ab1cd..ced85d7aa 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 fe588c567..7f3a13942 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 df89ff1e7..554f9312c 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 33d043323..a1eb78ac2 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 2fb5aa865..24de8cf60 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 7085099a7..9ee728e52 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 010da5c28..25c9c2e9a 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 f0e50e36b..23d00f49e 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 38105b503..de6203069 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 859b11bd4..fae8f19fe 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 e730a4338..e74caaace 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 214d99159..9495645f7 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 5864ba990..993f10b5d 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 cf93ad55b..38a01318c 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 1787a9d52..2e9264acb 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 35a6c5d36..049b7e943 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 0e6a6b7ac..4cc0fd443 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 7f4ba2985..b4779feaf 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 09374d834..7e8803ba6 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 ff8832e95..fb3536651 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 c7874d303..0624a076f 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 bb615ead6..310cd5b9d 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 f54c509e0..6f45ba54b 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 766340e99..240999c40 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 7f38440e0..8dbb49c65 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 ac0ad4638..454f9c7c6 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 43285a042..70e56cdac 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 105f33a68..295d44a0c 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 5ea30b99b..88b4fc1b3 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 3821585a5..9ce1cdeed 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 768598ae2..f00c5a571 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 03f7dc959..a4c75e439 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 32a30eb2e..8c3856826 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 8d94e46e3..12883c472 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 986b27368..d1c6844df 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 ad9cda1ca..371949514 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 fa7acfdd2..999fb13dd 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 1c10f0359..bf91ba9d7 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 403a01718..d968098c3 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 cc5cfa4b7..ad229909c 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 f326f3aa6..da5705399 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 4794c7323..296e1908d 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 cea772666..85514cc7c 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 72c245939..a71ae8b54 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 1353c16bf..0e9d6f8ab 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 f0db73ace..57c059f1e 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 3a5dd943c..5876eb541 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 fd3198d29..d54a4959d 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 a8b088bce..f50ec4559 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 a43044463..87d84957e 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 d106f70c6..833ea3a00 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 f26663990..27b970254 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 d7756988f..b84c130aa 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 7de9f745a..2643565da 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 5f1d502c4..fabfac1a6 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 a5fac5501..5a448fbbb 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 dd8838380..dcbfc63ae 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 91523f45f..f04cac51a 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 d8e1d604c..4c56d1f11 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 4e3e6a852..4021c58cd 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 dc277d874..8993a9198 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 bd34163d2..ab0046c3a 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 416552604..423de4409 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 8815778e7..ce0c0d8d1 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 5dd0a36fb..b16bca015 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 4407067cc..761be76b2 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 2510d8a0d..cbd166077 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 d61b28d20..6504c45b1 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 b7f41033b..03a8d21eb 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 d2246041b..9dfb05f32 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 993b6040d..6e32dfdd0 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 9cb27418d..c9c9f4f7c 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 6d85e714f..0d8d6697d 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 2aa0026b5..a528645a7 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 950d6cf1b..7c3f12b7d 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 0d0cee6a6..1c1f4a67e 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 944c0ba37..20adad212 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 b2405a953..c66f035b0 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 27850a08c..eb19f8f1f 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 3419ec3b0..73b49a791 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 98b9d289d..111e0a14e 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 95c136bb0..3cff70d5d 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 73d18a461..29f50165e 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 3dfaca70d..3eef70e55 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 5efc66214..1aeaf0ba3 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 ba8a42e6a..681d54aeb 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 aab268535..5888f89f2 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 c74659797..0998400cd 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 8c6bcf4ca..0ee4e4202 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 3c820d233..59ff81f8b 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 b216c24f6..24adcc55a 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 c24f41f3b..21b5cdb80 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 0d4dc4520..b89752c36 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 19a93b31c..54b52e52f 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 186e2329c..4bfa1f771 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 0db406f5c..930ca90f0 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 9079e8569..86776bc11 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 137c58498..9b57beb2e 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 94e58c83a..ec7c5eda5 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 04719df4a..4cb5d270d 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 2730e59e5..4ab9c9bb8 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 cfb6ef68a..18e7046bb 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 fd52b670e..0f6175ef6 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 f2abb29bf..8cefbbf66 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 94990ccf4..09ccc44f4 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 a5490e1c0..0011c4977 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 4a28b6460..aa03eed96 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 c856a1aec..aeccb06f5 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 b437231e2..a7fbaa70a 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 d632608ee..9debc6270 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 ae4869f5c..04060dd3e 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 ecb9465f8..d8c52182f 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 7986d1495..042bfa052 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 092ba654d..c25af847d 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 8abdc7337..ce0d14036 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 a43119c2f..fd57823ac 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 463e70a23..fb2c5df68 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 6ea9e73a1..3e16705b5 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 84b333310..bf1711a7b 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 3f6061550..41a444618 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 6f2156b5e..12847871e 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 e0e8623f1..d7585fccf 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 3c06812cf..ff8ff1bd4 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 e42d177a4..dd197da45 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 c739377c9..f96dce2a0 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 42f203456..7994940ca 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 b390edcae..15dc929d7 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 06e6f6c8d..52c662253 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 5db50869a..0bcd82a5c 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 d075ffa39..1b921cbe6 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 7d8737f25..43245151b 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 bdd9e9b82..1200aa075 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 4d3b1e694..c79f907ed 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 42ffe3a85..09c585b57 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 3f0c63123..666788273 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 9683e0ee2..7531e70e8 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 3eac4ca2b..c6e4965a3 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 9a19610ce..565482ed4 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 5e097ebe7..565d1138b 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 3225cec17..5962287aa 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 5420ccf21..a08dfd324 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 7a11a616c..f0d6f1d4d 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 cd97eb99c..a575ad3c9 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 89055b0f3..47652a6b5 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 e532ed03a..997113cbf 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 b0821f4c7..d23fc937b 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 24002efbf..33075c5d6 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 52bece7da..f5d966840 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 d37c1d186..23a701b1b 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 19c7b19ae..db106b1d8 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 a37828a8f..4f183c220 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 768343786..2ec1e3634 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 37e81bb65..66d6fee63 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 3c4e86572..481c24fce 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 67e163602..d98a0835e 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 206f3ee0b..0ef0ee66b 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 fee6a1170..58af9bba4 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 7a93b6c63..69d8012bd 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 e406c6fe5..1b72b24f2 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 64bb016fe..3dfcd3020 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 ace037211..433c7db77 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 36453e66b..1f76acda1 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 5cc9d102b..b6b96e526 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 5387f1e0b..8ae7869b6 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 2f51ac513..c438ca00a 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 437cd7e84..76041c6f4 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 b9ab9aa9e..29b356141 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 327e96625..fa5ef5d51 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 63da1a231..0c0d9006d 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 4d45c464a..f0cd8acbe 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 7a32d7ce0..978671fe0 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 f50d05f77..a8d94b977 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 284459c77..2eb1dc9d4 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 0eb02ba2d..dd852d9fc 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 3f32db02c..0daea2e8c 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 077797fca..c48620bee 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 cf1594052..ff5b32ca6 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 cf6250930..861239182 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 88730bf24..607e372d2 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 fddc7d1b6..735385dc2 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 a3b3eba39..b5eefcbcc 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 24d814aa3..d688f0aca 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 ba8b16c5a..aecebc81e 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 37d5a09c2..5638a7979 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 5f9144201..dd304b67b 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 5e1770a9a..30125c243 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 ee60aaf81..5130adc76 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 2939f3500..fbf09e5c5 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 a7703083d..02f90e5f1 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 c86cd5ec1..4b6d2be02 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 d3e364c96..425afe200 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 9e6b8210c..6b5cc5747 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 d7928c9f2..9e26b6b5a 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 a066f81f7..c71213e05 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 848bae446..c80cdc326 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 14299837d..bea475a12 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 cfc92cc98..0c9af6846 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 9a8584a4f..a8e9cde48 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 2fb44da0e..81716427b 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 6ddada6d5..5891cf22d 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 3797d2650..a05c89797 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 fbb4b8030..5421415a9 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 b6d9cd65a..edcaa6eb9 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 2f82924a3..8b9944493 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 34eba4f22..e2f6c05fe 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 07a7a2990..ec7c5eda5 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 b35e2672d..97483a177 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 97249a4a0..e9d193c7e 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 526f5f712..0e0e0ffc5 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 91eceaebd..a3debb221 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 0fdb70b8a..b18930ab7 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 b4f0f92b5..367f97d1a 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 c6117e06a..d0561bc26 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 2cf26bb0d..1413a1b85 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 285e83ab2..6c72d7106 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 7b13ca732..49c4e708d 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 0cd80a561..ca5abb567 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 b05c7ce78..4c7c594bf 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 0022ae199..8651158c9 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 f4918d400..dad96f3e5 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 8808e3980..9e5f177ce 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 d926f5e0b..a54a67ec6 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 6bc2289ac..d43028269 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 278f37906..21f3856be 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 721528bd6..83fac1471 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 658bd725b..57dbb82f8 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 b51494899..fccbe3a58 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 e824551f0..c32cf8580 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 24a47bb2c..da5910733 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 1a184da05..af0da5c97 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 42df73db6..8cadc6c4d 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 f38902449..0e2ddd5b6 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 e3dfd883c..6ceebb8c0 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 4e2747588..62dffd95e 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 5c8a66ba1..6203133c5 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 d9d2afe28..ded4cbf4d 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 0f5f92513..d2c2ca54b 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 4332307d1..493099a75 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 3a18a40c3..f9fdd7817 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 7430009c9..78b5f14cb 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 0fe544d7e..3562246b2 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 fed877ec9..43effeb1c 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 b7f998ea6..7c2de61db 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 e3f5e07f9..57ac3a6a7 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 050a2ebb0..4b21a81b5 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 d7adb1991..973a0f8bc 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 cb1deeb9f..1cb3a50b4 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 e1fa71959..79a0dfccd 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 a44901330..160ae620f 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 9a354e46a..3fa4d3e73 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 7148520c8..c20cdcb03 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 fa68f6c00..7b23bc66c 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 bc60719b9..fa93efb97 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 49f9cbc2a..29ecd76ca 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 29ff0a9e7..2256d71d4 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 be7fda7fb..ab020ddeb 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 d4262c319..e3f3554cb 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 61646d40d..4ce3c5523 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 af02d036a..719fe8e08 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 e6e183928..8bd5fb4f1 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 7a8a6f8c7..6e3ac8cd1 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 9a8f7770a..e4c9d54ec 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 2e555b3a2..61300f6d2 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 ae35918b4..c63105b22 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 ff3396d61..7dc05b207 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 9411645bc..c4223ab36 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 c256c419c..84d35e380 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 ca342afb7..80cefced5 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 08a50d649..24890d933 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 5fb0f9a87..925a7f671 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 4882793b0..13a84ed64 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 abea838cb..fc96d8fe0 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 5871b9759..a5c0cd0ef 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 23bceca5f..b4a4f2583 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 9618915d0..41ab69ffc 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 84148af75..d3cd4faa5 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 89e1f9864..61a919031 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 19abba14d..6b11823f5 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 e224e7aad..66109a201 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 bb482dd58..10a717a5d 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 6383638a8..eba6d5366 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 c57b4b9b6..8591b5062 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 5ef1e43b3..ff7db76c0 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 de87b5267..c79f907ed 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 a90c32395..dfc9b79ea 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 7ef289f86..b850a6c37 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 e5dd4a1a8..12245e99c 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 390d9404f..e91487e3f 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 76c8b2e67..038737f10 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 ace1433b9..e2f6d76d3 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 d690e89e0..4271527cc 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 8b09b1efd..2d7a70a21 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 e03a81d1a..b9f5c8ad5 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 87f5571d9..1cc16a91f 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 66bba2758..34d1558ee 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 ac28bed7f..90c912bfb 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 c300534be..ffd73aeb6 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 97aa62894..5ef5a762a 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 f2eb2cc11..fc17bcc69 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 0d888053b..fd0f19b94 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 0d5654bd3..8ad67fecf 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 8c1be8edc..18f2af226 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 c05ba4abe..3367aab42 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 bb9338666..0bcd82a5c 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 a31ea6ecc..a697868a9 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 869d3e386..a3db5318d 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 1e2f18541..7811c54a7 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 8ff3505de..80088f700 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 53168ee8b..478f6624e 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 36b81c793..06bc5620c 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 5db50869a..0bcd82a5c 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 222e201d3..8889441bb 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 bb9338666..0bcd82a5c 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 349878f09..808c6e7b3 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 ca3a91f60..14a454575 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 53ac512cf..409c00c5b 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 b8cac1f13..a802b49c3 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 eb24af94e..6d6acb599 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 f0e3584a1..e669290e3 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 2e284ad82..4a21404ed 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 131b84b6d..e892c0f35 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 22891612f..cd2f44358 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 a372dae05..aea58bea5 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 b5d2239db..1a029804c 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 e8801ca2c..ac107baaf 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 4fb2a0e18..cd7e499d1 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 a4d846fb3..572dacb8c 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 a7bcf9b79..c363505fd 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 b2db07200..d37488c74 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 e22b2b4ba..243cccc7d 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 999149f4f..bc1837ad2 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 ded9bad7a..944b920ea 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 d2cb84c8e..2397a9880 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 26cb29ebe..e93a2f2cc 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 3066088f9..61bbd78bd 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 209cbac94..6ca7e0685 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 2963f47ef..1cc71ddb0 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 6df738fba..f31e23b84 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 438bc4c43..d92e4cf40 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 ce0b894aa..b624ebaf4 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 c4f948cd9..077f060ae 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 b1c774696..f74be80b9 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 dfac4ae0d..289e80afe 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 44d84f544..cea838f26 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 cf045af09..254254ed4 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 f46f5d44c..a5a5398d8 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 fabb8da76..3d4568e08 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 74756a2e8..016eba827 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 e4de3045c..1791ad018 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 1f2cd5a81..d389d0913 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 d2a44ad2c..5152f0ae5 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 e2d52a407..83b9dae97 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 9d3992003..fc640401c 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 72d58adc8..49fd89909 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 f3ad44fc2..01caf4250 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 635440384..1b3d4a031 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 1bcb74bad..2f4b6036d 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 f23ddaad7..542a85d08 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 b63acb9da..f83778c50 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 66279212b..60721aeaa 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 ffc587c8c..f1ffdd8d1 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 452790720..6d2776bed 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 db1aa3850..7b2b26ed2 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 bdd35cd3d..12c515b0c 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 53e0d6300..012dd5742 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 808a6b124..a7f731575 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 98d9256e0..fc61eee2d 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 d43890aa9..6a5351309 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 64e8cf65b..df876e9db 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 e98e1e4e8..f15cf51c5 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 c0dfe1626..d39a3ea32 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 c6068ed3f..6ef3ea6fc 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 ca738d4c1..bd331e19b 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 36eb2ec13..ea4a1889e 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 3a5dd943c..5876eb541 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 74446acf3..075cde938 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 0f3849382..dd3cc884a 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 2e71eaa67..02867e685 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 5c954e3a1..abc05ba3c 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 11c34fe7b..02ecdd277 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 c81dd2c4e..20c0c91a1 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 bb9338666..0bcd82a5c 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 c7a07eceb..66dd17fe2 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 bfb28d49a..adf2083a8 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 1c101144e..65103a5e9 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 97a07d0d5..95b2f653b 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 6bb653e14..64bc54b42 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 186d2ada9..2ae9e21cb 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 d87bba475..4e1686e35 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 c692f4aa7..5a5811659 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 bb9338666..0bcd82a5c 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 825410517..df61739a6 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 51e80cc46..dbf21204d 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 42771af94..c510b54c7 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 9e8a81a21..108e3f1e8 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 22bddfc7e..d5e7ea3c4 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 ff7a74a2c..3f02e824a 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 edb52a405..59d050e64 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 b09bac393..13d6c8992 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 1cd31f2e0..1caac6bd0 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 85081c629..5ea6da459 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 c5b821df7..e45248836 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 77f8f3ce8..06ee6d497 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 fd31633e2..e72f13ee1 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 9596e9466..b92ce5582 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 a614bfbaa..ab8322ad5 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 e8c047035..396f3bec8 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 e3b7fb23c..52fe50d3d 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 a13837017..c3c9f6ab4 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 2fbb27730..b64c8476a 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 83c8cc211..c551fcfe7 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 e503e6ee3..8a5227ee2 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 698a183cf..040c52ab6 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 b0a0eb7fb..4fcd01411 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 deb421fff..c8dd5971f 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 46c098c09..ced9f9985 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 a860e8b70..065314a1b 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 0418a3ce4..7a5bd4d02 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 bb9338666..0bcd82a5c 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 da77c1e5d..7588cd42d 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 d277a97ed..2adfd5a2f 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 14d65b9fd..1d3d28671 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 cef2597f1..5e409bb57 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 b3da834d8..6175a6e71 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 57bb707c7..66fb4efbc 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 b8f30195c..67244d78a 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 ff2b4451d..d8c7565fa 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 c6fa09e4c..f6020b6a0 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 86c4d1c4e..c60cd495c 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 aad47c04a..1f31ccc95 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 63ac6195c..10cfa6114 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 55ee68085..5b7699cbb 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 a2d717a70..2b0f14dc0 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 60d3932e9..632215068 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 d4c6b5667..803dcdb32 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 280da4ea7..e411b2bc9 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 c1f8cb0ab..b7c14ea5c 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 e9b7f615a..e2177177e 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 0594892d8..96e56baa2 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 be82bb47c..26948cd0b 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 e3c95b6d9..5482efef2 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 b1a728ef2..113f51ecf 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 095654ecc..27a20410b 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 7bedb0398..1362ea35a 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 c86dc3b29..85091c3c0 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 6e50f5879..c8574de0d 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 9a618855a..c741c5f28 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 fde04df4f..e52fca04e 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 8495d1e3a..c94e3d90c 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 4e3d54e35..82c04add2 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 213bf81c5..e172d9ba2 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 19a26c630..3d2e25fc1 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 049d00b08..5dfdf8ee3 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 583b28389..ff85d1abd 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 d6e470475..a4142a1a7 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 a6b38fc6a..0bcb9439d 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 94e58c83a..ec7c5eda5 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 189215aaa..d74d623d2 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 b79885e16..fb223e8b1 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 f4bfd9081..bfa010c21 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 d4fdc9516..46410d3d1 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 21022789c..7c9c128e1 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 b68d96e03..1f035eaee 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 2047a87ca..f055a2dee 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 04ef7506a..31539db21 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 e51e0daff..dfa98abf2 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 7711288c7..2c24e6156 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 e1b9a5f32..1fbe2d7ed 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 823c99a57..9667b0b3c 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 d2b32b0a9..078dfbde5 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 35c2b03e3..1581c1c5c 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 0fb7d624b..ea7f3d6f3 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 2ef9b05da..2b85d3b87 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 7619e6104..4aa10bfd6 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 23d692746..8c3ebbb76 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 da43c5a16..5cc704c12 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 ec0f02cab..4568984b0 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 2199c91ec..5e2ff6836 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 c721ff453..c8119a8a9 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 1a99dc9c3..03da70928 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 ac217ad5a..3b6c5f1c3 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 2c3a8e391..da2caff13 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 c04bc0b2f..8aff1a5f9 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 be82f2ed8..5c218bb8b 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 033afe10c..d44419d43 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 15d2023c5..55433aef5 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 7a684b506..65448c4ba 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 f8fe85528..7c36fa37d 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 91668931e..f1e32b9db 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 8f3bc9b1d..86956860c 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 8e22bebb8..7e0c6dc94 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 5cd70a5a1..48a0218cf 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 286b7a4db..e09c30bdb 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 ed2232988..1671cc9ff 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 3ccac38d3..5a58f69ce 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 8f10769e0..bc787602c 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 290125e95..83a87bd24 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 5c58d4ebf..bfafdb4b4 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 608d11f4b..9585dba88 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 d57531cb9..17187c37e 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 03cbf3c18..b4744aa80 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 b9db319ae..aa0b759f0 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 92bf85110..ba30f0181 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 ab62fe1fe..5ee986836 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 5935ea0aa..b2a995f06 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 90a29f9b3..872c7309c 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 f1e3b88d6..cb6660b00 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 c4cf0820f..839a2b9db 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 8c547e5b3..90dfef9a4 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 1f4e55f0b..a9543e13e 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 c5c7ddd67..56fc7e2cc 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 5070c2742..86544838f 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 e0f9f91f1..d9bd21e54 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 8d78f94f3..191f9459e 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 5ab89a85c..e250f049a 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 9187a20a8..ebf7fe86d 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 1439882fe..13eb91b1e 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 5372eaada..53b983c16 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 d52c90968..f2c54c29d 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 22f248188..0866a9d13 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 84f0cafe9..5e2d2f17a 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 07713a26e..4e515c640 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 9f4eb01cb..b7cb56df5 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 ce7573588..b6977a7a7 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 1a21bea46..5ac13030c 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 1c7097ca6..ec258d923 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 a8b713666..449f046a9 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 28a25bc8c..77d15e6f5 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 d21a34d53..b1fde7304 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 0f4e260ad..deec272d2 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 c4336285c..d8324ea27 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 1a87966b7..6143b8556 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 bc9de1afc..3c9877e17 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 2da0e7e61..b3f0ff224 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 1de56ebf0..d726e61d9 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 1347bebfd..391b9314b 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 3b516e8a1..d61db06e6 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 b4ef832b4..fcac0aef3 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 05e34b6f5..6a519630f 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 9cbee4788..33fc38e25 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 e74a37203..e661601bc 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 ef4ea1eb6..07ff8e722 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 4d3b1e694..c79f907ed 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 aa038c2c3..aaf8a876e 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 65d4ae11c..5092b66e2 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 fe01fc3d4..877fd72fe 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 aab2bb047..b0dac120b 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 e7bc4b1a2..c2e1ef675 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 e85762c09..4ab3a3417 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 7f2803ba7..ddc7db6d0 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 c5c6220bb..26dc16c7c 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 b8db5816f..d36ca5ce2 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 ec0b792e3..b6add5e08 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 ae3774446..12824e087 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 ae32edf2d..c2062f29f 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 b544fb3f4..3cfd941f4 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 fdadf6988..949c8fcff 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 26839b1fd..89f329927 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 8c869d1f4..bf761ffdc 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 92d977112..528558e57 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 6caf6af1a..ba50ff5b7 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 ffd459ef0..7d181856f 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 fa6d0dccb..368bf9b05 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 30b73ae13..553db0cf9 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 5e30597b8..b68af541d 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 5ef2431c2..281b92222 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 d43d21627..d012344d3 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 d92d0161b..6d7cb82d2 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 2755098ed..30beb1cc9 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 300d71c25..66cc99ef5 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 255cb332e..84f648516 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 8a9c1503c..b99c746b4 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 593388bb0..93f7b3949 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 a94b89a0b..10eab9dda 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 5c89b5190..cffd8f2de 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 203b11bd7..cebd17566 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 e745b3efa..15ca73957 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 b6b7483b3..4823c2dc9 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 7e561d52f..b6757400a 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 13a5d5176..8f1a40b67 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 befb7acb0..c239f63c3 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 a38f47f03..1899ea143 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 c639041e5..2ce60784c 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 d05cbc288..100dfd777 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 e262625ab..47a09d3b7 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 c6ccc0a28..68df88d48 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 cc40ac425..dfe478caa 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 d17e40ace..6a66bc46e 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 6b23712b4..6f2aa9bc4 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 5b3fc8f41..f89770363 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 1feb8eafc..a7ac0aa6b 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 84b47cb10..485a8765f 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 9fd4c80f3..f56e6903e 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 065e0b039..0a5493c46 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 335be9d9e..6d90d6ff6 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 0bbad6e79..f2a5f687b 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 20e7c7d84..c2497aeeb 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 ed709f330..a7fbaa70a 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 c0ce13df8..8ca5947d5 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 3a9269ade..d602de786 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 97e20b018..5673f37e1 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 bff58000d..0f90eadef 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 7a7ef2634..8c4f03e0d 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 2e05417ba..84b464161 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 3525dffd9..43b7092e0 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 754322f55..5837f6cb5 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 5b1a0dfec..42a0bc025 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 73b725b64..3a75a2ed2 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 9f6afb29a..132adfabd 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 3efa06de3..8ae9e6487 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 325ee54ed..7ef4927fa 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 0c7cf5587..3ebb95ead 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 a8b1c9297..9c2a2543a 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 0b39decd0..1860b96aa 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 ea5791c9f..67d5c14aa 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 7a8f7fb59..1bb0df581 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 ef24d57c8..e68638645 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 4afd87f1b..e5c12571a 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 fff412930..e825db5a8 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 8ecfd30b1..ffe010782 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 e5d3d766a..1ab8ed2a5 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 5d06a217f..36584bd4c 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 a0ecf3fec..5536e1565 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 d90e4c08d..000c03b4c 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 c71d8147b..a442ba56e 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 d1b12c0d8..2c15a1355 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 3004da393..cf54e6407 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 59d81501c..511d4da78 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 ace5db701..d425d4872 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 df065757c..93dbd5750 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 d8bc65896..dfe720b83 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 0da532df2..7b109b8f1 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 894a582c3..fb436b2d8 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 20a558913..1575454cf 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 52b6c4159..0a4386214 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 3845eb5d9..5175c2994 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 ca80203f8..083b6fa0c 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 a4f0a062e..d0e6970f8 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 71d8b0fed..ecb251ac4 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 40e29526b..7d934c69b 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 0b724ed49..08b64c5ce 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 42ffe3a85..09c585b57 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 d6a7e1de2..2b90bced9 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 6c1cd3fe5..33499e8ce 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 0220921cb..cc256338b 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 134711b76..06471a608 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 aa2fa3ab9..36278fc14 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 f2052ad7c..29e7d026b 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 6467630d4..586013ed0 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 555f3ac60..6cd0a5a6a 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 0b12f1669..84e35c94b 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 68cb201c9..23efc96e0 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 a46c1a019..83ffd0cdd 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 42cad5bbe..d91730e8b 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 ba90f95b3..1635d1d4f 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 d716db740..7a0a5d655 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 4dd9a40b4..5cadad72b 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 c9483cca7..05bf2e74e 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 d285fe97d..b421d6a66 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 f7b23518a..44e01072e 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 2f0744625..578543abe 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 f1a4bcc1f..26822698d 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 c35fd6bbd..b24e24487 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 bc9de1afc..3c9877e17 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 45858b034..c582a661c 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 92a5907aa..bf21e53d1 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 5c83a1351..51bc1a0ee 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 36bc34aee..4651511fa 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 28df49fc4..c25f1f618 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 4e6adc974..02fe3d451 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 bec172319..9123f3b82 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 2bfe62b84..dde7b7080 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 9fb4fd1f2..206c6b9e1 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 91d18f6af..017040b30 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 8ccc49e3d..a78a929cc 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 2efa02d0a..c5bfb1e04 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 97836256a..210061d84 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 6bcd2718b..08fa6ceaa 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 d47a97c8b..2613e2280 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 80cffe3b1..3a46a9927 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 3900e395c..bf657de15 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 65698aa1f..b32fb1f11 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 64aa39773..9a6bffbbb 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 7a4ffd72f..164278fb4 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 0b0f7a85d..cd8b4742b 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 26ff0170f..154405601 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 bc9de1afc..3c9877e17 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 70a487131..d4cfa6792 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 3b0fa14bf..b6bd78b6d 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 c673847cb..926e6fa0b 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 0dc2227bf..1a49816ea 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 9174b8479..0b591ce95 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 34accb7f9..30c5f8e38 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 37b75fabd..a1018f4d4 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 f3ee20f77..cd36a2a6e 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 f15d5d333..98476f1f9 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 02ebe0efe..867f3c882 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 e6662c6a1..685b433ed 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 5b4c9660c..2f4daaf10 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 2e93a8c1e..34b00bf6d 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 fd9ba1d40..09687ce21 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 d35843a4e..c47412e67 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 1939e9dae..8d88c1560 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 897058c8c..f1f70e0e6 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 23787e85c..d5ed7f4eb 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 cf03ea449..8d10a6f3b 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 d486d2c17..ed714aa8f 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 8e1bc0f39..dc4c588f1 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 d40d26fbe..6d64549cf 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 f23ddaad7..542a85d08 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 6b425931e..2645a18ce 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 07a7a2990..ec7c5eda5 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 f4c79be13..f3e32c73c 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 30dcc8b25..050980f82 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 c93f0e33b..14797cace 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 6727a021c..e863215c1 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 e67500d69..3d5265dde 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 3c1f323ea..d0d92f1c1 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 f7bd183d6..919335c80 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 a64a3b102..2df802162 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 dd4e0b33c..fc39d0e26 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 e169f496b..d54f069de 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 12dc5233e..313cae3db 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 b1bfb61ff..473d1e169 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 d33189cbd..50d69a6db 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 78909cb30..527c6ad1d 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 caac932c3..fd303a0c7 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 483f337f8..18aa5a623 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 cac2ff0f1..1d8a9de9e 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 b61002418..74ed533fc 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 12bc6bdb3..fd0b6de8d 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 87213a906..74ed533fc 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 7e223f106..f93afaf08 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 dd748664d..7a9858a93 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 42d98aa5b..36d8c1059 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 60471bea9..19703281f 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 a05d68c5d..d845d5f43 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 8c11b31c9..7ca03a24c 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 1f4e4533d..05192b024 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 37b4349f5..855416e9f 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 dfbb471ce..ee6ce6877 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 d45216215..2e05629ac 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 4a7bb731f..804319d2a 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 7d2d8b7ea..1c11d39d5 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 b290e4478..3fc1fec74 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 57a27331d..e51bb20a6 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 4580042e0..d71b6870b 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 b277d5997..8a1996760 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 7587a37e9..64b0319be 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 d7756988f..b84c130aa 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 cca99a372..db66760a3 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 631bc5b68..9d3f900c8 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 53690f69e..aefd7e0a2 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 74f53423e..747da842c 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 243394985..6b687169a 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 341530591..6aefc032e 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 78109abc5..2213dac1e 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 b458c2fa3..8204b6f66 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 c3c097f66..b1b3fc277 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 7090ca529..8b52d6ff2 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 fcebef04e..697b95cbd 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 420520484..aa9e0d6c0 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 6d88b77e8..e591369dd 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 2efa76ca1..a9039829f 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 344a191dc..a4bdfe3bf 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 f1d3e64aa..c83540057 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 0c1d55959..e68be85e4 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 71b22634c..d242b9ffe 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 936fcb687..3e1602cde 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 06e0aa59a..93410ef37 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 012eae3fa..760007a32 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 48862b0f0..fbe01a2d7 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 5e51baf3e..520927853 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 6e81c22e9..5b0be5e7a 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 b7ea372f6..34d116eb1 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 45127ce4d..818aef1c7 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 ebfef0f14..7724b8feb 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 d39d9e296..87fb6e33d 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 5984b5639..91db71e61 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 ef2d75f90..109201637 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 6cff1e548..0b679cf00 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 37749e042..0ee1d89c5 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 0b1df8079..4d8b82f38 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 1b8ef5503..482454a33 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 d4143c472..9d3444e4d 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 77998f6e3..5afc7dc5d 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 bc355fc08..9bb955a17 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 87f1ecef7..87e983cff 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 49d8a6c78..8eda3f971 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 5d4eefdc4..fa2a5250c 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 2506d4014..82d438e8c 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 eb558dca1..49f2ac85d 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 e51016ca9..59494d73c 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 607453aa1..b2d990265 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 90090d76d..9c69a9e50 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 a2713f6da..8bc20073b 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 7a841e088..bb737212e 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 8dd5b096e..98134845b 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 ad9a51e3f..9f840498b 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 5d86ce749..74ac3f8eb 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 034a3726b..3c346ff8b 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 40c416953..0bde67f48 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 386b59009..722a65337 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 fe0396afd..a5def11c9 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 fb6bcb420..a338f3b18 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 d7921d23f..b0781951a 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 539aeff91..1c2756e6a 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 95742e082..510089aaf 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 70d97e750..a105b9f54 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 ccdcb470b..3c7af34ee 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 e98fd14b0..4cef4c2e8 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 2b931a24e..92e478c84 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 997f340e8..c4e549275 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 1762d8efc..5b9440440 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 63454f2c6..7026d3b4d 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 c681eb7b7..abb7634e3 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 c21533434..b9a93d117 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 e716f6047..b4ba161d6 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 125bb2cc3..91452f7f4 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 68de9f424..4d029b257 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 8e96c204b..8dce8942f 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 a0afcfa30..f4df43ec4 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 7f1fa9264..16db6bc98 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 df1272e33..7006cd4fa 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 e36cf95ff..e791b8b3a 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 17eaf697b..e770d7535 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 56cadfcd4..ed09f72d1 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 068e1d88f..3122134d4 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 51971cceb..749723429 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 9ec671b25..f725a95de 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 ddda6b1b7..7041e18f8 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 a0315104a..58b502278 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 302c0debb..02744641b 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 719ff3ff9..0b1ccb830 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 9aa1e2697..9315f80fe 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 39dfde15a..06ef5bc75 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 03def4ae1..951f253e8 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 c0574b829..0fd30cf9d 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 1a721b9b5..9fcd76423 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 2a9eab9a5..366423adb 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 16295527b..a56359d66 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 5c6cfe4f6..4d38ae01a 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 cc202f408..ada03ff2f 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 51f403cb5..a23e92262 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 19122b5f3..757c9e492 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 d4fdc9516..46410d3d1 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 0d08a56ef..3c61d0cad 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 bb9338666..0bcd82a5c 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 59c5266c1..2e932d8a9 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 2e3f1e669..c4f6d20c5 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 37b8155e8..0007ce604 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 665ad4b0d..383cae806 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 201586fa5..8957cc10e 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 f11f2fcb8..e033bffe9 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 ce44237af..151935db5 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 c039b55da..c60b89e14 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 e9a8d7c51..119388dd6 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 7efcf075a..4fb5f8d2b 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 64b6dd359..f1f031a95 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 1c2bb2027..dd0c9ca54 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 0dc3963f0..cc284c6f1 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 6f2a502e7..cf84b1e27 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 28fdc0e8e..570ab1677 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 82b71578b..ba9e164e5 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 77a0a1236..742a89106 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 ae23232c9..aa08f9e03 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 453ac52d4..330fc3569 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 0918b8b22..18e6159ff 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 6908a1f52..fa9ef6356 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 8f6ddcdf4..7f3d9721c 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 0da1e5ddb..1dfaf4d85 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 fb1a4d2fd..d0853b60c 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 e42305c85..5035632ab 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 8fa3d21ef..38d28718f 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 124fb3df7..6eb0545d9 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 56623e598..acf01c343 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 9b01cecba..15a5a2c8b 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 5f088745c..38c1e21bd 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 213b2de01..f52953765 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 456bb7e89..5f3a337fc 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 3f8e1b654..bb3e7971e 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 31485062c..1faa752d4 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 66696ee97..2d3718243 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 323c3ca6f..b84c130aa 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 a3e119104..deaed62e8 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 6fe097f59..0b74ca1db 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 7b1d16f2b..da96d503a 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 d5252c650..f2ac1e627 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 7f14f14b8..8bb350dbd 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 2f2dd4203..5b63e9fa9 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 bece6dc01..37e524f0b 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 5db50869a..0bcd82a5c 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 ca5b90d14..3ac7d537d 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 b94e53063..990585835 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 1559d1fd4..92bb28ef5 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 e54d1b0b8..9edf6ab2d 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 eb2fd7b10..164ae44ec 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 904be8e6b..61f838bbd 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 830a77ffa..9dfe5beaa 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 5e5893e62..bca9a7c78 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 91a6a8441..6f45ba54b 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 23534dafc..7f2b06aeb 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 71de63f97..fbe01a2d7 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 56bd37f0c..d0cbee929 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 d7599148d..0c764f442 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 272b728a9..1b9204bc4 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 6522fa2df..4c637da36 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 d6626d8b7..b17bea1e6 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 b881ab704..32a85f360 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 3af029f6f..9f0512b64 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 0dd3ae3c9..adf4cfbfa 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 421c1f24b..4683b7804 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 ca3929c7a..e8d266932 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 29f238038..22dfff62d 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 c44532a20..21b48710d 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 171b49a70..3b4a9b0bc 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 f8727ef64..aafd0467f 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 27b9774a9..48264b0f7 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 1b931fd2d..9664789e0 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 005206caf..665db0fcc 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 e34c6281b..bc1cab07c 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 3191a60da..b81754ec8 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 c45f1f1eb..17ba3f8c6 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 d1c453b56..f4ffd4174 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 78ce2497f..d941bb562 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 6819d5d70..648d1ab02 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 1a30b5c35..06cffbd4a 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 69b3b79e6..a43dbc287 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 cdfe06a4e..a07db9d91 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 175015fa4..16409db0c 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 ea9ba517a..166c44092 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 1b2793f31..bebc12286 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 489b97859..56c2c9562 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 4a8bb1f2a..227d20a1c 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 484c26a51..8d05d9f96 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 7d6562305..4a01f99dc 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 83abc79fc..c8033fc60 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 f86b87397..2ab074810 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 676a095a7..b638b4464 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 5a03f9f86..1c2aa31e1 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 e3bea43ec..d7d3b5462 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 90486ec1b..ac7fdac5e 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 c80bc19d6..c4a77f8fb 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 709c7d070..d9a414055 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 014121bde..5480a50b0 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 d3a76d125..a69e2e0c7 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 417a4dc84..ecc2c3112 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 06570120e..fe2a8c0b1 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 9b9429ddd..32a5fc2bb 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 86fe4507d..74eeb2247 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 ba5b4fd1f..d4d3ce9b2 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 ee48a34e2..d88a34837 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 34cb50993..93e5624a4 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 2e5224320..e569ecced 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 13fa64053..1f8b3546d 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 d57015dd7..a44a5b3b9 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 0e75f93be..0dd9c461f 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 090f9af14..44bbb6295 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 28d2ca9a2..5c63dceab 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 fffc79433..fce7a7ac7 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 7e0777f66..7dae61605 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 0bdcce64f..8d94a30fb 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 2e5e17067..610d5cec5 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 bd25c22a2..3c9877e17 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 76be341ee..a411e7850 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 00a9d4d87..e57ad2bd0 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 d467d54c9..d185bffb5 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 5f8ecb356..d3df7b3fc 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 aa3b9e01d..8b1b7ad67 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 742e8b4b0..0c8a37508 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 28634e43a..2b6b2e36e 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 56b37eda8..3fabb9b1a 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 abe6adfcf..c2201716d 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 128df48d4..641d23d6e 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 8a15d7133..fa4f5f59f 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 a724cb8c6..e36a7f0ac 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 77e2cd571..2fb2466e0 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 f8ee94bb8..475645b4b 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 e0c1faa08..415633747 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 834483354..d54803699 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 af9ddf4b5..29783c283 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 bb9338666..0bcd82a5c 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 5aa1e945f..0936ce2d3 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 6c66cfe0c..67db2e22d 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 e51c2dc51..9a45d796f 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 b903f0b84..c47f0828e 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 c34676efd..28cef7111 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 378db8f25..02daad34e 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 91ee3274c..b21ecddfa 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 70a96d44f..a9d9a43c6 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 3c9fd78ef..88ac8f443 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 aaac0c549..89a43bcc2 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 60026e0fa..e2e086194 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 8b2965d1d..c4f12355e 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 56b183011..053ae4cee 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 617fbc60a..62024429b 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 d99d6c6e8..29bab8b8c 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 b9a99dd47..9c140dea9 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 61c4dcddc..0939b8880 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 41fdea4bd..34ce5b45c 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 a87becc00..5fa17cdbb 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 eac05c9c6..8fb2f8995 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 24377bd03..c4943130b 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 4e5c71235..a2760af03 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 56d23ce81..dba7e2be8 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 c57b4b9b6..8591b5062 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 e96eaeb75..829117ecb 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 cb3ef67c7..52abf75ff 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 7f573146f..87b28bab0 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 67627080f..913241516 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 1f1092baf..77c97e32a 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 5c19999a5..6d4b10203 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 830f63982..d0d147792 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 4348ab7bf..11514d5f5 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 ad3f2964f..522c668ab 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 a98ac5343..2e488f3cf 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 d4d2fb717..58669f6d5 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 379cafe32..b26aaf0d5 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 754209431..b6fab2468 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 133ca5ab4..2538444eb 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 e077d39e8..87f3690c5 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 d56467de1..311012499 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 8ea6672fa..cb4ad56ab 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 389a24728..649966d3d 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 55768e37a..201bbb39c 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 f0fde8fa0..92df9d063 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 ce9f8e3d8..2707d4370 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 f62c1c386..ecb8f062f 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 5eb509774..4f054a604 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 8dfbb13f8..6ef0cc09f 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 898eab712..da9b4fd23 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 9a562ee29..00b129d0c 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 f064e40f0..bcf348ae6 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 0f99c034d..00a28cb9a 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 fb45c47e3..fdaf97e73 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 230781fbb..702f7c71a 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 3a561238b..22edb102a 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 b59718fcf..1569f521b 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 97cdfa9d0..e2b4ab757 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 9a9655088..9127a7865 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 b26efb4c9..16f4540c1 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 1c708b0ee..3076fe3f4 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 03b671d38..8dfa559d0 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 394a6f655..14dd0bc2c 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 f6dae6753..f382bd3df 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 7723944cb..92368c7b2 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 bb9338666..0bcd82a5c 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 df1ef3e0d..47537d54e 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 f6898bcbe..72bc366ca 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 c0cfc1b8f..43b4690e1 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 ca5aa6f21..67f8349c1 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 b53bd5302..79b04389a 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 b54c758da..f3167485f 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 037cbd3c2..6f174da1b 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 eb642b81e..e9573ad18 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 1f6cbb064..743a474e9 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 25434f5a6..22d62f19e 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 c5d037377..009a87867 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 d8af4b1bd..ca0697bb0 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 bc9de1afc..3c9877e17 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 fbf18a802..76efb3715 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 7cdf32023..b233173d9 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 ac9baeb92..f4dd69e12 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 a8833a2a6..f95fe5bf9 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 835371509..f85661a3a 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 fe479108f..d5f8ecaba 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 fd17a19f0..9fc93962f 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 a04ce149f..0f40a1624 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 ac4935304..d8fb9beb6 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 9cc949a70..266ae5c59 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 eb54d36e5..6ef68a6ab 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 f8904701c..ffe122a1f 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 8671324d2..a06a61275 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 066a82a2c..5dae04565 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 f46251853..444880c9e 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 a9ecb2f39..45407731b 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 07d1ff3e3..95a4b56db 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 6ba7c6b6b..59acf790c 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 b6d532180..9ce663461 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 87974f763..389e576b6 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 e18b39867..8c43f865f 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 fad4a4606..0770b34a0 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 867bab157..bd412c1fc 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 74ae21245..e5ed78017 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 de87b5267..c79f907ed 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 c89c579a9..87aec2d2e 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 448b5302a..1599d971e 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 12976d99b..bac5ce160 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 800f89214..3eb67b2b4 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 de7709a50..4055513c0 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 c5ea6ab21..0b562c0f7 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 0f8378822..ef0582f1e 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 f78458752..7dadc4b85 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 a0975eccc..87caf6c0f 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 59ecbc2c6..f067105bd 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 f4261ff35..b90fa69a3 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 fc5ecfb22..913a322aa 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 03e4d9b72..a762f7338 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 24f5f12fc..82f55a4a7 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 367c902df..cdbab7927 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 bb204c316..6123076e5 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 daf0dd0c7..dc5151e5f 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 bc0b85f38..360a9eebd 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 0a935db69..7df46f735 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 6885fb538..fca2a690b 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 760b92646..0f91ed818 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 91a6a8441..6f45ba54b 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 19a1132c4..c9debbbc4 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 0fbffeb70..f1edd5ede 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 2a3c9d6a8..52c8caccd 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 1f768f7a0..b968ff590 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 861ccd998..f0e507a50 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 ab6c9a4c0..e784565bd 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 9b274317e..fb498f89b 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 f465ee884..01998a0ec 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 dd55fad4e..a668168fb 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 2fc2c2624..11a64382a 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 6a178352a..dd0121d62 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 b61002418..74ed533fc 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 717a2c492..1367ab1b4 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 5ec9df85e..4d67bf6f7 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 653fc51cf..6eb805e53 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 271e1fa77..acbb6a722 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 a7b9bc113..0950e9e94 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 01322c28b..0b77f185c 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 17563cf74..86d9e90f3 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 4880153cc..eb19f8f1f 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 9482ed57b..3582c4946 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 5c1938d44..f1b047cda 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 ac9f2ab04..c9ea88655 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 8f2ec3a74..f37e25cee 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 16a1290ce..5163099f5 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 bf3cb14fd..0fa1b4598 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 03a2fd17e..b396300a4 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 288b350a0..0e93dbe6b 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 3523fe488..2108ea016 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 0d2dc4e45..60e445a27 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 251d23ba3..f87285b2e 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 ecf6b1059..0be09b1ae 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 bd70d5e2b..c6b84202c 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 904eb4c0c..3cb597ede 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 7943d1872..1f1cba2b4 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 d97bbb028..d51494559 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 89cc4743a..5280a3eeb 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 2c768374e..1b3e73301 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 62de6e1ea..c06e6b151 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 fb1283a64..ec8f0b351 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 7fae8aa74..7683ad8db 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 ae8178ebd..d1dc5cfec 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 d742b8acd..35d7d5ec8 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 e1c224864..3636d223e 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 45dc92f99..642c0de63 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 681d39cfd..7e5ae4db0 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 40e3e5b04..ac7b8624d 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 d7f8bb4f1..f4daf7d9b 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 c7eca7b77..753172aef 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 27412d4e1..9a7c328a0 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 dbf301a76..82774a018 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 b2f8c5a78..97280bb86 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 48b291ef4..36ec27b03 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 7c5f6bf4b..143f5d833 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 493ef07b9..f9f6d1968 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 1d1f37335..4d1097162 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 cf525abf8..c960331ab 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 ca80361bd..5f1d0d3db 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 7a20ac6b5..507aa32a7 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 31925711e..d23cae06c 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 1286b80f3..244b0937c 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 826c21ae9..8c83b5062 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 6aca423ff..1638fa1a6 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 f72b34ed3..bbc9d99de 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 b781a5c1b..1dfd553d2 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 19fba46a1..fc53d7c67 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 e6b198c72..282540890 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 5cc8cd41d..e1279c909 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 105c84119..edeb3796a 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 3650c44ec..1d18dbbab 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 67b8da073..61ae7ca22 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 f16a2c6f1..9e60a8705 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 624afc041..af2681b11 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 6c4235863..85f49f95f 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 88a9ea8a5..ba62e95b5 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 02171a7c9..a03a61f4d 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 f7b68e7cb..2fd170511 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 960a842b1..c434da3ec 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 8ff46a84a..8aebe8390 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 5659fb251..468ec234b 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 ff7742eef..76126d2cc 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 6e7baf6c6..0658836e3 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 de5b1c510..ec162b8ff 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 6267aa073..a552f9919 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 1aa67b581..a5f629a8a 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 6c92469c7..10a03c217 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 629e5d130..d65d1e8ea 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 d600d7d58..a6a8d0f6a 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 7fb71c827..e6861df7d 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 2659c39d1..2740d2e79 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 1f7b410e1..420f29677 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 40de9d0ad..fcc9d16d3 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 b164668ac..89baddaeb 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 4df506b09..5aafa3860 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 819d0478b..777e27f22 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 1ee8a9afb..c703e2a30 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 077500313..23cb7c785 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 fb5fccb1a..06402805b 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 ad77c4522..3b550b297 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 92ce19b16..845c16dc3 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 f3ce55a45..acd41d539 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 e869fda23..d0a800a12 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 e605406ca..4e0783377 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 89e283195..7c6709e0d 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 2fbfa9721..379544b55 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 e65b61bd3..45a3c4421 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 4574117b6..dda5af2be 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 7ad36f6cc..607648522 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 20b0c9525..dd69d8dcc 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 20935fb6b..c0571cbe4 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 549d4513b..12168e5e3 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 d39bf52e5..85b1ef336 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 086a8930d..f2a36ceaf 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 64944a824..58cf685e2 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 0130d2753..b8ce3956a 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 1e11a514a..ec08536c3 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 b872cfdc4..702b3fc7f 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 0a492aee5..ad29df19e 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 44da04c32..021c6b5bd 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 231e257ac..22f7afd68 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 1c4a662dd..1a9664fcb 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 62cd2715e..059b2fe41 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 0a10e3d82..7402234c1 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 c37428fa5..d0bbdc733 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 52f147a25..7b120f446 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 e68413900..fdf200aee 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 8aa37c420..0f3220c7b 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 18e4257e8..deb81d563 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 b404ea494..b6a6ec520 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 f1805cab0..13d2522f9 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 12e09de69..d68a73ce2 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 c0e7b4b74..6f6567d34 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 a951c8fa3..f8fdf566a 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 a5446e36d..b646af474 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 bc9de1afc..3c9877e17 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 222a6983b..2b9f250ac 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 7a4fffb6c..e917f1c34 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 e5ba9f397..7c6e02ea0 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 24b9c2281..722e542dc 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 4e8ce8356..42009a230 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 4f013b069..fc955af30 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 c772c92db..04e2762f0 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 89a268228..d984ee317 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 726a04ddd..50280bdb9 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 2bb6d8f67..d6499be22 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 c196272cf..240123336 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 bd985bf73..7469da0b2 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 870c6ae79..a7eceb69d 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 0d107b8d8..d611f4723 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 8d60ece46..b76ebb1c6 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 933dee482..d3d1456b1 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 5642f33e2..8a663cb30 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 35ed864e6..c5cd013c2 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 2d8d0071c..41734e73a 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 246a480fb..984757b32 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 330b197c0..e2e0c920c 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 a9839affd..8caa00bac 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 57e05b415..f739d7553 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 31c16ade6..310818c93 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 52f11d3ff..d08b42348 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 8543c362b..80a06dea1 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 9379bbab0..3591c544d 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 e76f73b76..5dd0cc833 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 bb0bf22c3..095a3e6ac 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 e9c77dfa1..cf27f6c7d 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 c6704c03b..2a8b4e273 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 d30fc7f2e..d100ac94b 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 8be4a871c..063f6c56a 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 527c9b310..06be729b7 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 c79948b84..a4c3e38fa 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 d7756988f..b84c130aa 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 820c7303d..04860a977 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 261d404f7..dc9cc48f8 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 62fc7ab61..75848d7e8 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 90f621062..31db8d06e 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 ab5e070d1..d993b5be3 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 323c3ca6f..b84c130aa 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 efd87f27e..430509fe1 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 f064a8fc0..e64936aad 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 f07ad17d1..1cde93eab 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 929d9596c..4e8e64271 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 82a3a12fe..6bf48c9de 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 af5fc1d7a..c3da5eb4c 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 62f952d29..cf9231583 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 91060b6a5..6507d86d1 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 b668d745f..963539489 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 8da626c92..b14686fb0 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 ddeff0106..18d682576 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 237e732bf..6183d0892 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 22048fd9c..733f28440 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 57e60df94..c2ccf2431 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 40f05f1f2..db080d2cf 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 690204949..e0aabb0cb 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 8ec52c04e..db8d66dbb 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 d7756988f..b84c130aa 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 476f98ba1..1005a5cbb 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 5b75d92ff..725c69d1a 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 aa24f1840..fa0d3bce2 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 7e01defb9..5f7459b8c 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 759bd1762..f6529f48e 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 bd25c22a2..3c9877e17 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 88b8bed7d..684258b39 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 bc9de1afc..3c9877e17 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 61d30fcee..f78e62c7f 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 03cc0a456..79ac1b574 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 4ac05cf7d..b1c735d97 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 91a6a8441..6f45ba54b 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 14c2ad43f..289a8b596 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 2e3ba191e..9757d4049 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 63b301b1c..f7ea11069 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 d1cc68822..253e09eb2 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 1f9036870..efc25cd7e 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 28782cb9f..695358d9f 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 62dec9ae3..705de4e3d 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 3f8e7ed39..16d33293f 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 4b8f5cc36..825009e39 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 03118f6ff..dfd173eb3 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 931e52a9b..8fedef9a9 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 e9c5c8a69..6f466d907 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 9d585af91..794d995b6 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 bf4c44e3d..07ba3bb28 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 5115efed4..ade3396c3 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 e51016ca9..59494d73c 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 466c23e6c..0fc777188 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 8acd47e81..e95d71eb0 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 633b456b1..3f9e1fe17 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 ca0398046..5d8799786 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 68a456848..cbf69fdb7 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 a12a3d1a7..5e1f55fcf 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 185d396a4..d87b3c769 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 23ff67ba5..65ca82515 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 74a281438..a68b633c5 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 b86892304..e3be78aca 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 16324a1de..840d28518 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 8587940dd..2270012c2 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 4c2a83f04..96801b268 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 384fa84e3..b4fa0a92d 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 bd25c22a2..3c9877e17 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 d6740fb4a..8f83d201b 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 c006cea93..4a6202543 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 057a5241a..63345d14b 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 cf7c39a4e..7e5965a67 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 9ec0bf4bb..25f8028f9 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 78402d7c8..b27219ca8 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 c0c0b8e85..5d4d2dd43 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 3729f9287..f0513be82 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 005f5ed4c..500a43d77 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 660523712..d3cde5781 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 220f9af15..70db9fdae 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 665212723..0e8dbbd45 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 8b0fafe4b..b36bc5903 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 21c320101..86140c616 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 8f842d56b..2ba9b44d7 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 4e5eabf56..2a68d4091 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 54fbb060b..f6278b7a6 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 77513190b..e24728aae 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 3f535c99b..1a6565eb8 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 23abb19ad..01cd9db5f 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 8dcc1af0d..e846e0c93 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 d709e50e2..798f17cf3 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 90260d273..791d47e79 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 2eeaa35aa..5d9de76c6 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 09f529412..204156cc4 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 9f4f52178..d6d6ce2dc 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 eb2f665ae..ed30ab298 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 35adeb24c..a6eabdcbb 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 6855a981c..dab26e1f9 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 6ab4b99e6..93e6cb063 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 dcaa68542..47c58ab51 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 58d8cdfbb..17bbbd45c 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 ae06a6f37..e77fa3ff7 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 312c31774..ae615c8af 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 85efcbecf..8f325747c 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 1f7557ea7..cc9d3eda1 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 9983d6adb..0011c4977 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 85229c535..3e71f5a13 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 4880153cc..eb19f8f1f 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 c974d68a0..1f10f65cc 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 55392c6ab..32bafcff9 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 84f034036..11bcbc181 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 fdd79f6b8..ebbd2cb47 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 32413a4b4..ac33a2762 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 a7105025c..934b4df88 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 4880153cc..eb19f8f1f 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 3948a409f..b481c756c 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 d65c5445d..0cc2ba52c 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 d47ad0687..37bd14d0a 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 0f6e9055c..940e4c782 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 e0420d961..28cef7111 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 704ae4fc7..f586887be 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 e9436409b..5c986f5ad 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 9d7e8e2df..4feddb3b7 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 c05da7065..44de7e5a5 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 d12b5772e..5fca51f4b 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 8a2218b2d..e08f37b42 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 97321e87e..02fda23b0 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 bc9de1afc..3c9877e17 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 a16f5381e..113053c90 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 dafa0ad31..cb9bd0d2a 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 5345bff3b..fa25c1669 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 bdfe972fb..fd1678fd9 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 08ebbe3c2..76d43f3d5 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 79bfb44b4..dbfebf5dc 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 c58e92c73..c28e3ad2d 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 eeb178d0a..5832bf322 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 d7bacbbfd..c037330e2 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 4cfacb64a..8b2b98df5 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 3dfb02a13..63e027c8d 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 e5198ee99..d7037812a 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 ea5b11b4b..5ff55ab7c 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 6a4c63149..ff71ac677 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 5ff97adcf..6665a8137 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 f1f19b50b..5db53bf7a 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 8de603628..27d51d5e0 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 06b9b68d1..8fc1a95fe 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 b926dfc61..040da489d 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 bbcfddc7a..a81fc1e14 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 9f04d6491..b9aa89d21 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 09f3395da..3608e6fe6 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 a38efa5aa..68a160465 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 059607a51..8855117d7 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 75fcf77ac..c20c4068a 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 eb6e7a6ba..a7708c010 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 d13d531f3..d248c874a 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 155248e1b..5944e63a4 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 b7c301f88..4607c5e8a 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 9f4047faa..e80b83679 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 b85975f44..9ebc02d76 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 91df4fbcd..2a73869aa 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 f005be429..e02f4d65a 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 30ef947c4..0476ba3dc 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 b366161af..5c75893d8 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 c155d01cc..6dbeff90e 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 5f5fe2af3..bff855ea4 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 bb34ffeb2..2aae4fbcf 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 0713522f5..9a6d054de 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 f9f4df849..831c6353f 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 b178f7b3d..a4d8a44ad 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 2a836dc0b..c486e78bb 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 8a5a3651b..a9e0419b5 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 bcedd504e..78a292239 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 dfd2a698a..67c8c2cb0 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 4cd139906..7ec01d5f1 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 f0afea718..dce5c8966 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 23aff9fd9..8c1797cd0 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 aa3f03d29..d0ebbb309 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 4fe3960b0..35ed0fd18 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 98e97f489..3093b2e33 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 fb3f76ecd..0ab616124 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 5471b6a35..e3e4c69d8 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 f2a758e84..c2d4e8fb5 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 8d69ca1e3..ecbc10c67 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 54bb43067..a9a35b9bc 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 affc1d214..df2b8ecb7 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 31d087779..b850a6c37 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 37c69a1c1..65bd7bb7e 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 bb9338666..0bcd82a5c 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 68f6c4391..4ce62fff5 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 a88ccdfe2..0a0cf9edf 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 57b915f7d..0ae5869f3 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 b8717291c..cc38da57c 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 40f4efbdc..a6b206809 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 5002a7a95..7cd6b3517 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 a426379d1..2136ea041 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 7fe2b115e..9386a0d56 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 1256b8dae..783379f3e 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 0e3f6d247..703144e11 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 522dd9d2c..200e221ca 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 5d514f2ad..ce896a08d 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 8607127d3..1b330bbf1 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 324309d24..93bd48bdd 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 175d19141..d94e78b98 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 7bf9ac863..4cdd59806 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 b4ca04549..14fffd19d 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 6c699cd74..ff88d8a96 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 1fa65936f..eb77a2253 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 8e60c20a3..dd7c56c75 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 13a3d21ee..c366f7cc9 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 6d9cc07a2..054388b77 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 24e271714..482237f25 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 982730862..670798035 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 080f889c9..d9f233ef1 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 fc3f848e9..09629a1df 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 93c0f85a0..d3ab637cd 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 30a6a8617..009a87867 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 c5a9a9622..b6c16de43 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 25a079728..abe5e167a 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 50233b393..b2899e026 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 70e13875f..a9848bcad 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 49c785ca9..d90ad563f 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 697d6399f..19af0e206 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 bdce5716b..2599fef53 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 f5b32bc5f..8a76ca423 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 0aa0872a8..a7b7c6cec 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 a7a353159..57ac4664e 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 d5b4da60d..d30321658 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 a8225b8fb..356743b54 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 a88056c16..6038a2227 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 15880f85e..d7aa18427 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 ed8f2497f..bf8cc03fb 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 a802f2fa5..24f18b45f 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 ca8ff327c..b91e721c3 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 560bdd738..3b7838fe3 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 9c07a9eeb..4576bc3a0 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 248a8af6a..506a52daa 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 d84328d9a..0dbf96a6b 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 8f960ec65..e5d24c7d9 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 f867a25cd..4f714f297 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 a4144c03c..4f0c310e0 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 20da2d07a..563ba9ee9 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 9352457f1..545ffb72f 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 88ad9ea3b..b9806042f 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 dbe987a05..13383b97e 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 0fd497d3d..8d424d11c 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 0e329eabf..51e6bf079 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 bfb672eff..f7a4463ab 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 033f9c119..85f4d41f3 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 9307958f9..8c8502b2a 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 d4c9b8e6b..f1f031a95 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 cb21dc7bb..301025bc5 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 357fedd63..36c4c7661 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 dba85b7d2..0d7eed29a 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 889a49c7f..1a80c3dfe 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 68c904215..24d670f8d 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 17f50c235..880a5e561 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 f77b0e77d..e83c0c1c5 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 a0c8945fd..bd1620e4e 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 d6451d32d..4265a3d5d 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 2afcb40c5..beeb11bb6 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 5c7d0b6da..141d9dc8d 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 33f4bfe60..118c83931 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 d1d0029b7..7500df198 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 194a54aff..689be4068 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 c517d8994..aa30ddd87 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 980a5c336..f3e255626 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 fe4eb8e9d..9e9665b07 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 1af906047..84bede122 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 c3f45cb20..206b39e90 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 3d9c2a9a2..4f159c2ab 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 0022d4b07..b299d0992 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 a9a5e6180..5c607337c 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 50965ca0b..4b2ef5bc5 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 9b851014d..cbf435bc2 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 e57d08de6..be10319a8 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 f4af0962a..8c930d1d2 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 5ede28817..51aeaefcd 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 b515ebbcb..3fd88dfb3 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 8e9f3812c..b4f4461dd 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 e17aeb5f4..6440d4918 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 1374fc40a..d81220326 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 265d7c3ec..4dbd9f5d3 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 8092c1c2e..7213adc8d 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 93d90e7ad..18d52c5ed 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 63240f0ab..ef69b5813 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 1f8549ff1..b93a12ad0 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 68b617e02..67eca0a5d 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 792d12195..a044eb58c 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 3e4b60473..1526cdba6 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 a1efbc0ce..7ad53da16 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 60255cdad..c42c94ff6 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 7d529ab33..3415b9f75 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 d9045e831..5ff6ab422 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 15ee58b9b..f7fc189cb 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 d6c948cbe..1aad3cec5 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 26667826e..312a5435d 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 250c517b4..7d18d5bc8 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 afcc326cf..4456ee470 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 d5870766e..fd1317a76 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 b50db8764..199dc6885 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 02c3301da..06763d9f4 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 2ec86285e..9771b197a 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 316b72d5b..404a7a0a3 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 a91173110..9c67432d5 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 f705a33a3..6a1640d32 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 f95225863..f55167e0d 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 66b368e28..8f6fdd42b 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 a7d980952..2cd45023a 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 47ce2498d..6fd05f06e 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 0d3ed7259..3055a5b82 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 e7ee9aa57..98a5ec9fb 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 f26d7a348..70a4cd0e5 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 3a6bf9397..e5c071724 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 53fd97ac2..b9b622733 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 5a8b7d92f..78726cdfa 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 29bd4e293..0643b1ccc 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 f59d536a5..bf83b7ac6 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 100ee5e2f..35b917cf4 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 f1af200f2..03ca97ca4 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 e08aa7769..da5910733 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 116312088..ae860d313 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 da5dacd8c..4b9bc76fa 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 62b948301..dc368bb5a 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 e46733b80..4fdf7e7a8 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 574929e02..692ecaf4a 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 4637f0b26..3a0704c3b 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 9cf3f3845..2f7e77e1b 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 25ddffef8..542a85d08 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 7986c2b5a..7566336b9 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 9fc11b566..7564a9606 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 e3405968c..44a7f9b74 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 39fb30d21..9e2dcaeb5 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 91a6a8441..6f45ba54b 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 ab2f44a80..0fc948b86 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 4994074df..3ae929b35 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'); };