feat: v3 migration - 5/n

This commit is contained in:
DIYgod
2024-02-28 19:31:09 +08:00
parent 7a719369be
commit db9e515c7c
169 changed files with 182 additions and 184 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import { load } from 'cheerio';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
const iconv = require('iconv-lite');
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
const setCookie = function (cookieName, cookieValue, seconds, path, domain, secure) {
let expires = null;
+1 -1
View File
@@ -5,7 +5,7 @@ import { load } from 'cheerio';
import got from '@/utils/got';
import { art } from '@/utils/render';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
const cookieJar = new CookieJar();
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
const utils = require('./utils');
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,4 +1,4 @@
const buildData = require('@/utils/common-config');
import buildData from '@/utils/common-config';
module.exports = async (ctx) => {
const link = 'http://www.aiea.org/0504';
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import { load } from 'cheerio';
const { puppeteerGet, renderDesc } = require('./utils');
import { config } from '@/config';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
import puppeteer from '@/utils/puppeteer';
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const buildData = require('@/utils/common-config');
import buildData from '@/utils/common-config';
const baseUrl = 'https://www.airchina.com.cn';
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,5 +1,5 @@
import { load } from 'cheerio';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { parseDate } from '@/utils/parse-date';
import puppeteer from '@/utils/puppeteer';
+1 -1
View File
@@ -1,6 +1,6 @@
import got from '@/utils/got';
import { load } from 'cheerio';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
module.exports = async (subjectID, minLength) => {
// bangumi.tv未提供获取“吐槽(comments)”的API,因此仍需要通过抓取网页来获取
+1 -1
View File
@@ -1,7 +1,7 @@
const getComments = require('./comments.js');
const getFromAPI = require('./offcial-subject-api.js');
const getEps = require('./ep.js');
const { queryToBoolean } = require('@/utils/readable-social');
import { queryToBoolean } from '@/utils/readable-social';
module.exports = async (ctx) => {
const id = ctx.req.param('id');
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import { load } from 'cheerio';
const utils = require('./utils');
+1 -1
View File
@@ -3,7 +3,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const city = ctx.req.param('city');
+1 -1
View File
@@ -3,7 +3,7 @@ import got from '@/utils/got';
const utils = require('./utils');
import { load } from 'cheerio';
import { config } from '@/config';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
module.exports = {
getCookie: () => {
+1 -1
View File
@@ -3,7 +3,7 @@ import got from '@/utils/got';
const JSONbig = require('json-bigint');
const utils = require('./utils');
import { parseDate } from '@/utils/parse-date';
const { fallback, queryToBoolean } = require('@/utils/readable-social');
import { fallback, queryToBoolean } from '@/utils/readable-social';
const cacheIn = require('./cache');
/**
+1 -1
View File
@@ -3,7 +3,7 @@ const cache = require('./cache');
import { config } from '@/config';
const utils = require('./utils');
const JSONbig = require('json-bigint');
const { fallback, queryToBoolean } = require('@/utils/readable-social');
import { fallback, queryToBoolean } from '@/utils/readable-social';
const querystring = require('querystring');
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,7 +1,7 @@
import got from '@/utils/got';
const cache = require('./cache');
const utils = require('./utils');
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
module.exports = async (ctx) => {
const uid = ctx.req.param('uid');
+1 -1
View File
@@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date';
const utils = require('./utils');
const { CookieJar } = require('tough-cookie');
const cookieJar = new CookieJar();
const { queryToBoolean } = require('@/utils/readable-social');
import { queryToBoolean } from '@/utils/readable-social';
module.exports = async (ctx) => {
const kw = ctx.req.param('kw');
+1 -1
View File
@@ -1,4 +1,4 @@
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import { parseDate } from '@/utils/parse-date';
const dayjs = require('dayjs');
const localizedFormat = require('dayjs/plugin/localizedFormat');
+1 -1
View File
@@ -1,6 +1,6 @@
import { load } from 'cheerio';
import got from '@/utils/got';
const rssParser = require('@/utils/rss-parser');
import rssParser from '@/utils/rss-parser';
const { asyncPoolAll, parseArticle } = require('./utils');
const parseAuthorNewsList = async (slug) => {
+1 -1
View File
@@ -1,4 +1,4 @@
const buildData = require('@/utils/common-config');
import buildData from '@/utils/common-config';
module.exports = async (ctx) => {
let link;
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
import { parseDate } from '@/utils/parse-date';
const { parseBlogArticle } = require('./utils');
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
const { parseArticle } = require('./utils');
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
const { CookieJar } = require('tough-cookie');
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
module.exports = async (ctx) => {
const { id = '100003114' } = ctx.params;
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const rssParser = require('@/utils/rss-parser');
import rssParser from '@/utils/rss-parser';
module.exports = async (ctx) => {
const user = ctx.req.param('user');
+2 -2
View File
@@ -1,8 +1,8 @@
import cache from '@/utils/cache';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const { getCookies, setCookies } = require('@/utils/puppeteer-utils');
const logger = require('@/utils/logger');
import { getCookies, setCookies } from '@/utils/puppeteer-utils';
import logger from '@/utils/logger';
let cookie;
const baseUrl = 'https://www.cw.com.tw';
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
const rootUrl = 'http://www.dayanzai.me/';
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
module.exports = async (ctx) => {
const feed = await parser.parseURL('https://www.deepmind.com/blog/rss.xml');
+1 -1
View File
@@ -1,6 +1,6 @@
const { getConfig } = require('./utils');
import got from '@/utils/got';
const RSSParser = require('@/utils/rss-parser');
import RSSParser from '@/utils/rss-parser';
module.exports = async (ctx) => {
const { link, key } = getConfig(ctx);
+1 -1
View File
@@ -3,7 +3,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
module.exports = async (ctx) => {
const { category, topic } = ctx.params;
+1 -1
View File
@@ -1,7 +1,7 @@
import got from '@/utils/got';
const path = require('path');
import { art } from '@/utils/render';
const { fallback, queryToInteger } = require('@/utils/readable-social');
import { fallback, queryToInteger } from '@/utils/readable-social';
module.exports = async (ctx) => {
const type = ctx.req.param('type') || 'subject_real_time_hotest';
+1 -1
View File
@@ -1,7 +1,7 @@
import got from '@/utils/got';
const path = require('path');
import { art } from '@/utils/render';
const { fallback, queryToInteger } = require('@/utils/readable-social');
import { fallback, queryToInteger } from '@/utils/readable-social';
module.exports = async (ctx) => {
const subjectType = ctx.req.param('type') || 'tv';
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
const querystring = require('querystring');
import got from '@/utils/got';
const { fallback, queryToBoolean, queryToInteger } = require('@/utils/readable-social');
import { fallback, queryToBoolean, queryToInteger } from '@/utils/readable-social';
import { config } from '@/config';
const headers = { Referer: `https://m.douban.com/` };
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import { config } from '@/config';
const { fallback, queryToBoolean } = require('@/utils/readable-social');
import { fallback, queryToBoolean } from '@/utils/readable-social';
const { templates, resolveUrl, proxyVideo, getOriginAvatar } = require('./utils');
import puppeteer from '@/utils/puppeteer';
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import { config } from '@/config';
const { getOriginAvatar } = require('./utils');
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import puppeteer from '@/utils/puppeteer';
module.exports = async (ctx) => {
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import { config } from '@/config';
const { fallback, queryToBoolean } = require('@/utils/readable-social');
import { fallback, queryToBoolean } from '@/utils/readable-social';
const { templates, resolveUrl, proxyVideo, getOriginAvatar, universalGet } = require('./utils');
module.exports = async (ctx) => {
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
const path = require('path');
import got from '@/utils/got';
import { load } from 'cheerio';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { config } from '@/config';
import puppeteer from '@/utils/puppeteer';
+1 -1
View File
@@ -4,7 +4,7 @@ import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const defaults = require('./defaults');
const shortcuts = require('./shortcuts');
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const site = ctx.params[0] ?? 'news';
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
const cateList = new Set(['all', 'design-resources', 'learn-design', 'inside-eagle']);
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
+1 -1
View File
@@ -1,5 +1,5 @@
import cache from '@/utils/cache';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import got from '@/utils/got';
import { load } from 'cheerio';
+1 -1
View File
@@ -1,5 +1,5 @@
import got from '@/utils/got';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import timezone from '@/utils/timezone';
import { load } from 'cheerio';
const path = require('path');
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import timezone from '@/utils/timezone';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
module.exports = async (ctx) => {
const params = ctx.req.param('params') ?? '';
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
+1 -1
View File
@@ -2,7 +2,7 @@ import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
const path = require('path');
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const lang = ctx.req.param('lang');
+1 -1
View File
@@ -1,4 +1,4 @@
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
const { getItems } = require('./utils');
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,4 +1,4 @@
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
const { getItems } = require('./utils');
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import { parseDate } from '@/utils/parse-date';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import puppeteer from '@/utils/puppeteer';
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
module.exports = async (ctx) => {
const category = ctx.req.param('category') ?? '';
+1 -1
View File
@@ -3,7 +3,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
const { fixArticleContent } = require('@/utils/wechat-mp');
import { fixArticleContent } from '@/utils/wechat-mp';
const baseUrl = 'https://freewechat.com';
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import { load } from 'cheerio';
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import { load } from 'cheerio';
const ProcessFeed = (i, $, link) => {
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
+2 -2
View File
@@ -1,8 +1,8 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const parser = require('@/utils/rss-parser');
const { isValidHost } = require('@/utils/valid-host');
import parser from '@/utils/rss-parser';
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const { domain = 'news', category } = ctx.params;
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const { domain = 'news', tag } = ctx.params;
+1 -1
View File
@@ -1,6 +1,6 @@
import got from '@/utils/got';
import { load } from 'cheerio';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
const parseItem = (item, tryGet) =>
+1 -1
View File
@@ -186,7 +186,7 @@ const gdgov = async (info, ctx) => {
};
});
} else if (idlink.host === 'mp.weixin.qq.com') {
const { finishArticleItem } = require('@/utils/wechat-mp');
import { finishArticleItem } from '@/utils/wechat-mp';
return finishArticleItem({ link });
} else {
return cache.tryGet(link, async () => {
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { parseDate } from '@/utils/parse-date';
const moeUrl = 'https://www.moe.gov.cn/';
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import { load } from 'cheerio';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
const { finishArticleItem } = require('@/utils/wechat-mp');
import { finishArticleItem } from '@/utils/wechat-mp';
import { config } from '@/config';
const baseUrl = 'https://www.nmpa.gov.cn';
import got from '@/utils/got';
+1 -1
View File
@@ -1,4 +1,4 @@
const buildData = require('@/utils/common-config');
import buildData from '@/utils/common-config';
module.exports = async (ctx) => {
const department = ctx.req.param('department');
+1 -1
View File
@@ -2,7 +2,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { art } from '@/utils/render';
const path = require('path');
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const username = ctx.req.param('username');
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
import { art } from '@/utils/render';
const path = require('path');
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
const path = require('path');
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const { finishArticleItem } = require('@/utils/wechat-mp');
import { finishArticleItem } from '@/utils/wechat-mp';
const rootUrl = 'http://job.hrbeu.edu.cn';
const idMap = {
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const { finishArticleItem } = require('@/utils/wechat-mp');
import { finishArticleItem } from '@/utils/wechat-mp';
module.exports = async (ctx) => {
const id = ctx.req.param('id').replaceAll('-', '/');
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
function getKeysRecursive(dic, key, attr, array) {
for (const v of Object.values(dic)) {
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import timezone from '@/utils/timezone';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
const path = require('path');
+1 -1
View File
@@ -1,4 +1,4 @@
const buildData = require('@/utils/common-config');
import buildData from '@/utils/common-config';
const baseUrl = 'https://www.iiilab.com/';
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,4 +1,4 @@
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import { load } from 'cheerio';
module.exports = async (ctx) => {
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
const { ig, login } = require('./utils');
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { config } from '@/config';
const { renderItems } = require('../common-utils');
+1 -1
View File
@@ -1,5 +1,5 @@
const { IgApiClient } = require('instagram-private-api');
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { config } from '@/config';
const ig = new IgApiClient();
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import { load } from 'cheerio';
import { config } from '@/config';
import { parseDate } from '@/utils/parse-date';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import puppeteer from '@/utils/puppeteer';
// /iqiyi/user/video/:uid
+1 -1
View File
@@ -5,7 +5,7 @@ import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
const path = require('path');
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const user = ctx.req.param('user') ?? '';
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
module.exports = async (ctx) => {
const rootUrl = 'http://i.jandan.net';
+1 -1
View File
@@ -1,4 +1,4 @@
const buildData = require('@/utils/common-config');
import buildData from '@/utils/common-config';
module.exports = async (ctx) => {
const link = 'https://thejewishmuseum.org/exhibitions';
+1 -1
View File
@@ -3,7 +3,7 @@ import got from '@/utils/got';
const { topicDataHanding } = require('./utils');
import { load } from 'cheerio';
const dayjs = require('dayjs');
const { constructTopicEntry } = require('@/v2/jike/utils');
const { constructTopicEntry } = require('./utils');
const urlRegex = /(https?:\/\/[^\s"'<>]+)/g;
+1 -1
View File
@@ -3,7 +3,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got'; // 自订的 got
import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析器
import { parseDate } from '@/utils/parse-date';
const { getPageItemAndDate } = require('@/v2/jsu/utils');
const { getPageItemAndDate } = require('./utils');
module.exports = async (ctx) => {
const baseUrl = 'https://jwc.jsu.edu.cn/';
+1 -1
View File
@@ -3,7 +3,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got'; // 自订的 got
import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析器
import { parseDate } from '@/utils/parse-date';
const { getPageItemAndDate } = require('@/v2/jsu/utils');
const { getPageItemAndDate } = require('./utils');
module.exports = async (ctx) => {
const baseUrl = 'https://stxy.jsu.edu.cn/';
+1 -1
View File
@@ -3,7 +3,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got'; // 自订的 got
import { load } from 'cheerio'; // 可以使用类似 jQuery 的 API HTML 解析器
import { parseDate } from '@/utils/parse-date';
const { getPageItemAndDate } = require('@/v2/jsu/utils');
const { getPageItemAndDate } = require('./utils');
module.exports = async (ctx) => {
const baseUrl = 'https://rjxy.jsu.edu.cn/';
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import timezone from '@/utils/timezone';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
/**
* Convert an array into a dictionary object.
+1 -1
View File
@@ -1,7 +1,7 @@
import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
const baseUrl = 'https://today.line.me';
const parseList = (items) =>
+1 -1
View File
@@ -1,6 +1,6 @@
import got from '@/utils/got';
import { load } from 'cheerio';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
let region = ctx.req.param('region') ?? 'ukraine';
+1 -1
View File
@@ -1,6 +1,6 @@
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const name = ctx.req.param('name') ?? 'i';
+1 -1
View File
@@ -2,7 +2,7 @@ import cache from '@/utils/cache';
const { ImapFlow } = require('imapflow');
import { config } from '@/config';
const { simpleParser } = require('mailparser');
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { parseDate } from '@/utils/parse-date';
module.exports = async (ctx) => {
+2 -3
View File
@@ -1,12 +1,11 @@
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
const { RequestInProgressError } = require('@/errors');
module.exports = async (ctx) => {
const { id, lang } = ctx.params;
let { data } = await got.get(`https://api.mangadex.org/manga/${id}`);
if (data.result === 'error') {
throw new RequestInProgressError(data.errors[0].detail);
throw new Error(data.errors[0].detail);
}
data = data.data;
let title;
@@ -42,7 +41,7 @@ module.exports = async (ctx) => {
}
data = (await got.get(url)).data;
if (data.result === 'error') {
throw new RequestInProgressError(data.errors[0].detail);
throw new Error(data.errors[0].detail);
}
ctx.set('data', {
title: `${title} - MangaDex`,
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const { parseDate, parseRelativeDate } = require('@/utils/parse-date');
import { parseDate, parseRelativeDate } from '@/utils/parse-date';
module.exports = async (ctx) => {
let sid = ctx.req.param('sid') ?? '';
+2 -2
View File
@@ -1,11 +1,11 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
const path = require('path');
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
const renderFanBox = (media) =>
art(path.join(__dirname, 'templates/fancybox.art'), {
+1 -1
View File
@@ -4,7 +4,7 @@ const md = require('markdown-it')({
html: true,
linkify: true,
});
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const id = ctx.req.param('id');
+1 -1
View File
@@ -1,7 +1,7 @@
import cache from '@/utils/cache';
import { load } from 'cheerio';
import got from '@/utils/got';
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import { parseDate } from '@/utils/parse-date';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
const { rootUrl, rootRSSUrl, title, categories, getInfo, processItems } = require('./util');
+1 -1
View File
@@ -4,7 +4,7 @@ import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
const path = require('path');
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
module.exports = async (ctx) => {
const category = ctx.req.param('category') ?? '-1';
+1 -1
View File
@@ -3,7 +3,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { art } from '@/utils/render';
const path = require('path');
const { isValidHost } = require('@/utils/valid-host');
import { isValidHost } from '@/utils/valid-host';
const shortcuts = {
potd: 'picture/browse/potd/',
+1 -1
View File
@@ -1,4 +1,4 @@
const buildData = require('@/utils/common-config');
import buildData from '@/utils/common-config';
module.exports = async (ctx) => {
let link;
+1 -1
View File
@@ -1,5 +1,5 @@
import got from '@/utils/got';
const { finishArticleItem } = require('@/utils/wechat-mp');
import { finishArticleItem } from '@/utils/wechat-mp';
import { load } from 'cheerio';
const utils = require('./utils');
import { config } from '@/config';
+1 -1
View File
@@ -3,7 +3,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
module.exports = async (ctx) => {
let language = '';
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
const { Client, isNotionClientError, APIErrorCode } = require('@notionhq/client');
const logger = require('@/utils/logger');
import logger from '@/utils/logger';
import { config } from '@/config';
import { parseDate } from '@/utils/parse-date';
import got from '@/utils/got';
+1 -1
View File
@@ -1,5 +1,5 @@
import cache from '@/utils/cache';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
import got from '@/utils/got';
import { load } from 'cheerio';
+1 -1
View File
@@ -3,7 +3,7 @@ import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
const { fetchArticle } = require('@/utils/wechat-mp');
import { fetchArticle } from '@/utils/wechat-mp';
const pageType = (href) => {
if (!href.startsWith('http')) {
+2 -2
View File
@@ -1,4 +1,4 @@
const puppeteerUtils = require('@/utils/puppeteer-utils');
import { getCookies } from '@/utils/puppeteer-utils';
import puppeteer from '@/utils/puppeteer';
/**
@@ -17,7 +17,7 @@ module.exports = async function getCookie(host) {
waitUntil: 'networkidle0',
});
const cookie = await puppeteerUtils.getCookies(page);
const cookie = await getCookies(page);
await browser.close();
return cookie;
};
+1 -1
View File
@@ -1,6 +1,6 @@
import cache from '@/utils/cache';
import got from '@/utils/got';
const parser = require('@/utils/rss-parser');
import parser from '@/utils/rss-parser';
const utils = require('./utils');
import { load } from 'cheerio';
import puppeteer from '@/utils/puppeteer';

Some files were not shown because too many files have changed in this diff Show More