hash
stringlengths 40
40
| date
stringdate 2018-04-19 20:42:56
2025-03-25 18:01:26
| author
stringlengths 1
23
| commit_message
stringlengths 9
121
| is_merge
bool 1
class | masked_commit_message
stringlengths 3
111
| type
stringclasses 10
values | git_diff
stringlengths 108
2.8M
|
|---|---|---|---|---|---|---|---|
bed9a34c99a494a64c8b59dbe785fa6698a95761
|
2019-12-19 14:45:23
|
WenryXu
|
feat: 新增人人都是产品经理 - 天天问 (#3596)
| false
|
新增人人都是产品经理 - 天天问 (#3596)
|
feat
|
diff --git a/docs/new-media.md b/docs/new-media.md
index 0aa980891f3438..707ebd59a41cd8 100644
--- a/docs/new-media.md
+++ b/docs/new-media.md
@@ -618,6 +618,10 @@ pageClass: routes
<Route author="WenryXu" example="/woshipm/popular" path="/woshipm/popular"/>
+### 天天问
+
+<Route author="WenryXu" example="/woshipm/wen" path="/woshipm/wen"/>
+
### 用户收藏
<Route author="LogicJake" example="/woshipm/bookmarks/324696" path="/woshipm/bookmarks/:id" :paramsDesc="['用户 id']"/>
diff --git a/lib/router.js b/lib/router.js
index a3a0037348ce68..2f21208e05f7f1 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -1133,6 +1133,7 @@ router.get('/dockerhub/build/:owner/:image/:tag?', require('./routes/dockerhub/b
// 人人都是产品经理
router.get('/woshipm/popular', require('./routes/woshipm/popular'));
+router.get('/woshipm/wen', require('./routes/woshipm/wen'));
router.get('/woshipm/bookmarks/:id', require('./routes/woshipm/bookmarks'));
router.get('/woshipm/user_article/:id', require('./routes/woshipm/user_article'));
diff --git a/lib/routes/woshipm/wen.js b/lib/routes/woshipm/wen.js
new file mode 100644
index 00000000000000..ad3951d11d9ff5
--- /dev/null
+++ b/lib/routes/woshipm/wen.js
@@ -0,0 +1,45 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const response = await got('https://wen.woshipm.com/m/main/indexNewData.html');
+ const $ = cheerio.load(response.data);
+ const postList = $('.article-list-item').get();
+ const result = await Promise.all(
+ postList.map(async (item) => {
+ const title = $(item)
+ .find('.went-head-text')
+ .text();
+ const link =
+ 'https://wen.woshipm.com/' +
+ $(item)
+ .find('.went-head')
+ .attr('href');
+ const pubDate = new Date().toUTCString();
+
+ const single = {
+ title: title,
+ link: link,
+ guid: link,
+ pubDate: pubDate,
+ description: '',
+ };
+
+ const key = link;
+ const value = await ctx.cache.get(key);
+
+ if (value) {
+ single.description = value;
+ } else {
+ const temp = await got(link);
+ const $ = cheerio.load(temp.data);
+ single.description = $('.wt-desc').html();
+
+ ctx.cache.set(key, single.description);
+ }
+
+ return Promise.resolve(single);
+ })
+ );
+ ctx.state.data = { title: '天天问 - 人人都是产品经理', link: 'http://wen.woshipm.com/', item: result };
+};
|
b334aa49bb8dcc4e5c425ac6162495bd290b7da4
|
2023-04-09 00:32:47
|
TonyRL
|
docs: fix advanced feed tips
| false
|
fix advanced feed tips
|
docs
|
diff --git a/docs/en/joinus/advanced-feed.md b/docs/en/joinus/advanced-feed.md
index 309c311d071af3..d3f380baf21a6c 100644
--- a/docs/en/joinus/advanced-feed.md
+++ b/docs/en/joinus/advanced-feed.md
@@ -138,7 +138,7 @@ ctx.state.data = {
By including these fields in your RSS feed, you'll be able to create podcast feeds that are compatible with many podcast players.
-::: info Further Reading
+::: tip Further Reading
- [A Podcaster’s Guide to RSS](https://help.apple.com/itc/podcasts_connect/#/itcb54353390)
- [RSS feed guidelines for Google Podcasts](https://support.google.com/podcast-publishers/answer/9889544)
diff --git a/docs/joinus/advanced-feed.md b/docs/joinus/advanced-feed.md
index c3696f7aa6ba79..495c0c91a024f9 100644
--- a/docs/joinus/advanced-feed.md
+++ b/docs/joinus/advanced-feed.md
@@ -138,7 +138,7 @@ ctx.state.data = {
通过在 RSS 源中包含这些字段,您将能够制作与播客播放器兼容的播客订阅源。
-::: info 进一步阅读
+::: tip 进一步阅读
- [A Podcaster’s Guide to RSS](https://help.apple.com/itc/podcasts_connect/#/itcb54353390)
- [Google 播客的 RSS Feed 指南](https://support.google.com/podcast-publishers/answer/9889544)
|
4c0925157f97b662999a5ba80b8e6c3dfd3596ce
|
2024-12-02 09:03:35
|
pseudoyu
|
feat(route/qingting): return first page program instead of 10
| false
|
return first page program instead of 10
|
feat
|
diff --git a/lib/routes/qingting/channel.ts b/lib/routes/qingting/channel.ts
index 27c08b96c768af..8833715da67f22 100644
--- a/lib/routes/qingting/channel.ts
+++ b/lib/routes/qingting/channel.ts
@@ -1,6 +1,6 @@
import { Route } from '@/types';
import cache from '@/utils/cache';
-import got from '@/utils/got';
+import ofetch from '@/utils/ofetch';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
@@ -18,18 +18,18 @@ export const route: Route = {
supportScihub: false,
},
name: '专辑',
- maintainers: ['nczitzk'],
+ maintainers: ['nczitzk', 'pseudoyu'],
handler,
};
async function handler(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;
- const programUrl = `https://i.qingting.fm/capi/channel/${ctx.req.param('id')}/programs/${response.data.data.v}?curpage=1&pagesize=10&order=asc`;
- response = await got(programUrl);
+ let response = await ofetch(channelUrl);
+ const title = response.data.title;
+ const programUrl = `https://i.qingting.fm/capi/channel/${ctx.req.param('id')}/programs/${response.data.v}?curpage=1&order=asc`;
+ response = await ofetch(programUrl);
- const items = response.data.data.programs.map((item) => ({
+ const items = response.data.programs.map((item) => ({
title: item.title,
link: `https://www.qingting.fm/channels/${ctx.req.param('id')}/programs/${item.id}/`,
pubDate: timezone(parseDate(item.update_time), +8),
@@ -41,8 +41,8 @@ async function handler(ctx) {
item: await Promise.all(
items.map((item) =>
cache.tryGet(item.link, async () => {
- response = await got(item.link);
- const data = JSON.parse(response.data.match(/},"program":(.*?),"plist":/)[1]);
+ response = await ofetch(item.link);
+ const data = JSON.parse(response.match(/},"program":(.*?),"plist":/)[1]);
item.description = data.richtext;
return item;
})
diff --git a/lib/routes/qingting/podcast.ts b/lib/routes/qingting/podcast.ts
index 17d1c6b4bab23a..5df881379fcd6d 100644
--- a/lib/routes/qingting/podcast.ts
+++ b/lib/routes/qingting/podcast.ts
@@ -1,7 +1,7 @@
import type { DataItem, Route } from '@/types';
import cache from '@/utils/cache';
import crypto from 'crypto';
-import got from '@/utils/got';
+import ofetch from '@/utils/ofetch';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { config } from '@/config';
@@ -29,7 +29,7 @@ export const route: Route = {
},
],
name: '播客',
- maintainers: ['RookieZoe', 'huyyi'],
+ maintainers: ['RookieZoe', 'huyyi', 'pseudoyu'],
handler,
description: `获取的播放 URL 有效期只有 1 天,需要开启播客 APP 的自动下载功能。`,
};
@@ -44,35 +44,27 @@ async function handler(ctx) {
const channelId = ctx.req.param('id');
const channelUrl = `https://i.qingting.fm/capi/v3/channel/${channelId}`;
- const response = await got({
- method: 'get',
- url: channelUrl,
+ const response = await ofetch(channelUrl, {
headers: {
Referer: 'https://www.qingting.fm/',
},
});
- const title = response.data.data.title;
- const channel_img = response.data.data.thumbs['400_thumb'];
- const authors = response.data.data.podcasters.map((author) => author.nick_name).join(',');
- const desc = response.data.data.description;
- const programUrl = `https://i.qingting.fm/capi/channel/${channelId}/programs/${response.data.data.v}?curpage=1&pagesize=10&order=asc`;
+ const title = response.data.title;
+ const channel_img = response.data.thumbs['400_thumb'];
+ const authors = response.data.podcasters.map((author) => author.nick_name).join(',');
+ const desc = response.data.description;
+ const programUrl = `https://i.qingting.fm/capi/channel/${channelId}/programs/${response.data.v}?curpage=1&pagesize=10&order=asc`;
const {
- data: {
- data: { programs },
- },
- } = await got({
- method: 'get',
- url: programUrl,
+ data: { programs },
+ } = await ofetch(programUrl, {
headers: {
Referer: 'https://www.qingting.fm/',
},
});
- const {
- data: { data: channelInfo },
- } = await got(`https://i.qingting.fm/capi/v3/channel/${channelId}?user_id=${qingtingId}`);
+ const { data: channelInfo } = await ofetch(`https://i.qingting.fm/capi/v3/channel/${channelId}?user_id=${qingtingId}`);
const isCharged = channelInfo.purchase?.item_type !== 0;
@@ -83,15 +75,13 @@ async function handler(ctx) {
const data = (await cache.tryGet(`qingting:podcast:${channelId}:${item.id}`, async () => {
const link = `https://www.qingting.fm/channels/${channelId}/programs/${item.id}/`;
- const detailRes = await got({
- method: 'get',
- url: link,
+ const detailRes = await ofetch(link, {
headers: {
Referer: 'https://www.qingting.fm/',
},
});
- const detail = JSON.parse(detailRes.data.match(/},"program":(.*?),"plist":/)[1]);
+ const detail = JSON.parse(detailRes.match(/},"program":(.*?),"plist":/)[1]);
const rssItem = {
title: item.title,
|
121763bb6d2c434bc41b0e36146fb85a3ce51f29
|
2023-08-30 21:48:48
|
JimenezLi
|
feat(core): add logger timestamp (#13165)
| false
|
add logger timestamp (#13165)
|
feat
|
diff --git a/lib/config.js b/lib/config.js
index 4e76cf06d8118f..d435c4e50e0dd4 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -94,6 +94,7 @@ const calculateValue = () => {
debugInfo: envs.DEBUG_INFO || 'true',
loggerLevel: envs.LOGGER_LEVEL || 'info',
noLogfiles: envs.NO_LOGFILES,
+ showLoggerTimestamp: envs.SHOW_LOGGER_TIMESTAMP,
sentry: {
dsn: envs.SENTRY,
routeTimeout: parseInt(envs.SENTRY_ROUTE_TIMEOUT) || 30000,
diff --git a/lib/utils/logger.js b/lib/utils/logger.js
index 6b9136ccc39ae7..c92e4f13dfe644 100644
--- a/lib/utils/logger.js
+++ b/lib/utils/logger.js
@@ -14,7 +14,16 @@ if (!config.noLogfiles) {
}
const logger = winston.createLogger({
level: config.loggerLevel,
- format: winston.format.json(),
+ format: winston.format.combine(
+ winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' }),
+ winston.format.printf((info) =>
+ JSON.stringify({
+ timestamp: info.timestamp,
+ level: info.level,
+ message: info.message,
+ })
+ )
+ ),
transports,
});
@@ -25,7 +34,10 @@ const logger = winston.createLogger({
if (!config.isPackage) {
logger.add(
new winston.transports.Console({
- format: winston.format.combine(winston.format.colorize(), winston.format.simple()),
+ format: winston.format.printf((info) => {
+ const infoLevel = winston.format.colorize().colorize(info.level, config.showLoggerTimestamp ? `[${info.timestamp}] ${info.level}` : info.level);
+ return `${infoLevel}: ${info.message}`;
+ }),
silent: process.env.NODE_ENV === 'test',
})
);
diff --git a/website/docs/install/README.md b/website/docs/install/README.md
index ea25ad0e7e2d6c..d45c831d237c33 100644
--- a/website/docs/install/README.md
+++ b/website/docs/install/README.md
@@ -677,6 +677,8 @@ See the relation between access key/code and white/blacklisting.
`NO_LOGFILES`: disable logging to log files, default to `false`
+`SHOW_LOGGER_TIMESTAMP`: Show timestamp in log, default to `false`
+
`SENTRY`: [Sentry](https://sentry.io) dsn, used for error tracking
`SENTRY_ROUTE_TIMEOUT`: Report Sentry if route execution takes more than this milliseconds, default to `3000`
diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md
index 6244cdb0af95f6..fb04235912a261 100644
--- a/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md
+++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md
@@ -672,6 +672,8 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行
`NO_LOGFILES`: 是否禁用日志文件输出,默认 `false`
+`SHOW_LOGGER_TIMESTAMP`: 在控制台输出中显示日志时间戳,默认 `false`
+
`SENTRY`: [Sentry](https://sentry.io) dsn,用于错误追踪
`SENTRY_ROUTE_TIMEOUT`: 路由耗时超过此毫秒值上报 Sentry,默认 `3000`
|
01ca8a755b736a1c79410aa679bccfe4e93738e0
|
2019-07-15 09:19:55
|
renovate[bot]
|
chore(deps): update dependency nock to v11.0.0-beta.24 (#2619)
| false
|
update dependency nock to v11.0.0-beta.24 (#2619)
|
chore
|
diff --git a/package.json b/package.json
index 2801df8f7230bc..e71e38f2db8457 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,7 @@
"eslint-plugin-prettier": "3.1.0",
"jest": "24.8.0",
"mockdate": "2.0.3",
- "nock": "11.0.0-beta.23",
+ "nock": "11.0.0-beta.24",
"nodemon": "1.19.1",
"pinyin": "2.9.0",
"prettier": "1.18.2",
diff --git a/yarn.lock b/yarn.lock
index cb2f827b1af81f..a240b6e628fe8c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6910,10 +6910,10 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"
[email protected]:
- version "11.0.0-beta.23"
- resolved "https://registry.yarnpkg.com/nock/-/nock-11.0.0-beta.23.tgz#e18d1d9b11e7444f8a4925331f5f4b6172b770e4"
- integrity sha512-D03++S4wWPxqM3XUXaHTvU9TrwjypaSrroVK1k7CT3w95i93js2TUwZ3KvR08pbmO23bG747RK4LVl7vEemteQ==
[email protected]:
+ version "11.0.0-beta.24"
+ resolved "https://registry.yarnpkg.com/nock/-/nock-11.0.0-beta.24.tgz#cb6b8a06c08be4b8238df932b4c52aa0911e35dc"
+ integrity sha512-upcZWT+jQ3gZGYgn3uW+zA0OjfPemHU+l4quyZvwvjKd6UxB7fUQJmrTF6qNvO+MmZtq5QSjfqCHyHQz9oj0rw==
dependencies:
chai "^4.1.2"
debug "^4.1.0"
|
7ef0be848f522861dbffd62dbf8b09708450dda4
|
2024-10-31 22:37:28
|
liyaozhong
|
feat(route): add enterprisecraftsmanship (#17371)
| false
|
add enterprisecraftsmanship (#17371)
|
feat
|
diff --git a/lib/routes/enterprisecraftsmanship/index.ts b/lib/routes/enterprisecraftsmanship/index.ts
new file mode 100644
index 00000000000000..044571c253b994
--- /dev/null
+++ b/lib/routes/enterprisecraftsmanship/index.ts
@@ -0,0 +1,74 @@
+import { Route } from '@/types';
+import got from '@/utils/got';
+import { load } from 'cheerio';
+import logger from '@/utils/logger';
+import { parseDate } from '@/utils/parse-date';
+import cache from '@/utils/cache';
+
+export const route: Route = {
+ path: '/archives',
+ categories: ['blog'],
+ example: '/enterprisecraftsmanship/archives',
+ radar: [
+ {
+ source: ['enterprisecraftsmanship.com/archives/'],
+ },
+ ],
+ url: 'enterprisecraftsmanship.com/',
+ name: 'Archives',
+ maintainers: ['liyaozhong'],
+ handler,
+ description: 'Enterprise Craftsmanship blog archives',
+};
+
+async function handler() {
+ const rootUrl = 'https://enterprisecraftsmanship.com';
+ const currentUrl = `${rootUrl}/archives`;
+
+ const response = await got(currentUrl);
+
+ const $ = load(response.data);
+
+ let items = $('.postIndexItem')
+ .toArray()
+ .map((item) => {
+ const $item = $(item);
+ const title = $item.find('.title a').text().trim();
+ const link = new URL($item.find('.title a').attr('href'), currentUrl).href;
+ const dateStr = $item.find('.date').text().trim();
+ const pubDate = parseDate(dateStr);
+
+ return {
+ title,
+ link,
+ pubDate,
+ };
+ });
+
+ items = await Promise.all(
+ items.map((item) =>
+ cache.tryGet(item.link, async () => {
+ try {
+ const detailResponse = await got(item.link);
+ const $detail = load(detailResponse.data);
+
+ // 获取 .post 内容,但排除 .post-info
+ const $post = $detail('.post');
+ $post.find('.post-info').remove();
+ item.description = $post.html();
+
+ return item;
+ } catch (error) {
+ logger.error(`处理文章 ${item.link} 时发生错误: ${error}`);
+ return item;
+ }
+ })
+ )
+ );
+
+ return {
+ title: 'Enterprise Craftsmanship - Archives',
+ link: currentUrl,
+ item: items,
+ };
+}
diff --git a/lib/routes/enterprisecraftsmanship/namespace.ts b/lib/routes/enterprisecraftsmanship/namespace.ts
new file mode 100644
index 00000000000000..3bf4dfa48f3eba
--- /dev/null
+++ b/lib/routes/enterprisecraftsmanship/namespace.ts
@@ -0,0 +1,6 @@
+import type { Namespace } from '@/types';
+
+export const namespace: Namespace = {
+ name: 'Enterprise Craftsmanship',
+ url: 'enterprisecraftsmanship.com',
+};
|
e8beb4029c6ee45b2cc3c6624674ff4e3f94101a
|
2021-01-25 15:33:06
|
DIYgod
|
chore: fix dependabot ci error
| false
|
fix dependabot ci error
|
chore
|
diff --git a/scripts/workflow/test-route/identify.js b/scripts/workflow/test-route/identify.js
index 1348642f64de21..2a81f548e6ed63 100644
--- a/scripts/workflow/test-route/identify.js
+++ b/scripts/workflow/test-route/identify.js
@@ -1,6 +1,7 @@
const noFound = 'Auto: Route No Found';
module.exports = async ({ github, context, core }, body, number) => {
+ core.debug(`sender: ${context.payload.sender.login}`);
core.debug(`body: ${body}`);
const m = body.match(/```routes\r\n((.|\r\n)*)```/);
core.debug(`match: ${m}`);
@@ -22,7 +23,7 @@ module.exports = async ({ github, context, core }, body, number) => {
res = m[1].trim().split('\r\n');
core.info(`routes detected: ${res}`);
- if (res.length > 0 && res[0] === 'NOROUTE') {
+ if ((res.length > 0 && res[0] === 'NOROUTE') || context.payload.sender.login === 'dependabot-preview') {
core.info('PR stated no route, passing');
await removeLabel();
await github.issues
|
eecf84bdf817f9b369befdc5608475ba6ec11fca
|
2020-07-16 22:37:53
|
dependabot-preview[bot]
|
chore(deps): bump got from 11.5.0 to 11.5.1
| false
|
bump got from 11.5.0 to 11.5.1
|
chore
|
diff --git a/package.json b/package.json
index 04bd631427c644..2c66d03f216aaf 100644
--- a/package.json
+++ b/package.json
@@ -81,7 +81,7 @@
"fanfou-sdk": "4.1.0",
"git-rev-sync": "2.0.0",
"googleapis": "54.1.0",
- "got": "11.5.0",
+ "got": "11.5.1",
"he": "1.2.0",
"hooman": "1.2.5",
"https-proxy-agent": "5.0.0",
diff --git a/yarn.lock b/yarn.lock
index 9e6720da3dd958..52fcf183807ecf 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5792,10 +5792,10 @@ [email protected]:
google-auth-library "^6.0.0"
googleapis-common "^4.4.0"
[email protected]:
- version "11.5.0"
- resolved "https://registry.yarnpkg.com/got/-/got-11.5.0.tgz#55dd61050f666679f46c49c877e1b2e064a7a523"
- integrity sha512-vOZEcEaK0b6x11uniY0HcblZObKPRO75Jvz53VKuqGSaKCM/zEt0sj2LGYVdqDYJzO3wYdG+FPQQ1hsgoXy7vQ==
[email protected]:
+ version "11.5.1"
+ resolved "https://registry.yarnpkg.com/got/-/got-11.5.1.tgz#bf098a270fe80b3fb88ffd5a043a59ebb0a391db"
+ integrity sha512-reQEZcEBMTGnujmQ+Wm97mJs/OK6INtO6HmLI+xt3+9CvnRwWjXutUvb2mqr+Ao4Lu05Rx6+udx9sOQAmExMxA==
dependencies:
"@sindresorhus/is" "^3.0.0"
"@szmarczak/http-timer" "^4.0.5"
@@ -5804,7 +5804,7 @@ [email protected]:
cacheable-lookup "^5.0.3"
cacheable-request "^7.0.1"
decompress-response "^6.0.0"
- http2-wrapper "^1.0.0-beta.4.8"
+ http2-wrapper "^1.0.0-beta.5.0"
lowercase-keys "^2.0.0"
p-cancelable "^2.0.0"
responselike "^2.0.0"
@@ -6200,10 +6200,10 @@ http-signature@~1.2.0:
jsprim "^1.2.2"
sshpk "^1.7.0"
-http2-wrapper@^1.0.0-beta.4.8:
- version "1.0.0-beta.4.8"
- resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.0-beta.4.8.tgz#d3285f7421d7795f9dbcd4b57d92a2f73c0d958d"
- integrity sha512-3XyRMia2QMy59nbxvXNX+57opqcy7/GlkJEaB7uRNw+TZw6mOiK3936IO83mVy7mzCttE66Cy9QEZ/xPXYmoCQ==
+http2-wrapper@^1.0.0-beta.5.0:
+ version "1.0.0-beta.5.2"
+ resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.0-beta.5.2.tgz#8b923deb90144aea65cf834b016a340fc98556f3"
+ integrity sha512-xYz9goEyBnC8XwXDTuC/MZ6t+MrKVQZOk4s7+PaDkwIsQd8IwqvM+0M6bA/2lvG8GHXcPdf+MejTUeO2LCPCeQ==
dependencies:
quick-lru "^5.1.1"
resolve-alpn "^1.0.0"
|
c1fbc64255841815f56f578731e984e78ef71276
|
2022-05-04 03:38:10
|
Rongrong
|
chore(*): detailed info for PR route test (#9689)
| false
|
detailed info for PR route test (#9689)
|
chore
|
diff --git a/.github/workflows/pr-deploy-route-test.yml b/.github/workflows/pr-deploy-route-test.yml
index ffe99c9060fd74..3517a5dd0f00b1 100644
--- a/.github/workflows/pr-deploy-route-test.yml
+++ b/.github/workflows/pr-deploy-route-test.yml
@@ -58,7 +58,7 @@ jobs:
run: |
set -ex
gzip -cvd docker-image/rsshub.tar.gz | docker load
- docker run -d -p 1200:1200 rsshub:latest
+ docker run -d --name rsshub -e NODE_ENV=dev -p 1200:1200 rsshub:latest
- uses: actions/setup-node@v3 # just need its cache
if: (env.TEST_CONTINUE)
@@ -88,3 +88,7 @@ jobs:
const got = require("got");
const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/workflow/test-route/test.js`)
return await script({ github, context, core, got }, link, routes, number)
+
+ - name: Print Docker container logs
+ if: (env.TEST_CONTINUE)
+ run: docker logs rsshub # logs/combined.log? Not so readable...
diff --git a/scripts/workflow/test-route/test.js b/scripts/workflow/test-route/test.js
index dde6b82eb21cbb..3e28c9f04b1465 100644
--- a/scripts/workflow/test-route/test.js
+++ b/scripts/workflow/test-route/test.js
@@ -10,18 +10,27 @@ module.exports = async ({ github, context, core, got }, baseUrl, routes, number)
return `${baseUrl}${l}`;
});
- let com = 'Successfully generated as following:\n\n';
+ let com = `Successfully [generated](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) as following:\n\n`;
for (const lks of links) {
core.info(`testing route: ${lks}`);
// Intended, one at a time
const res = await got(lks).catch((err) => {
+ let errMsg = err.toString();
+ const errInfoList = err.response && err.response.body && err.response.body.match(/(?<=<pre class="message">)(.+?)(?=<\/pre>)/gs);
+ if (errInfoList) {
+ errMsg += '\n\n';
+ errMsg += errInfoList
+ .slice(0, 3)
+ .map((e) => e.trim())
+ .join('\n');
+ }
com += `
<details>
<summary><a href="${lks}">${lks}</a> - <b>Failed</b></summary>
\`\`\`
-${err}
+${errMsg}
\`\`\`
</details>
|
9531b268c9cf9272ed0b585f47ea06e7e726e2b2
|
2019-10-02 08:42:56
|
dependabot-preview[bot]
|
chore(deps-dev): bump cross-env from 6.0.0 to 6.0.2
| false
|
bump cross-env from 6.0.0 to 6.0.2
|
chore
|
diff --git a/package.json b/package.json
index 10a69000e71a9b..ea0373edcf4350 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,7 @@
"@vuepress/plugin-back-to-top": "1.1.0",
"@vuepress/plugin-google-analytics": "1.1.0",
"@vuepress/plugin-pwa": "1.1.0",
- "cross-env": "6.0.0",
+ "cross-env": "6.0.2",
"eslint": "6.5.1",
"eslint-config-prettier": "6.3.0",
"eslint-plugin-prettier": "3.1.1",
diff --git a/yarn.lock b/yarn.lock
index ff078b84d69f4a..49c4f3ccae1c0c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -627,10 +627,10 @@
core-js "^2.6.5"
regenerator-runtime "^0.13.2"
-"@babel/runtime@^7.0.0", "@babel/runtime@^7.3.4":
- version "7.4.5"
- resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12"
- integrity sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==
+"@babel/runtime@^7.0.0", "@babel/runtime@^7.3.4", "@babel/runtime@^7.6.2":
+ version "7.6.2"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.6.2.tgz#c3d6e41b304ef10dcf13777a33e7694ec4a9a6dd"
+ integrity sha512-EXxN64agfUqqIGeEjI5dL5z0Sw0ZwWo1mLTi4mQowCZ42O59b7DRpZAnTC6OqdF28wMBMFKNb/4uFGrVaigSpg==
dependencies:
regenerator-runtime "^0.13.2"
@@ -3119,11 +3119,12 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
[email protected]:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-6.0.0.tgz#3c8e71440ea20aa6faaf5aec541235efc565dac6"
- integrity sha512-G/B6gtkjgthT8AP/xN1wdj5Xe18fVyk58JepK8GxpUbqcz3hyWxegocMbvnZK+KoTslwd0ACZ3woi/DVUdVjyQ==
[email protected]:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-6.0.2.tgz#2ec3c4b9b90cc074fed375415fc229cb7d6ce612"
+ integrity sha512-lA44HlqWCzrv7/l2pY3sfLDvMhXXhx8oztvD6rg34PdCIcP0yk77UwOL2nacsZXlrzPUMtbfagVbK6Itx8pwng==
dependencies:
+ "@babel/runtime" "^7.6.2"
cross-spawn "^7.0.0"
cross-spawn@^5.0.1:
|
39af963b3c3fa3ec63f0a10903ec86b1ebb3a530
|
2024-05-24 10:59:49
|
dependabot[bot]
|
chore(deps): bump @sentry/node from 7.114.0 to 8.3.0 (#15675)
| false
|
bump @sentry/node from 7.114.0 to 8.3.0 (#15675)
|
chore
|
diff --git a/lib/errors/index.tsx b/lib/errors/index.tsx
index 56ba079e455fc3..dd996a7f4fdce8 100644
--- a/lib/errors/index.tsx
+++ b/lib/errors/index.tsx
@@ -1,7 +1,7 @@
import { type NotFoundHandler, type ErrorHandler } from 'hono';
import { getDebugInfo, setDebugInfo } from '@/utils/debug-info';
import { config } from '@/config';
-import Sentry from '@sentry/node';
+import * as Sentry from '@sentry/node';
import logger from '@/utils/logger';
import Error from '@/views/error';
diff --git a/package.json b/package.json
index a5748f85055cba..3325b591d82ae9 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,7 @@
"@hono/zod-openapi": "0.13.0",
"@notionhq/client": "2.2.15",
"@postlight/parser": "2.2.3",
- "@sentry/node": "7.114.0",
+ "@sentry/node": "8.3.0",
"@tonyrl/rand-user-agent": "2.0.64",
"aes-js": "3.1.2",
"art-template": "4.13.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 09fd0a840dc9b1..361c875186a32b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -24,8 +24,8 @@ importers:
specifier: 2.2.3
version: 2.2.3
'@sentry/node':
- specifier: 7.114.0
- version: 7.114.0
+ specifier: 8.3.0
+ version: 8.3.0
'@tonyrl/rand-user-agent':
specifier: 2.0.64
version: 2.0.64
@@ -1321,6 +1321,154 @@ packages:
'@open-draft/[email protected]':
resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==}
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==}
+ engines: {node: '>=14'}
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==}
+ engines: {node: '>=8.0.0'}
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-R5r6DO4kgEOVBxFXhXjwospLQkv+sYxwCfjvoZBe7Zm6KKXAV9kDSJhi/D1BweowdZmO+sdbENLs374gER8hpQ==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.0.0 <1.9.0'
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.0.0 <1.9.0'
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-k9++bmJZ9zDEs3u3DnKTn2l7QTiNFg3gPx7G9rW0TPnP+xZoBSBTrEcGYBaqflQlrFG23Q58+X1sM2ayWPv5Fg==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-AG8U7z7D0JcBu/7dDcwb47UMEzj9/FMiJV2iQZqrsZnxR3FjB9J9oIH2iszJYci2eUdp2WbdvtpD9RV/zmME5A==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-3Nfm43PI0I+3EX+1YbSy6xbDu276R1Dh1tqAk68yd4yirnIh52Kd5B+nJ8CgHA7o3UKakpBjj6vSzi5vNCzJIA==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-LVRdEHWACWOczv2imD+mhUrLMxsEjPPi32vIZJT57zygR5aUiA4em8X3aiGOCycgbMWkIu8xOSGSxdx3JmzN+w==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-ZcOqEuwuutTDYIjhDIStix22ECblG/i9pHje23QGs4Q4YS4RMaZ5hKCoQJxW88Z4K7T53rQkdISmoXFKDV8xMg==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-6b3nZnFFEz/3xZ6w8bVxctPUWIPWiXuPQ725530JgxnN1cvYFd8CJ75PrHZNjynmzSSnqBkN3ef4R9N+RpMh8Q==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-Jv/fH7KhpWe4KBirsiqeUJIYrsdR2iu2l4nWhfOlRvaZ+zYIiLEzTQR6QhBbyRoAbU4OuYJzjWusOmmpGBnwng==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-dJc3H/bKMcgUYcQpLF+1IbmUKus0e5Fnn/+ru/3voIRHwMADT3rFSUcGLWSczkg68BCgz0vFWGDTvPtcWIFr7A==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-bMKej7Y76QVUD3l55Q9YqizXybHUzF3pujsBFjqbZrRn2WYqtsDtTUlbCK7fvXNPwFInqZ2KhnTqd0gwo8MzaQ==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-zaeiasdnRjXe6VhYCBMdkmAVh1S5MmXC/0spet+yqoaViGnYst/DOxPvhwg3yT4Yag5crZNWsVXnA538UjP6Ow==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-qkpHMgWSDTYVB1vlZ9sspf7l2wdS5DDq/rbIepDwX5BA0N0068JTQqh0CgAh34tdFqSCnWXIhcyOXC2TtRb0sg==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-+iBAawUaTfX/HAlvySwozx0C2B6LBfNPXX1W8Z2On1Uva33AGkw2UjL9XgIg1Pj4eLZ9R4EoJ/aFz+Xj4E/7Fw==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-ebYQjHZEmGHWEALwwDGhSQVLBaurFnuLIkZD5igPXrt7ohfF4lc5/4al1LO+vKc0NHk8SJWStuRueT86ISA8Vg==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-BSlhpivzBD77meQNZY9fS4aKgydA8AJBzv2dqvxXFy/Hq64b7HURgw/ztbmwFeYwdF5raZZUifiiNSMLpOJoSA==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-S1uHE+sxaepgp+t8lvIDuRgyjJWisAb733198kwQTUc9ZtYQ2V2gmyCtR1x21ePGVLoMiX/NWY7WA290hwkjJQ==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-JIrvhpgqY6437QIqToyozrUG1h5UhwHkaGK/WAX+fkrpyPtc+RO5FkRtUd9BH0MibabHHvqsnBGKfKVijbmp8w==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.3.0
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==}
+ engines: {node: '>=14'}
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.0.0 <1.9.0'
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.3.0 <1.9.0'
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.0.0 <1.9.0'
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==}
+ engines: {node: '>=14'}
+
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.1.0
+
'@otplib/[email protected]':
resolution: {integrity: sha512-4sGntwbA/AC+SbPhbsziRiD+jNDdIzsZ3JUyfZwjtKyc/wufl1pnSIaG4Uqx8ymPagujub0o92kgBnB89cuAMA==}
@@ -1368,6 +1516,9 @@ packages:
'@postman/[email protected]':
resolution: {integrity: sha512-k57fzmAZ2PJGxfOA4SGR05ejorHbVAa/84Hxh/2nAztjNXc4ZjOm9NUIk6/Z6LCrBvJZqjRZbN8e/nROVUPVdg==}
+ '@prisma/[email protected]':
+ resolution: {integrity: sha512-DeybWvIZzu/mUsOYP9MVd6AyBj+MP7xIMrcuIn25MX8FiQX39QBnET5KhszTAip/ToctUuDwSJ46QkIoyo3RFA==}
+
'@puppeteer/[email protected]':
resolution: {integrity: sha512-MC7LxpcBtdfTbzwARXIkqGZ1Osn3nnZJlm+i0+VqHl72t//Xwl9wICrXT8BwtgC6s1xJNHsxOpvzISUqe92+sw==}
engines: {node: '>=18'}
@@ -1463,29 +1614,31 @@ packages:
'@selderee/[email protected]':
resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==}
- '@sentry-internal/[email protected]':
- resolution: {integrity: sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg==}
- engines: {node: '>=8'}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-X7r0WujE7DILtgA5zt4hmHMBTF3xbjJB7Dgrw1Hv5C7WG5qkNqhDPpnRX7WswtHcLSgVPY2GRTQ5Iid7i33zEQ==}
+ engines: {node: '>=14.18'}
- '@sentry/[email protected]':
- resolution: {integrity: sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==}
- engines: {node: '>=8'}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-7uAQoO/xUoKuWdjbI44IeNOrEPgRtwyn/RI5apN/JsrCoQUA1Z7wxtIwHRyrIt9jfguHUq9iKRM03S6iVayqkg==}
+ engines: {node: '>=14.18'}
- '@sentry/[email protected]':
- resolution: {integrity: sha512-BJIBWXGKeIH0ifd7goxOS29fBA8BkEgVVCahs6xIOXBjX1IRS6PmX0zYx/GP23nQTfhJiubv2XPzoYOlZZmDxg==}
- engines: {node: '>=8'}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-VyvLM5JQryCjRtu5NENuGui9VXMY5ZZ948oY8dEUEfvX8SeOq0XhBp440XTgu2Nku62IwnwAp/m4auhiZ2rR/w==}
+ engines: {node: '>=14.18'}
+ peerDependencies:
+ '@opentelemetry/api': ^1.8.0
+ '@opentelemetry/core': ^1.24.1
+ '@opentelemetry/instrumentation': ^0.51.1
+ '@opentelemetry/sdk-trace-base': ^1.23.0
+ '@opentelemetry/semantic-conventions': ^1.23.0
- '@sentry/[email protected]':
- resolution: {integrity: sha512-cqvi+OHV1Hj64mIGHoZtLgwrh1BG6ntcRjDLlVNMqml5rdTRD3TvG21579FtlqHlwZpbpF7K5xkwl8e5KL2hGw==}
- engines: {node: '>=8'}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-DbwRTdx5xn8c2EhElD1UneDbcfqz220INPJYiATGJ9pR+cV5kGohyxI6lJxebPdPhPLEFQqYdLXGA6Cjm/uC6A==}
+ engines: {node: '>=14.18'}
- '@sentry/[email protected]':
- resolution: {integrity: sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==}
- engines: {node: '>=8'}
-
- '@sentry/[email protected]':
- resolution: {integrity: sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==}
- engines: {node: '>=8'}
+ '@sentry/[email protected]':
+ resolution: {integrity: sha512-WFaUZy0OWsF6Mrjenxj4N8zGzA6+pdH2lCV60/IB+V5PvGPgl40MUyjN6aLA/E9BRpqwLNQRMroZjln+J/3aiA==}
+ engines: {node: '>=14.18'}
'@sinclair/[email protected]':
resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
@@ -1538,6 +1691,9 @@ packages:
'@tootallnate/[email protected]':
resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==}
+
'@types/[email protected]':
resolution: {integrity: sha512-v3D66IptpUqh+pHKVNRxY8yvp2ESSZXe0rTzsGdzUhEwag7ljVfgCllkWv2YgiYXDhWFBrEywll4A5JToyTNFA==}
@@ -1547,18 +1703,33 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==}
+
'@types/[email protected]':
resolution: {integrity: sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==}
'@types/[email protected]':
resolution: {integrity: sha512-V+pm3stv1Mvz8fSKJJod6CglNGVqEQ6OyuqitoDkWywEODM/eJd1eSuIp9xt6DrX8BWZ2eDSIzbw1tPCUTvGbQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-QVSSvno3dE0MgO76pJhmv4Qyi/j0Yk9pBp0Y7TJ2Tlj+KCgJWY6qX7nnxCOLkZ3VYRSIk1WTxCvwUSdx6CCLdg==}
+
'@types/[email protected]':
resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==}
'@types/[email protected]':
resolution: {integrity: sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-40Zk8qR147RABiQ7NQnBzWzDcjKzNrntB5BAmeGCb2p/MIyOE+4BVvc17wumsUqUw00bJYqoXFHYygQnEFh4/Q==}
+
'@types/[email protected]':
resolution: {integrity: sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==}
@@ -1577,15 +1748,27 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-QYHv9Yeh1ZYSMPQOoxY4XC4F1r+xRUiAriB303F4G6uBsT3KKX60DjiogvVv+2VISVDuJhcIzMdbjT+Bm938QQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-ej0phymbFLoCB26dbbq5PGScsf2JAJ4IJHjG10LalgUV36XKTmA4GdA+PVllKvRk0sEKt64X8975qFnkSi0hqA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==}
+
'@types/[email protected]':
resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==}
'@types/[email protected]':
resolution: {integrity: sha512-pUY3cKH/Nm2yYrEmDlPR1mR7yszjGx4DrwPjQ702C4/D5CwHuZTgZdIdwPkRbcuhs7BAh2L5rg3CL5cbRiGTCQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-4+tE/lwdAahgZT1g30Jkdm9PzFRde0xwxBNUyRsCitRvCQB90iuA2uJYdUnhnANRcqGXaWOGY4FEoxeElNAK2g==}
+
'@types/[email protected]':
resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==}
+
'@types/[email protected]':
resolution: {integrity: sha512-BoWZUoMktji2YJmkRY8z0KsjvyDNpBzeC/rLVMFKcHkPxaKp+SHBFfx/kj7ltKh3l010Lc9RZqnJs8KUMNhf6Q==}
@@ -1607,6 +1790,18 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-vvVHLrXxoUZgBWTcJnTMSC4FAQcG2loK7N1Uy20I3nr/aUhetbGdfuwSzXkrMoll2RoYKW0IcMIN0I0bwMwVMQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-DTDUyznHGNHAl+wd1n0z1jxNajduyTh8R53xoewuerdBzGo6Ogj6F2299BFtrexJw4NtgjsI5SMPCmV9gZwGXA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-5YUJVv6NwM1z7m6FuYpKfNLTZ932Z6EF6xy2BbtpJSyn13DKNQEkXVffFVSnJHxvwwWh2SAeumpjAYUELqgjyw==}
+
'@types/[email protected]':
resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==}
@@ -1628,6 +1823,9 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==}
+
'@types/[email protected]':
resolution: {integrity: sha512-5+G/QXO/DvHZw60FjvbDzO4JmlD/nG5m2/vVGt25VN1eeP3w2bCoks1Wa7VuptMPM1TxJdx6RjO70N9Fw0nZPA==}
@@ -1637,6 +1835,9 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-wK1pzsJVVAjYCSZWQoWHziQZbNggXFDUEIGf54g4ZM/ERuP86uGdWeKZWMYlqTPMZfHJJvLPyogXGvCOg87yLQ==}
+
'@types/[email protected]':
resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==}
@@ -1646,6 +1847,18 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-qZAvkv1K3QbmHHFYSNRYPkRjOWRLBYrL4B9c+wG0GSVGBw0NtJwPcgx/DSddeDJvRGMHCEQ4VMEVfuJ/0gZ3XQ==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==}
+
'@types/[email protected]':
resolution: {integrity: sha512-qVcP9Fuzh9oaAh8oPxiSoWMFGnWKkJDknnij66vi09Yiy62bsSDqtd+fG5kIM9wLLgZsRP3Y6acqj9O/v2ZtRw==}
@@ -1655,6 +1868,15 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-7oxPGNQHXLHE48r/r/qjn7q0hlrs3kL7oZnGj0Wf/h9tj/6ibFyRkNbsDxaBBZ4XUZ0Dx5LGCyDJ04ytSofacQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww==}
+
'@types/[email protected]':
resolution: {integrity: sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==}
@@ -1785,6 +2007,11 @@ packages:
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
engines: {node: '>=6.5'}
+ [email protected]:
+ resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==}
+ peerDependencies:
+ acorn: ^8
+
[email protected]:
resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==}
peerDependencies:
@@ -2159,6 +2386,9 @@ packages:
[email protected]:
resolution: {integrity: sha512-hruuB611QFoUFMsan7xd9B2VPMrA8XC716O/999WW34kmaJUT1hxKF2W8TSXAWkhSqgvbu70DjcDv7/wpM6vow==}
+ [email protected]:
+ resolution: {integrity: sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==}
+
[email protected]:
resolution: {integrity: sha512-cKFwohpJbuMovS8xVLmn8N2AUbAuc8pVo4zEfsUVo8qgECOogns1WVk/FkOZoxhOPTyTYFckuoH+13FO+MQ8GA==}
@@ -3249,13 +3479,16 @@ packages:
[email protected]:
resolution: {integrity: sha512-pfx45n2gEIC9MeXAadcfehu5MboUzXqgQiZviKbnIxI6a/QkonOSAMXvBBkWbXQ5FXc9M5IpziJs6TP7jikBrg==}
- [email protected]:
- resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==}
-
[email protected]:
resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
engines: {node: '>=6'}
+ [email protected]:
+ resolution: {integrity: sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw==}
+
+ [email protected]:
+ resolution: {integrity: sha512-Lk+qzWmiQuRPPulGQeK5qq0v32k2bHnWrRPFgqyvhw7Kkov5L6MOLOIU3pcWeujc9W4q54Cp3Q2WV16eQkc7Bg==}
+
[email protected]:
resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
engines: {node: '>=0.8.19'}
@@ -3582,9 +3815,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-O6O6/fsG5jiUVbvdgT7YX3xY3uIadR6wEZ7+vy9u7PKHAlSEB6blvC1o5pHBjgsi95Uo0aiBBdkyFecj6jtb7A==}
- [email protected]:
- resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==}
-
[email protected]:
resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==}
engines: {node: '>=14'}
@@ -3608,9 +3838,6 @@ packages:
resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==}
engines: {node: '>=14'}
- [email protected]:
- resolution: {integrity: sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==}
-
[email protected]:
resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
engines: {node: '>=8'}
@@ -3930,6 +4157,9 @@ packages:
[email protected]:
resolution: {integrity: sha512-23g5BFj4zdQL/b6tor7Ji+QY4pEfNH784BMslY9Qb0UnJWRAt+lQGLYmRaM0KDBwIG23ffEBELhZDP2rhi9f/Q==}
+ [email protected]:
+ resolution: {integrity: sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==}
+
[email protected]:
resolution: {integrity: sha512-dVgXe6b6DLnv4CHG7a1zUe5mSXaIZ3c6lSHm/EKeVeQI2/4pwe0VRde8OyoCE1Ro2lKT5P6uT9JElF7KDLV+jw==}
@@ -4086,6 +4316,10 @@ packages:
[email protected]:
resolution: {integrity: sha512-ha/kTOLhMQL7MvS9Abu/cpCXx5qwHQ++88YkUzn1CGfmM8JvCOG/4ZE6tRsexgXRFaoJrcwLyf81H2Y/CXALtA==}
+ [email protected]:
+ resolution: {integrity: sha512-aiSt/4ubOTyb1N5C2ZbGrBvaJOXIZhZvpRPYuUVxQJe27wJZqf/o65iPrqgLcgfeOLaQ8cS2Q+762jrYvniTrA==}
+ engines: {node: '>18.0.0'}
+
[email protected]:
resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==}
engines: {node: '>= 0.8.0'}
@@ -4230,6 +4464,17 @@ packages:
[email protected]:
resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}
+ [email protected]:
+ resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==}
+ engines: {node: '>=4.0.0'}
+
+ [email protected]:
+ resolution: {integrity: sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==}
+
+ [email protected]:
+ resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==}
+ engines: {node: '>=4'}
+
[email protected]:
resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==}
@@ -4267,6 +4512,22 @@ packages:
resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==}
engines: {node: ^10 || ^12 || >=14}
+ [email protected]:
+ resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==}
+ engines: {node: '>=4'}
+
+ [email protected]:
+ resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==}
+ engines: {node: '>=0.10.0'}
+
+ [email protected]:
+ resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==}
+ engines: {node: '>=0.10.0'}
+
+ [email protected]:
+ resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==}
+ engines: {node: '>=0.10.0'}
+
[email protected]:
resolution: {integrity: sha512-uL9sCML4gPH6Z4hreDWbeinKU0p0Ke261nU7OvII95NU22HN6Dk7T/SaVPaj6T4TsQqGKIFw6/woLZnH7ugFNA==}
engines: {node: '>= 6'}
@@ -4540,6 +4801,10 @@ packages:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
+ [email protected]:
+ resolution: {integrity: sha512-nQFEv9gRw6SJAwWD2LrL0NmQvAcO7FBwJbwmr2ttPAacfy0xuiOjE5zt+zM4xDyuyvUaxBi/9gb2SoCyNEVJcw==}
+ engines: {node: '>=8.6.0'}
+
[email protected]:
resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
@@ -4680,6 +4945,9 @@ packages:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
+ [email protected]:
+ resolution: {integrity: sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==}
+
[email protected]:
resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==}
engines: {node: '>= 0.4'}
@@ -5441,6 +5709,10 @@ packages:
[email protected]:
resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
+ [email protected]:
+ resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
+ engines: {node: '>=0.4'}
+
[email protected]:
resolution: {integrity: sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A==}
@@ -6544,6 +6816,203 @@ snapshots:
'@open-draft/[email protected]': {}
+ '@opentelemetry/[email protected]':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+
+ '@opentelemetry/[email protected]': {}
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/semantic-conventions': 1.24.1
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ '@types/connect': 3.4.36
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ semver: 7.6.2
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/redis-common': 0.36.2
+ '@opentelemetry/semantic-conventions': 1.24.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ '@types/koa': 2.14.0
+ '@types/koa__router': 12.0.3
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/sdk-metrics': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ '@opentelemetry/sql-common': 0.40.1(@opentelemetry/[email protected])
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ '@types/mysql': 2.15.22
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ '@opentelemetry/sql-common': 0.40.1(@opentelemetry/[email protected])
+ '@types/pg': 8.6.1
+ '@types/pg-pool': 2.0.4
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@types/shimmer': 1.0.5
+ import-in-the-middle: 1.4.2
+ require-in-the-middle: 7.3.0
+ semver: 7.6.2
+ shimmer: 1.2.1
+ transitivePeerDependencies:
+ - supports-color
+ optional: true
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/api-logs': 0.51.1
+ '@types/shimmer': 1.0.5
+ import-in-the-middle: 1.7.4
+ require-in-the-middle: 7.3.0
+ semver: 7.6.2
+ shimmer: 1.2.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@opentelemetry/[email protected]': {}
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/resources': 1.24.1(@opentelemetry/[email protected])
+ lodash.merge: 4.6.2
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/resources': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+
+ '@opentelemetry/[email protected]': {}
+
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+
'@otplib/[email protected]': {}
'@otplib/[email protected]':
@@ -6615,6 +7084,14 @@ snapshots:
dependencies:
safe-buffer: 5.2.1
+ '@prisma/[email protected]':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/[email protected])
+ transitivePeerDependencies:
+ - supports-color
+
'@puppeteer/[email protected]':
dependencies:
debug: 4.3.4
@@ -6688,37 +7165,60 @@ snapshots:
domhandler: 5.0.3
selderee: 0.11.0
- '@sentry-internal/[email protected]':
- dependencies:
- '@sentry/core': 7.114.0
- '@sentry/types': 7.114.0
- '@sentry/utils': 7.114.0
-
- '@sentry/[email protected]':
- dependencies:
- '@sentry/types': 7.114.0
- '@sentry/utils': 7.114.0
-
- '@sentry/[email protected]':
- dependencies:
- '@sentry/core': 7.114.0
- '@sentry/types': 7.114.0
- '@sentry/utils': 7.114.0
- localforage: 1.10.0
+ '@sentry/[email protected]':
+ dependencies:
+ '@sentry/types': 8.3.0
+ '@sentry/utils': 8.3.0
+
+ '@sentry/[email protected]':
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/context-async-hooks': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-connect': 0.36.0(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-express': 0.39.0(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-fastify': 0.36.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-graphql': 0.40.0(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-hapi': 0.38.0(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-http': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-ioredis': 0.40.0(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-koa': 0.40.0(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-mongodb': 0.43.0(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-mongoose': 0.38.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-mysql': 0.38.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-mysql2': 0.38.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-nestjs-core': 0.37.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation-pg': 0.41.0(@opentelemetry/[email protected])
+ '@opentelemetry/resources': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ '@prisma/instrumentation': 5.14.0
+ '@sentry/core': 8.3.0
+ '@sentry/opentelemetry': 8.3.0(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected])
+ '@sentry/types': 8.3.0
+ '@sentry/utils': 8.3.0
+ optionalDependencies:
+ opentelemetry-instrumentation-fetch-node: 1.2.0
+ transitivePeerDependencies:
+ - supports-color
- '@sentry/[email protected]':
+ '@sentry/[email protected](@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected])':
dependencies:
- '@sentry-internal/tracing': 7.114.0
- '@sentry/core': 7.114.0
- '@sentry/integrations': 7.114.0
- '@sentry/types': 7.114.0
- '@sentry/utils': 7.114.0
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/core': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/instrumentation': 0.51.1(@opentelemetry/[email protected])
+ '@opentelemetry/sdk-trace-base': 1.24.1(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ '@sentry/core': 8.3.0
+ '@sentry/types': 8.3.0
+ '@sentry/utils': 8.3.0
- '@sentry/[email protected]': {}
+ '@sentry/[email protected]': {}
- '@sentry/[email protected]':
+ '@sentry/[email protected]':
dependencies:
- '@sentry/types': 7.114.0
+ '@sentry/types': 8.3.0
'@sinclair/[email protected]': {}
@@ -6781,20 +7281,46 @@ snapshots:
'@tootallnate/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.12.12
+
'@types/[email protected]': {}
'@types/[email protected]': {}
'@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/connect': 3.4.38
+ '@types/node': 20.12.12
+
'@types/[email protected]': {}
'@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.12.12
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.12.12
+
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
'@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/connect': 3.4.38
+ '@types/express': 4.17.21
+ '@types/keygrip': 1.0.6
+ '@types/node': 20.12.12
+
'@types/[email protected]': {}
'@types/[email protected]':
@@ -6814,6 +7340,20 @@ snapshots:
dependencies:
'@types/node': 20.12.12
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.12.12
+ '@types/qs': 6.9.15
+ '@types/range-parser': 1.2.7
+ '@types/send': 0.17.4
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/body-parser': 1.19.5
+ '@types/express-serve-static-core': 4.19.1
+ '@types/qs': 6.9.15
+ '@types/serve-static': 1.15.7
+
'@types/[email protected]':
dependencies:
'@types/jsonfile': 6.1.4
@@ -6821,8 +7361,12 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
'@types/[email protected]':
dependencies:
'@types/node': 20.12.12
@@ -6845,6 +7389,27 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/koa': 2.14.0
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/accepts': 1.3.7
+ '@types/content-disposition': 0.5.8
+ '@types/cookies': 0.9.0
+ '@types/http-assert': 1.5.5
+ '@types/http-errors': 2.0.4
+ '@types/keygrip': 1.0.6
+ '@types/koa-compose': 3.2.8
+ '@types/node': 20.12.12
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/koa': 2.14.0
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -6867,6 +7432,8 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -6875,6 +7442,10 @@ snapshots:
dependencies:
'@types/node': 20.12.12
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.12.12
+
'@types/[email protected]':
dependencies:
'@types/node': 20.12.12
@@ -6886,6 +7457,20 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/pg': 8.6.1
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.12.12
+ pg-protocol: 1.6.1
+ pg-types: 2.2.0
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]': {}
+
'@types/[email protected]':
dependencies:
'@types/bluebird': 3.5.42
@@ -6902,6 +7487,19 @@ snapshots:
dependencies:
htmlparser2: 8.0.2
+ '@types/[email protected]':
+ dependencies:
+ '@types/mime': 1.3.5
+ '@types/node': 20.12.12
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/http-errors': 2.0.4
+ '@types/node': 20.12.12
+ '@types/send': 0.17.4
+
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
'@types/[email protected]':
@@ -7091,6 +7689,11 @@ snapshots:
dependencies:
event-target-shim: 5.0.1
+ [email protected]([email protected]):
+ dependencies:
+ acorn: 8.11.3
+ optional: true
+
[email protected]([email protected]):
dependencies:
acorn: 8.11.3
@@ -7497,6 +8100,8 @@ snapshots:
dependencies:
lodash: 4.17.21
+ [email protected]: {}
+
[email protected]: {}
[email protected]:
@@ -8738,13 +9343,26 @@ snapshots:
pino: 9.0.0
socks: 2.8.3
- [email protected]: {}
-
[email protected]:
dependencies:
parent-module: 1.0.1
resolve-from: 4.0.0
+ [email protected]:
+ dependencies:
+ acorn: 8.11.3
+ acorn-import-assertions: 1.9.0([email protected])
+ cjs-module-lexer: 1.3.1
+ module-details-from-path: 1.0.3
+ optional: true
+
+ [email protected]:
+ dependencies:
+ acorn: 8.11.3
+ acorn-import-attributes: 1.9.5([email protected])
+ cjs-module-lexer: 1.3.1
+ module-details-from-path: 1.0.3
+
[email protected]: {}
[email protected]: {}
@@ -9083,10 +9701,6 @@ snapshots:
[email protected]: {}
- [email protected]:
- dependencies:
- immediate: 3.0.6
-
[email protected]: {}
[email protected]: {}
@@ -9124,10 +9738,6 @@ snapshots:
mlly: 1.7.0
pkg-types: 1.1.1
- [email protected]:
- dependencies:
- lie: 3.1.1
-
[email protected]:
dependencies:
p-locate: 4.1.0
@@ -9518,6 +10128,8 @@ snapshots:
[email protected]: {}
+ [email protected]: {}
+
[email protected]: {}
[email protected]: {}
@@ -9667,6 +10279,15 @@ snapshots:
dependencies:
yaml: 2.4.2
+ [email protected]:
+ dependencies:
+ '@opentelemetry/api': 1.8.0
+ '@opentelemetry/instrumentation': 0.43.0(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.24.1
+ transitivePeerDependencies:
+ - supports-color
+ optional: true
+
[email protected]:
dependencies:
deep-is: 0.1.4
@@ -9819,6 +10440,18 @@ snapshots:
[email protected]: {}
+ [email protected]: {}
+
+ [email protected]: {}
+
+ [email protected]:
+ dependencies:
+ pg-int8: 1.0.1
+ postgres-array: 2.0.0
+ postgres-bytea: 1.0.0
+ postgres-date: 1.0.7
+ postgres-interval: 1.2.0
+
[email protected]: {}
[email protected]: {}
@@ -9862,6 +10495,16 @@ snapshots:
picocolors: 1.0.1
source-map-js: 1.2.0
+ [email protected]: {}
+
+ [email protected]: {}
+
+ [email protected]: {}
+
+ [email protected]:
+ dependencies:
+ xtend: 4.0.2
+
[email protected]:
dependencies:
'@postman/form-data': 3.1.1
@@ -10174,6 +10817,14 @@ snapshots:
[email protected]: {}
+ [email protected]:
+ dependencies:
+ debug: 4.3.4
+ module-details-from-path: 1.0.3
+ resolve: 1.22.8
+ transitivePeerDependencies:
+ - supports-color
+
[email protected]: {}
[email protected]: {}
@@ -10322,6 +10973,8 @@ snapshots:
[email protected]: {}
+ [email protected]: {}
+
[email protected]:
dependencies:
call-bind: 1.0.7
@@ -11070,6 +11723,8 @@ snapshots:
[email protected]: {}
+ [email protected]: {}
+
[email protected]: {}
[email protected]: {}
|
091feba32ab3d34fa61c92a5079723afe3fc8331
|
2025-01-27 00:39:17
|
AiraNadih
|
feat(route): add route "CosplayTele" (#18217)
| false
|
add route "CosplayTele" (#18217)
|
feat
|
diff --git a/lib/routes/cosplaytele/article.ts b/lib/routes/cosplaytele/article.ts
new file mode 100644
index 00000000000000..c5a534cceb448b
--- /dev/null
+++ b/lib/routes/cosplaytele/article.ts
@@ -0,0 +1,13 @@
+import { parseDate } from '@/utils/parse-date';
+import { WPPost } from './types';
+
+function loadArticle(item: WPPost) {
+ return {
+ title: item.title.rendered,
+ description: item.content.rendered,
+ pubDate: parseDate(item.date_gmt),
+ link: item.link,
+ };
+}
+
+export default loadArticle;
diff --git a/lib/routes/cosplaytele/category.ts b/lib/routes/cosplaytele/category.ts
new file mode 100644
index 00000000000000..755f01fd388d88
--- /dev/null
+++ b/lib/routes/cosplaytele/category.ts
@@ -0,0 +1,47 @@
+import { Route } from '@/types';
+import got from '@/utils/got';
+import { SUB_NAME_PREFIX, SUB_URL } from './const';
+import loadArticle from './article';
+import { WPPost } from './types';
+
+export const route: Route = {
+ path: '/category/:category',
+ categories: ['picture'],
+ example: '/cosplaytele/category/cosplay',
+ parameters: { category: 'Category' },
+ features: {
+ requireConfig: false,
+ requirePuppeteer: false,
+ antiCrawler: false,
+ supportBT: false,
+ supportPodcast: false,
+ supportScihub: false,
+ },
+ radar: [
+ {
+ source: ['cosplaytele.com/category/:category'],
+ target: '/category/:category',
+ },
+ ],
+ name: 'Category',
+ maintainers: ['AiraNadih'],
+ handler,
+ url: 'cosplaytele.com/',
+};
+
+async function handler(ctx) {
+ const limit = Number.parseInt(ctx.req.query('limit')) || 20;
+ const category = ctx.req.param('category');
+ const categoryUrl = `${SUB_URL}category/${category}/`;
+
+ const {
+ data: [{ id: categoryId }],
+ } = await got(`${SUB_URL}wp-json/wp/v2/categories?slug=${category}`);
+ const { data: posts } = await got(`${SUB_URL}wp-json/wp/v2/posts?categories=${categoryId}&per_page=${limit}`);
+
+ return {
+ title: `${SUB_NAME_PREFIX} - Category: ${category}`,
+ link: categoryUrl,
+ item: posts.map((post) => loadArticle(post as WPPost)),
+ };
+}
diff --git a/lib/routes/cosplaytele/const.ts b/lib/routes/cosplaytele/const.ts
new file mode 100644
index 00000000000000..c196c2ab8b4595
--- /dev/null
+++ b/lib/routes/cosplaytele/const.ts
@@ -0,0 +1,4 @@
+const SUB_NAME_PREFIX = 'CosplayTele';
+const SUB_URL = 'https://cosplaytele.com/';
+
+export { SUB_NAME_PREFIX, SUB_URL };
diff --git a/lib/routes/cosplaytele/latest.ts b/lib/routes/cosplaytele/latest.ts
new file mode 100644
index 00000000000000..b986a8d731229e
--- /dev/null
+++ b/lib/routes/cosplaytele/latest.ts
@@ -0,0 +1,41 @@
+import { Route } from '@/types';
+import got from '@/utils/got';
+import { SUB_NAME_PREFIX, SUB_URL } from './const';
+import loadArticle from './article';
+import { WPPost } from './types';
+
+export const route: Route = {
+ path: '/',
+ categories: ['picture'],
+ example: '/cosplaytele',
+ parameters: {},
+ features: {
+ requireConfig: false,
+ requirePuppeteer: false,
+ antiCrawler: false,
+ supportBT: false,
+ supportPodcast: false,
+ supportScihub: false,
+ },
+ radar: [
+ {
+ source: ['cosplaytele.com/'],
+ target: '',
+ },
+ ],
+ name: 'Latest',
+ maintainers: ['AiraNadih'],
+ handler,
+ url: 'cosplaytele.com/',
+};
+
+async function handler(ctx) {
+ const limit = Number.parseInt(ctx.req.query('limit')) || 20;
+ const { data: posts } = await got(`${SUB_URL}wp-json/wp/v2/posts?per_page=${limit}`);
+
+ return {
+ title: `${SUB_NAME_PREFIX} - Latest`,
+ link: SUB_URL,
+ item: posts.map((post) => loadArticle(post as WPPost)),
+ };
+}
diff --git a/lib/routes/cosplaytele/namespace.ts b/lib/routes/cosplaytele/namespace.ts
new file mode 100644
index 00000000000000..bcba7214fa5629
--- /dev/null
+++ b/lib/routes/cosplaytele/namespace.ts
@@ -0,0 +1,8 @@
+import type { Namespace } from '@/types';
+
+export const namespace: Namespace = {
+ name: 'CosplayTele',
+ url: 'cosplaytele.com',
+ description: 'Cosplaytele - Fast - Security - Free',
+ lang: 'en',
+};
diff --git a/lib/routes/cosplaytele/popular.ts b/lib/routes/cosplaytele/popular.ts
new file mode 100644
index 00000000000000..fe2b20577f73b5
--- /dev/null
+++ b/lib/routes/cosplaytele/popular.ts
@@ -0,0 +1,75 @@
+import { Route } from '@/types';
+import got from '@/utils/got';
+import { load } from 'cheerio';
+import { SUB_NAME_PREFIX, SUB_URL } from './const';
+import loadArticle from './article';
+import { WPPost } from './types';
+
+export const route: Route = {
+ path: '/popular/:period',
+ categories: ['picture'],
+ example: '/cosplaytele/popular/3',
+ parameters: { period: 'Days' },
+ features: {
+ requireConfig: false,
+ requirePuppeteer: false,
+ antiCrawler: false,
+ supportBT: false,
+ supportPodcast: false,
+ supportScihub: false,
+ },
+ radar: [
+ {
+ source: ['cosplaytele.com/:period'],
+ target: '/popular/:period',
+ },
+ ],
+ name: 'Popular',
+ maintainers: ['AiraNadih'],
+ handler,
+ url: 'cosplaytele.com/',
+};
+
+function getPeriodConfig(period) {
+ if (period === '1') {
+ return {
+ url: `${SUB_URL}24-hours/`,
+ range: 'daily',
+ title: `${SUB_NAME_PREFIX} - Top views in 24 hours`,
+ };
+ }
+ return {
+ url: `${SUB_URL}${period}-day/`,
+ range: `last${period}days`,
+ title: `${SUB_NAME_PREFIX} - Top views in ${period} days`,
+ };
+}
+
+async function handler(ctx) {
+ const limit = Number.parseInt(ctx.req.query('limit')) || 20;
+ const period = ctx.req.param('period');
+
+ const { url, range, title } = getPeriodConfig(period);
+
+ const { data } = await got.post(`${SUB_URL}wp-json/wordpress-popular-posts/v2/widget`, {
+ json: {
+ limit,
+ range,
+ order_by: 'views',
+ },
+ });
+
+ const $ = load(data.widget);
+ const links = $('.wpp-list li')
+ .toArray()
+ .map((post) => $(post).find('.wpp-post-title').attr('href'))
+ .filter((link) => link !== undefined);
+ const slugs = links.map((link) => link.split('/').findLast(Boolean));
+ const { data: posts } = await got(`${SUB_URL}wp-json/wp/v2/posts?slug=${slugs.join(',')}&per_page=${limit}`);
+
+ return {
+ title,
+ link: url,
+ item: posts.map((post) => loadArticle(post as WPPost)),
+ };
+}
diff --git a/lib/routes/cosplaytele/tag.ts b/lib/routes/cosplaytele/tag.ts
new file mode 100644
index 00000000000000..41676a57cfef65
--- /dev/null
+++ b/lib/routes/cosplaytele/tag.ts
@@ -0,0 +1,47 @@
+import { Route } from '@/types';
+import got from '@/utils/got';
+import { SUB_NAME_PREFIX, SUB_URL } from './const';
+import loadArticle from './article';
+import { WPPost } from './types';
+
+export const route: Route = {
+ path: '/tag/:tag',
+ categories: ['picture'],
+ example: '/cosplaytele/tag/aqua',
+ parameters: { tag: 'Tag' },
+ features: {
+ requireConfig: false,
+ requirePuppeteer: false,
+ antiCrawler: false,
+ supportBT: false,
+ supportPodcast: false,
+ supportScihub: false,
+ },
+ radar: [
+ {
+ source: ['cosplaytele.com/tag/:tag'],
+ target: '/tag/:tag',
+ },
+ ],
+ name: 'Tag',
+ maintainers: ['AiraNadih'],
+ handler,
+ url: 'cosplaytele.com/',
+};
+
+async function handler(ctx) {
+ const limit = Number.parseInt(ctx.req.query('limit')) || 20;
+ const tag = ctx.req.param('tag');
+ const tagUrl = `${SUB_URL}tag/${tag}/`;
+
+ const {
+ data: [{ id: tagId }],
+ } = await got(`${SUB_URL}wp-json/wp/v2/tags?slug=${tag}`);
+ const { data: posts } = await got(`${SUB_URL}wp-json/wp/v2/posts?tags=${tagId}&per_page=${limit}`);
+
+ return {
+ title: `${SUB_NAME_PREFIX} - Tag: ${tag}`,
+ link: tagUrl,
+ item: posts.map((post) => loadArticle(post as WPPost)),
+ };
+}
diff --git a/lib/routes/cosplaytele/types.ts b/lib/routes/cosplaytele/types.ts
new file mode 100644
index 00000000000000..d3ea3ac2a8cc26
--- /dev/null
+++ b/lib/routes/cosplaytele/types.ts
@@ -0,0 +1,12 @@
+interface WPPost {
+ title: {
+ rendered: string;
+ };
+ content: {
+ rendered: string;
+ };
+ date_gmt: string;
+ link: string;
+}
+
+export type { WPPost };
|
35347a921ded1781c9bebcd37fb18d62ce46003d
|
2022-04-21 11:02:13
|
yuxinliu-alex
|
feat(route): 中国新闻网 (#9584)
| false
|
中国新闻网 (#9584)
|
feat
|
diff --git a/docs/traditional-media.md b/docs/traditional-media.md
index 51e658cf9401d9..6c7675e49df1fe 100644
--- a/docs/traditional-media.md
+++ b/docs/traditional-media.md
@@ -1709,6 +1709,12 @@ category 对应的关键词有
</Route>
+## 中国新闻网
+
+### 最新
+
+<Route author="yuxinliu-alex" example="/chinanews" path="/chinanews" radar="1" rssbud="1" />
+
## 中山网
### 中山网新闻
diff --git a/lib/v2/chinanews/index.js b/lib/v2/chinanews/index.js
new file mode 100644
index 00000000000000..c8e56821ada5fa
--- /dev/null
+++ b/lib/v2/chinanews/index.js
@@ -0,0 +1,65 @@
+const got = require('@/utils/got');
+const timezone = require('@/utils/timezone');
+const { parseDate } = require('@/utils/parse-date');
+const cheerio = require('cheerio');
+
+const rootUrl = 'https://www.chinanews.com.cn';
+
+module.exports = async (ctx) => {
+ const currentUrl = `${rootUrl}/scroll-news/news1.html`;
+ const response = await got({
+ method: 'get',
+ url: currentUrl,
+ });
+ const $ = cheerio.load(response.data);
+ const list = $('a', '.dd_bt')
+ .map((_, item) => ({
+ link: rootUrl + $(item).attr('href'),
+ title: $(item).text(),
+ }))
+ .get()
+ .slice(0, ctx.query.limit ? (parseInt(ctx.query.limit) > 125 ? 125 : parseInt(ctx.query.limit)) : 50);
+
+ const items = await Promise.all(
+ list.map((item) =>
+ ctx.cache.tryGet(item.link, async () => {
+ const detailResponse = await got({
+ method: 'get',
+ url: item.link,
+ });
+ const content = cheerio.load(detailResponse.data);
+ if (content('div.content_desc').length > 0) {
+ item.description = content('div.content_desc').text();
+ item.author = content('a.source').text();
+ const info = content('p', '.left').text().trim().slice(5).split(' ');
+ item.author = info[2].trim();
+ item.pubDate = timezone(parseDate(info[0] + info[1], 'YYYY年MM月DD日HH:mm'), +8);
+ } else if (content('div.t3').length > 0) {
+ item.description = content('div.t3').text();
+ const info = content('div[style="text-align:right;font-size:12px;"]').text().slice(5).split(' ');
+ item.author = info[2];
+ item.pubDate = timezone(parseDate(info[0] + info[1], 'YYYY-MM-DDHH:mm'), +8);
+ } else {
+ item.description = content('div.left_zw').text();
+ const info = content('div.left-t')
+ .contents()
+ .filter(function () {
+ return this.type === 'text';
+ })
+ .text()
+ .split(' ');
+ item.pubDate = timezone(parseDate(info[0], 'YYYY年MM月DD日 HH:mm'), +8);
+ item.author = info[1] + content('a.source').text();
+ }
+ return item;
+ })
+ )
+ );
+ ctx.state.data = {
+ title: '中国新闻网',
+ link: currentUrl,
+ description: '中国新闻网(简称“中新网”),由中国新闻社主办,为中央重点新闻网站。',
+ language: 'zh-cn',
+ item: items,
+ };
+};
diff --git a/lib/v2/chinanews/maintainer.js b/lib/v2/chinanews/maintainer.js
new file mode 100644
index 00000000000000..d50c937c010fcf
--- /dev/null
+++ b/lib/v2/chinanews/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/': ['yuxinliu-alex'],
+};
diff --git a/lib/v2/chinanews/radar.js b/lib/v2/chinanews/radar.js
new file mode 100644
index 00000000000000..8a0fadfc5d2b3a
--- /dev/null
+++ b/lib/v2/chinanews/radar.js
@@ -0,0 +1,13 @@
+module.exports = {
+ 'chinanews.com.cn': {
+ _name: '中国新闻网',
+ '.': [
+ {
+ title: '最新',
+ docs: 'https://docs.rsshub.app/traditional-media.html#zhong-xin-wang',
+ source: ['/'],
+ target: '/chinanews',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/chinanews/router.js b/lib/v2/chinanews/router.js
new file mode 100644
index 00000000000000..20c52b09d72938
--- /dev/null
+++ b/lib/v2/chinanews/router.js
@@ -0,0 +1,3 @@
+module.exports = function (router) {
+ router.get('/', require('./index'));
+};
|
b8a1a5d98bc5a67db8ce3f510c75640113111b9a
|
2024-02-27 23:51:03
|
github-actions[bot]
|
style: auto format
| false
|
auto format
|
style
|
diff --git a/website/docs/routes/anime.mdx b/website/docs/routes/anime.mdx
index 8ecb005ee41c9c..b82463fcb9fa7e 100644
--- a/website/docs/routes/anime.mdx
+++ b/website/docs/routes/anime.mdx
@@ -341,7 +341,7 @@
## lovelive-anime {#lovelive-anime}
-### Love Live! Official Website Latest NEWS {#lovelive-anime-love-live!-official-website-latest-news}
+### Love Live! Official Website Latest NEWS {#lovelive-anime-love-live-official-website-latest-news}
<Route author="axojhf" example="/lovelive-anime/news" path="/lovelive-anime/news/:option?" paramsDesc={['Crawl full text when `option` is `detail`.']} radar="1" />
diff --git a/website/docs/routes/game.mdx b/website/docs/routes/game.mdx
index 207375c1a4696c..272623e79927af 100644
--- a/website/docs/routes/game.mdx
+++ b/website/docs/routes/game.mdx
@@ -431,9 +431,9 @@
<Route author="hoilc" example="/nintendo/system-update" path="/nintendo/system-update" />
-## osu! {#osu!}
+## osu! {#osu}
-### Beatmap Packs {#osu!-beatmap-packs}
+### Beatmap Packs {#osu-beatmap-packs}
<Route author="JimenezLi" example="/osu/packs" path="/osu/packs/:type?" paramsDesc={['pack type, default to `standard`, can choose from `featured`, `tournament`, `loved`, `chart`, `theme` and `artist`']} radar="1" />
|
b1ff4282153d8b6fd45165d8a2ebeddb3ce04f9c
|
2020-05-07 21:33:18
|
dependabot-preview[bot]
|
chore(deps): bump hooman from 1.0.0 to 1.1.0
| false
|
bump hooman from 1.0.0 to 1.1.0
|
chore
|
diff --git a/package.json b/package.json
index 21e52ea19f88e6..0f2c54be7c5e72 100644
--- a/package.json
+++ b/package.json
@@ -84,7 +84,7 @@
"googleapis": "50.0.0",
"got": "11.1.1",
"he": "1.2.0",
- "hooman": "1.0.0",
+ "hooman": "1.1.0",
"https-proxy-agent": "5.0.0",
"iconv-lite": "0.5.1",
"jsdom": "16.2.2",
diff --git a/yarn.lock b/yarn.lock
index a46cd4ee1ef9ba..3bc7e3ee7abbe8 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5821,7 +5821,7 @@ [email protected]:
google-auth-library "^6.0.0"
googleapis-common "^4.1.0"
[email protected], got@^11.1.0:
[email protected]:
version "11.1.1"
resolved "https://registry.yarnpkg.com/got/-/got-11.1.1.tgz#11f83049df8155b384413547fe163dd4b35b4240"
integrity sha512-7WxfuTyT02hMZZdDvaAprEoxsU13boxI8rWMpqk/5Mq6t+YVbExVB2L6yRLh2Nw3TeJyFpanId41+ZyXGesmbw==
@@ -6037,15 +6037,15 @@ hogan.js@^3.0.2:
mkdirp "0.3.0"
nopt "1.0.10"
[email protected]:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/hooman/-/hooman-1.0.0.tgz#0769b81d6e3ce94db3c1b1a35d766531403a53a1"
- integrity sha512-XkbN3bTqqkkqU4KfdsKEAmjtxJMJkVD4nlFOcFQEuYXUpnPnZbN3UOjvoR+oWtEsX0Vtjz5ffrJUtdjtzz89mw==
[email protected]:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/hooman/-/hooman-1.1.0.tgz#37eb11aee895f7e0fd97df40b76496aecd670518"
+ integrity sha512-g/rKFrmpVh/xg5MlgiuW5zvwBQ+rfUzHAl7bHJmph46OKMVenSxmFNmrS5rnTvJuNo0IKjWceTNtSGKvWM+c4Q==
dependencies:
- got "^11.1.0"
jsdom "^16.2.2"
tough-cookie "^4.0.0"
user-agents "^1.0.559"
+ vm2 "^3.9.2"
hosted-git-info@^2.1.4:
version "2.8.8"
@@ -12409,6 +12409,11 @@ [email protected]:
dependencies:
indexof "0.0.1"
+vm2@^3.9.2:
+ version "3.9.2"
+ resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.2.tgz#a4085d2d88a808a1b3c06d5478c2db3222a9cc30"
+ integrity sha512-nzyFmHdy2FMg7mYraRytc2jr4QBaUY3TEGe3q3bK8EgS9WC98wxn2jrPxS/ruWm+JGzrEIIeufKweQzVoQEd+Q==
+
vue-hot-reload-api@^2.3.0:
version "2.3.3"
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz#2756f46cb3258054c5f4723de8ae7e87302a1ccf"
|
f2b4bfbff82728712833e52f20f697d95e747a18
|
2020-09-24 23:21:38
|
DIYgod
|
fix: add python in Dockerfile to fix opencc installation
| false
|
add python in Dockerfile to fix opencc installation
|
fix
|
diff --git a/Dockerfile b/Dockerfile
index 8f8c30ab1af6ff..cbb4e1509933a2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -11,7 +11,7 @@ ARG PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1;
RUN ln -sf /bin/bash /bin/sh
-RUN apt-get update && apt-get install -yq libgconf-2-4 apt-transport-https git dumb-init --no-install-recommends && apt-get clean \
+RUN apt-get update && apt-get install -yq libgconf-2-4 apt-transport-https git dumb-init python --no-install-recommends && apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
|
c459ae71f7a6f7afeb1f7a67cb9f258814204a8a
|
2023-09-28 09:37:30
|
dependabot[bot]
|
chore(deps-dev): bump @types/require-all from 3.0.3 to 3.0.4 (#13431)
| false
|
bump @types/require-all from 3.0.3 to 3.0.4 (#13431)
|
chore
|
diff --git a/package.json b/package.json
index 9e46fb23c9c890..404633ca0944fe 100644
--- a/package.json
+++ b/package.json
@@ -174,7 +174,7 @@
"@types/pidusage": "2.0.3",
"@types/plist": "3.0.3",
"@types/request-promise-native": "1.0.19",
- "@types/require-all": "3.0.3",
+ "@types/require-all": "3.0.4",
"@types/showdown": "2.0.2",
"@types/supertest": "2.0.13",
"@types/tiny-async-pool": "2.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a37e1cec7f23f4..63342c924ab651 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -275,8 +275,8 @@ devDependencies:
specifier: 1.0.19
version: 1.0.19
'@types/require-all':
- specifier: 3.0.3
- version: 3.0.3
+ specifier: 3.0.4
+ version: 3.0.4
'@types/showdown':
specifier: 2.0.2
version: 2.0.2
@@ -1711,8 +1711,8 @@ packages:
'@types/tough-cookie': 4.0.3
form-data: 2.5.1
- /@types/[email protected]:
- resolution: {integrity: sha512-y9IkD6jpxoYD2SNK4CHN2NNSL+6EVtTp26Jg3l1VbBjPdXNaKg5PeclIjdAj8lGxh0Cpur5sHRJPKRa3cPtqgA==}
+ /@types/[email protected]:
+ resolution: {integrity: sha512-huqCdyD1zXN7eFJ6Duj3CrSb9Xxqqs8wT6oIKsBlG5x8/sgMUYQq3l9RTAQiHPOkkhKA5N3XPjMavu5sm3WQQQ==}
dev: true
/@types/[email protected]:
|
796981915dd5af48d5ef278f8ba51a1604b203b2
|
2024-07-25 12:08:57
|
Stephen Zhou
|
fix(route): short title, use guid for github activities (#16247)
| false
|
short title, use guid for github activities (#16247)
|
fix
|
diff --git a/lib/routes/github/activity.ts b/lib/routes/github/activity.ts
index 0865e33bf3ea1b..f2f3f72c9a9aa7 100644
--- a/lib/routes/github/activity.ts
+++ b/lib/routes/github/activity.ts
@@ -38,7 +38,7 @@ export const route: Route = {
const image = raw.match(/<media:thumbnail height="30" width="30" url="(.+?)"/)?.[1];
const feed = await parser.parseString(raw);
return {
- title: `${user}'s GitHub Public Timeline Feed`,
+ title: `${user}'s GitHub activities`,
link: feed.link,
image,
item: feed.items.map((item) => ({
@@ -47,7 +47,7 @@ export const route: Route = {
description: item.content?.replace(/href="(.+?)"/g, `href="https://github.com$1"`),
pubDate: item.pubDate ? parseDate(item.pubDate) : undefined,
author: item.author,
- id: item.id,
+ guid: item.id,
image,
})),
};
|
985dbaca7729129961792b014bda295b177466b8
|
2023-12-21 20:14:43
|
DIYgod
|
feat: remove notOperational routes - travel
| false
|
remove notOperational routes - travel
|
feat
|
diff --git a/lib/router.js b/lib/router.js
index daf6ca3046982e..f040a99395b75d 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -123,13 +123,6 @@ router.get('/zongheng/chapter/:id', lazyloadRouteHandler('./routes/zongheng/chap
// 刺猬猫
router.get('/ciweimao/chapter/:id', lazyloadRouteHandler('./routes/ciweimao/chapter'));
-// 中国美术馆
-router.get('/namoc/announcement', lazyloadRouteHandler('./routes/namoc/announcement'));
-router.get('/namoc/news', lazyloadRouteHandler('./routes/namoc/news'));
-router.get('/namoc/media', lazyloadRouteHandler('./routes/namoc/media'));
-router.get('/namoc/exhibition', lazyloadRouteHandler('./routes/namoc/exhibition'));
-router.get('/namoc/specials', lazyloadRouteHandler('./routes/namoc/specials'));
-
// 维基百科 Wikipedia
router.get('/wikipedia/mainland', lazyloadRouteHandler('./routes/wikipedia/mainland'));
@@ -155,18 +148,9 @@ router.get('/tucaoqq/post/:project/:key', lazyloadRouteHandler('./routes/tencent
// wechat
router.get('/wechat/miniprogram/plugins', lazyloadRouteHandler('./routes/tencent/wechat/miniprogram/plugins'));
-// All the Flight Deals
-router.get('/atfd/:locations/:nearby?', lazyloadRouteHandler('./routes/atfd/index'));
-
// Nvidia Web Driver
router.get('/nvidia/webdriverupdate', lazyloadRouteHandler('./routes/nvidia/webdriverupdate'));
-// 每日环球展览 iMuseum
-router.get('/imuseum/:city/:type?', lazyloadRouteHandler('./routes/imuseum'));
-
-// Hopper
-router.get('/hopper/:lowestOnly/:from/:to?', lazyloadRouteHandler('./routes/hopper/index'));
-
// 马蜂窝
router.get('/mafengwo/note/:type', lazyloadRouteHandler('./routes/mafengwo/note'));
router.get('/mafengwo/ziyouxing/:code', lazyloadRouteHandler('./routes/mafengwo/ziyouxing'));
diff --git a/lib/routes/atfd/index.js b/lib/routes/atfd/index.js
deleted file mode 100644
index b704868ae01630..00000000000000
--- a/lib/routes/atfd/index.js
+++ /dev/null
@@ -1,46 +0,0 @@
-const got = require('@/utils/got');
-const { toTitleCase } = require('@/utils/common-utils');
-const dayjs = require('dayjs');
-
-module.exports = async (ctx) => {
- const locations = ctx.params.locations;
-
- let nearby = ctx.params.nearby || '0';
- nearby = nearby === '1' ? 'true' : 'false';
-
- let host = 'https://alltheflightdeals.com/deals';
-
- let url = 'https://alltheflightdeals.com/deals/locations?origins=[';
-
- locations.split(',').forEach((pair) => {
- const country = pair.split('+')[0];
- const city = toTitleCase(pair.split('+')[1]);
- url += `{"country":"${country}","city":"${city}"},`;
-
- host += `/${country}/${city.replace(' ', '_')}`;
- });
-
- url = url.slice(0, -1) + `]&includeNearbyOrigins=${nearby}`;
-
- const response = await got({
- method: 'get',
- url,
- headers: {
- Referer: host,
- },
- });
- const data = response.data.data.slice(0, 10);
-
- ctx.state.data = {
- title: 'All the Flight Deals',
- link: host,
- description: 'All the Flight Deals',
- item: data.map((item) => ({
- title: `[${item.dateRanges[0] ? dayjs(item.dateRanges[0].start).format('YYYY MMM DD') + ' to ' + dayjs(item.dateRanges[0].end).format('YYYY MMM DD') : ''}] ${item.title}`,
- description: `<img src="https://alltheflightdeals.com/assets/cities/${item.cityPairs[0].destinationCity.id}.jpg" alt="${item.cityPairs[0].destination.city},${item.cityPairs[0].destination.countryName}"> <br><table><tbody><tr><th align="left" style="border: 1px solid black;">From</th><th align="left" style="border: 1px solid black;">To</th><th align="left" style="border: 1px solid black;">Price</th></tr><tr><td style="border: 1px solid black;"><b>${item.cityPairs[0].origin.iata}</b>, ${item.cityPairs[0].origin.city}, ${item.cityPairs[0].origin.countryName}</td><td style="border: 1px solid black;"><b>${item.cityPairs[0].destination.iata}</b>, ${item.cityPairs[0].destination.city}, ${item.cityPairs[0].destination.countryName}</td><td style="border: 1px solid black;">${item.currency} ${item.price}</td></tr></tbody></table>`,
- pubDate: new Date(item.createdAt),
- guid: item.id,
- link: item.url,
- })),
- };
-};
diff --git a/lib/routes/hopper/index.js b/lib/routes/hopper/index.js
deleted file mode 100644
index ead5704a4572e4..00000000000000
--- a/lib/routes/hopper/index.js
+++ /dev/null
@@ -1,82 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-const dayjs = require('dayjs');
-const queryString = require('query-string');
-
-module.exports = async (ctx) => {
- const from = ctx.params.from.toUpperCase();
- const to = ctx.params.to !== undefined ? ctx.params.to.toUpperCase() : 'Anywhere';
-
- const type = ctx.params.lowestOnly;
-
- const url = `https://www.hopper.com/deals/best/from/${from}/to/${to}`;
- const title = `Hopper - Flights From ${from} to ${to}`;
-
- const response = await got({
- method: 'get',
- url,
- searchParams: queryString.stringify({
- pid: 'website',
- c: 'flexweb',
- }),
- });
-
- const $ = cheerio.load(response.data);
- const list = $('div.prices li a');
- const items = [];
-
- if (list.length !== 0) {
- if (type === '1') {
- let lowest = 99999;
- let lowIndex = 0;
-
- list.each((i, e) => {
- const current = parseInt($(e).find('.price').text().replace(/\D/g, ''));
-
- if (current < lowest) {
- lowest = current;
- lowIndex = i;
- }
- });
-
- items.push(formatDesc($(list[lowIndex])));
- } else {
- list.each((i, e) => {
- items.push(formatDesc($(e)));
- });
- }
- }
-
- ctx.state.data = {
- title,
- link: url,
- description: title,
- item: items,
- };
-};
-
-const formatDesc = (e) => {
- const item = e.attr('href');
- let reg = new RegExp('destination=(.*?)&', 'g');
- const destination = reg.exec(item)[1];
- reg = new RegExp('origin=(.*?)&', 'g');
- const origin = reg.exec(item)[1];
- reg = new RegExp('departureDate=(.*?)&', 'g');
- const departureDate = reg.exec(item)[1];
- reg = new RegExp('returnDate=(.*?)&', 'g');
- const returnDate = reg.exec(item)[1];
-
- const price = e.find('.price').text();
-
- const title = `${origin} ✈ ${destination} ${dayjs(departureDate).format('YYYY MMM')} for ${price}`;
-
- const description = `<table><tbody><tr><th align="left" style="border: 1px solid black;">From</th><th align="left" style="border: 1px solid black;">To</th><th align="left" style="border: 1px solid black;">Price</th></tr><tr><td style="border: 1px solid black;">
- ${origin}</td><td style="border: 1px solid black;">${destination}</td><td style="border: 1px solid black;">${price}</td></tr></tbody></table>${dayjs(departureDate).format('YYYY MMM DD')} ✈ ${dayjs(returnDate).format(
- 'YYYY MMM DD'
- )}`;
- return {
- title,
- description,
- link: item,
- };
-};
diff --git a/lib/routes/imuseum/index.js b/lib/routes/imuseum/index.js
deleted file mode 100644
index fe87e831e8b81b..00000000000000
--- a/lib/routes/imuseum/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-
-const baseUrl = 'https://art.icity.ly';
-
-/**
- * type: ['all', 'latest', 'hot', 'end_soon', 'coming', 'outdated']
- * city: ['shanghai', 'beijing',....]
- */
-module.exports = async (ctx) => {
- const city = ctx.params.city;
- const type = ctx.params.type || 'all';
- const url = `${baseUrl}/${city}/${type}`;
- const response = await got({
- method: 'get',
- url,
- headers: {
- Referer: url,
- },
- });
- const data = response.data;
- const $ = cheerio.load(data);
-
- const context = $('.imsm-section');
- const city_name = context.find('a > h3').text();
- const exhibition_type = context.find('li.active > a').text();
- const title = `${city_name} - ${exhibition_type} - 每日环球展览 iMuseum`;
-
- const list = $('.imsm-entries.list li');
- ctx.state.data = {
- title,
- link: url,
- description: $('meta[name="description"]').attr('content'),
- item:
- list &&
- list
- .map((item, index) => {
- item = $(index);
- const pretitle = item.find('.pretitle').children()[0].prev ? item.find('.pretitle').children()[0].prev.data : '';
- const subtitle = item.find('.subtitle').children()[0].next ? item.find('.subtitle').children()[0].next.data : '';
- return {
- title: item.find('div.title').text(),
- description: `${subtitle} ${pretitle} <img src="${item.find('img.cover').attr('src')}">`,
- link: `${baseUrl}${item.find('a.info').attr('href')}`,
- };
- })
- .get(),
- };
-};
diff --git a/lib/routes/namoc/announcement.js b/lib/routes/namoc/announcement.js
deleted file mode 100644
index 4e9849df3ba5e2..00000000000000
--- a/lib/routes/namoc/announcement.js
+++ /dev/null
@@ -1,64 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-const url = require('url');
-const logger = require('@/utils/logger');
-
-const host = 'http://www.namoc.org/xwzx/tzgg/2017gonggao/';
-
-module.exports = async (ctx) => {
- const response = await got.get(host);
-
- const $ = cheerio.load(response.data);
-
- const list = $('.news-list li:not(.clearfix)').slice(0, 5).get();
-
- const proList = [];
-
- const out = await Promise.all(
- list.map(async (item) => {
- const $ = cheerio.load(item);
- const title = $('a').text();
- const itemUrl = url.resolve(host, $('a').attr('href'));
- const cache = await ctx.cache.get(itemUrl);
- if (cache) {
- return Promise.resolve(JSON.parse(cache));
- }
- const single = {
- title,
- link: itemUrl,
- guid: itemUrl,
- };
-
- try {
- const es = got.get(itemUrl);
- proList.push(es);
- return Promise.resolve(single);
- } catch (err) {
- logger.error(`${title}: ${itemUrl} -- ${err.response.status}: ${err.response.statusText}`);
- }
- })
- );
-
- const responses = await got.all(proList);
- for (let i = 0; i < responses.length; i++) {
- const $ = cheerio.load(responses[i].data);
- const full = $('.content');
-
- const link = out[i].link.split('/');
- link.pop();
- const absLink = link.join('/');
-
- out[i].description = full
- .find('div.TRS_Editor')
- .html()
- .replace(/src="./g, `src="${absLink}`);
- out[i].author = '中国美术馆';
- out[i].pubDate = new Date(full.find('.news-info span:last-of-type').text().replace('时间:', '')).toUTCString();
- ctx.cache.set(out[i].link, JSON.stringify(out[i]));
- }
- ctx.state.data = {
- title: '中国美术馆 -- 通知公告',
- link: host,
- item: out,
- };
-};
diff --git a/lib/routes/namoc/exhibition.js b/lib/routes/namoc/exhibition.js
deleted file mode 100644
index 5f1e3e66853feb..00000000000000
--- a/lib/routes/namoc/exhibition.js
+++ /dev/null
@@ -1,67 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-const url = require('url');
-const logger = require('@/utils/logger');
-
-const host = 'http://www.namoc.org/zsjs/zlzx/';
-
-module.exports = async (ctx) => {
- const response = await got.get(host);
-
- const $ = cheerio.load(response.data);
-
- const list = $('#content div.rec-exh-news-list div.wrap:nth-of-type(2)').find('li').get();
- const proList = [];
-
- const out = await Promise.all(
- list.map(async (item) => {
- const $ = cheerio.load(item);
- const title = $('a').text();
- const itemUrl = url.resolve(host, $('a').attr('href'));
- const cache = await ctx.cache.get(itemUrl);
- if (cache) {
- return Promise.resolve(JSON.parse(cache));
- }
- const single = {
- title,
- link: itemUrl,
- guid: itemUrl,
- };
-
- try {
- const es = got.get(itemUrl);
- proList.push(es);
- return Promise.resolve(single);
- } catch (err) {
- logger.error(`${title}: ${itemUrl} -- ${err.response.status}: ${err.response.statusText}`);
- }
- })
- );
-
- const responses = await got.all(proList);
- for (let i = 0; i < responses.length; i++) {
- const $ = cheerio.load(responses[i].data);
- const full = $('#content');
-
- let info = full.find('ul.info');
- info = $(info).remove('.fav_btn');
-
- const from = $(info).find('script:first-of-type').html().replace('getExhDate("', '').replace('");', '');
- const to = $(info).find('script:last-of-type').html().replace('getExhDate("', '').replace('");', '');
-
- $(info).find('script:first-of-type').replaceWith(from);
- $(info).find('script:last-of-type').replaceWith(to);
-
- const intro = full.find('div.Custom_UnionStyle').html();
- const cover = full.find('p.image-list').html();
- out[i].description = cover + info + intro;
- out[i].author = full.find('.news-info span:first-of-type').text().replace('来源:', '');
- out[i].pubDate = new Date(full.find('.news-info span:last-of-type').text().replace('时间:', '')).toUTCString();
- ctx.cache.set(out[i].link, JSON.stringify(out[i]));
- }
- ctx.state.data = {
- title: '中国美术馆 -- 展览预告',
- link: host,
- item: out,
- };
-};
diff --git a/lib/routes/namoc/media.js b/lib/routes/namoc/media.js
deleted file mode 100644
index ecfe951e8aaf3e..00000000000000
--- a/lib/routes/namoc/media.js
+++ /dev/null
@@ -1,67 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-const url = require('url');
-const logger = require('@/utils/logger');
-
-const host = 'http://www.namoc.org/xwzx/mtry/2018/';
-
-module.exports = async (ctx) => {
- const response = await got.get(host);
-
- const $ = cheerio.load(response.data);
-
- const list = $('.news-list li:not(.clearfix)').slice(0, 10).get();
-
- const proList = [];
-
- const out = await Promise.all(
- list.map(async (item) => {
- const $ = cheerio.load(item);
- const title = $('a').text();
- const itemUrl = url.resolve(host, $('a').attr('href'));
-
- const cache = await ctx.cache.get(itemUrl);
- if (cache) {
- return Promise.resolve(JSON.parse(cache));
- }
- const single = {
- title,
- link: itemUrl,
- guid: itemUrl,
- };
-
- try {
- const es = got.get(itemUrl);
- proList.push(es);
- return Promise.resolve(single);
- } catch (err) {
- logger.error(`${title}: ${itemUrl} -- ${err.response.status}: ${err.response.statusText}`);
- }
- })
- );
-
- const responses = await got.all(proList);
- for (let i = 0; i < responses.length; i++) {
- if (url.parse(out[i].link).hostname === url.parse(host).hostname) {
- const $ = cheerio.load(responses[i].data);
- const full = $('.content');
-
- const link = out[i].link.split('/');
- link.pop();
- const absLink = link.join('/');
-
- out[i].description = full
- .find('div.TRS_Editor')
- .html()
- .replace(/src="./g, `src="${absLink}`);
- out[i].author = full.find('.news-info span:first-of-type').text().replace('来源:', '');
- out[i].pubDate = new Date(full.find('.news-info span:last-of-type').text().replace('时间:', '')).toUTCString();
- ctx.cache.set(out[i].link, JSON.stringify(out[i]));
- }
- }
- ctx.state.data = {
- title: '中国美术馆 -- 媒体联报',
- link: host,
- item: out,
- };
-};
diff --git a/lib/routes/namoc/news.js b/lib/routes/namoc/news.js
deleted file mode 100644
index 582549fff8a1bc..00000000000000
--- a/lib/routes/namoc/news.js
+++ /dev/null
@@ -1,67 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-const url = require('url');
-const logger = require('@/utils/logger');
-
-const host = 'http://www.namoc.org/xwzx/xw/xinwen/';
-
-module.exports = async (ctx) => {
- const response = await got.get(host);
-
- const $ = cheerio.load(response.data);
-
- const list = $('.news-list li:not(.clearfix)').slice(0, 10).get();
-
- const proList = [];
-
- const out = await Promise.all(
- list.map(async (item) => {
- const $ = cheerio.load(item);
- const title = $('a').text();
- const itemUrl = url.resolve(host, $('a').attr('href'));
-
- const cache = await ctx.cache.get(itemUrl);
- if (cache) {
- return Promise.resolve(JSON.parse(cache));
- }
- const single = {
- title,
- link: itemUrl,
- guid: itemUrl,
- };
-
- try {
- const es = got.get(itemUrl);
- proList.push(es);
- return Promise.resolve(single);
- } catch (err) {
- logger.error(`${title}: ${itemUrl} -- ${err.response.status}: ${err.response.statusText}`);
- }
- })
- );
-
- const responses = await got.all(proList);
- for (let i = 0; i < responses.length; i++) {
- if (url.parse(out[i].link).hostname === url.parse(host).hostname) {
- const $ = cheerio.load(responses[i].data);
- const full = $('.content');
-
- const link = out[i].link.split('/');
- link.pop();
- const absLink = link.join('/');
-
- out[i].description = full
- .find('div.TRS_Editor')
- .html()
- .replace(/src="./g, `src="${absLink}`);
- out[i].author = full.find('.news-info span:first-of-type').text().replace('来源:', '');
- out[i].pubDate = new Date(full.find('.news-info span:last-of-type').text().replace('时间:', '')).toUTCString();
- ctx.cache.set(out[i].link, JSON.stringify(out[i]));
- }
- }
- ctx.state.data = {
- title: '中国美术馆 -- 新闻',
- link: host,
- item: out,
- };
-};
diff --git a/lib/routes/namoc/specials.js b/lib/routes/namoc/specials.js
deleted file mode 100644
index b23c685dcc387a..00000000000000
--- a/lib/routes/namoc/specials.js
+++ /dev/null
@@ -1,42 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-
-const host = 'http://www.namoc.org/xwzx/jdzt/2018zhuanti/';
-
-module.exports = async (ctx) => {
- const response = await got.get(host);
-
- const $ = cheerio.load(response.data);
-
- const list = $('div.inner div.list li').slice(0, 5).get();
-
- const out = await Promise.all(
- list.map(async (item) => {
- const $ = cheerio.load(item);
- const title = $('div.text a').text();
- const itemUrl = $('div.text a').attr('href');
- const cache = await ctx.cache.get(itemUrl);
- if (cache) {
- return Promise.resolve(JSON.parse(cache));
- }
-
- const cover = $('p.image a')
- .html()
- .replace(/src="./g, `src="${host}`);
-
- const single = {
- title,
- link: itemUrl,
- guid: itemUrl,
- description: cover + $('div.text div').html(),
- pubDate: new Date($('span.date').text()).toUTCString(),
- };
- return Promise.resolve(single);
- })
- );
- ctx.state.data = {
- title: '中国美术馆 -- 焦点专题',
- link: host,
- item: out,
- };
-};
diff --git a/lib/v2/guggenheim/exhibitions.js b/lib/v2/guggenheim/exhibitions.js
deleted file mode 100644
index 150152604d8e80..00000000000000
--- a/lib/v2/guggenheim/exhibitions.js
+++ /dev/null
@@ -1,29 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-const { parseDate } = require('@/utils/parse-date');
-
-module.exports = async (ctx) => {
- const link = 'https://www.guggenheim.org/exhibitions';
-
- const response = await got({
- url: link,
- method: 'GET',
- });
-
- const code = cheerio.load(response.data)('#app-js-extra').html();
- const data = JSON.parse(code.match(/var bootstrap = ([^\n]*);/)[1]);
- const exhibitions = data.initial.main.posts.featuredExhibitions;
- const items = [].concat(exhibitions.past.items ?? [], exhibitions.on_view.items ?? [], exhibitions.upcoming.items ?? []);
-
- ctx.state.data = {
- link,
- url: link,
- title: 'The Guggenheim Museums and Foundation - Exhibitions',
- item: items.map((ex) => ({
- title: ex.title,
- link: `https://www.guggenheim.org/exhibition/${ex.slug}`,
- description: ex.excerpt,
- pubDate: ex.dates ? parseDate(`${ex.dates.start.month} ${ex.dates.start.day}, ${ex.dates.start.year}`, 'MMMM D, YYYY') : null,
- })),
- };
-};
diff --git a/lib/v2/guggenheim/maintainer.js b/lib/v2/guggenheim/maintainer.js
deleted file mode 100644
index 2b582f7fce773b..00000000000000
--- a/lib/v2/guggenheim/maintainer.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- '/exhibitions': ['chazeon'],
-};
diff --git a/lib/v2/guggenheim/radar.js b/lib/v2/guggenheim/radar.js
deleted file mode 100644
index 2e5e5d1c3c5531..00000000000000
--- a/lib/v2/guggenheim/radar.js
+++ /dev/null
@@ -1,11 +0,0 @@
-module.exports = {
- 'guggenheim.org': {
- _name: 'Solomon R. Guggenheim Museum',
- www: [
- {
- title: 'Exhibitions',
- docs: 'https://docs.rsshub.app/routes/en/travel#solomon-r-guggenheim-museum',
- },
- ],
- },
-};
diff --git a/lib/v2/guggenheim/router.js b/lib/v2/guggenheim/router.js
deleted file mode 100644
index d98b7c8845a250..00000000000000
--- a/lib/v2/guggenheim/router.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = function (router) {
- router.get('/exhibitions', require('./exhibitions'));
-};
diff --git a/lib/v2/mcachicago/exhibitions.js b/lib/v2/mcachicago/exhibitions.js
deleted file mode 100644
index 9fe1e4b41ea71b..00000000000000
--- a/lib/v2/mcachicago/exhibitions.js
+++ /dev/null
@@ -1,17 +0,0 @@
-const buildData = require('@/utils/common-config');
-
-module.exports = async (ctx) => {
- const link = 'https://mcachicago.org/exhibitions';
-
- ctx.state.data = await buildData({
- link,
- url: link,
- title: 'MCA Chicago - Exhibitions',
- item: {
- item: '#exhibitions .card',
- title: `$('.title').text()`,
- link: `$('a').attr('href')`,
- // description: `$('a').html()`,
- },
- });
-};
diff --git a/lib/v2/mcachicago/maintainer.js b/lib/v2/mcachicago/maintainer.js
deleted file mode 100644
index 2b582f7fce773b..00000000000000
--- a/lib/v2/mcachicago/maintainer.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- '/exhibitions': ['chazeon'],
-};
diff --git a/lib/v2/mcachicago/radar.js b/lib/v2/mcachicago/radar.js
deleted file mode 100644
index 9fcf2d4c4ea6e3..00000000000000
--- a/lib/v2/mcachicago/radar.js
+++ /dev/null
@@ -1,11 +0,0 @@
-module.exports = {
- 'mcachicago.org': {
- _name: 'MCA Chicago',
- '.': [
- {
- title: 'Exhibitions',
- docs: 'https://docs.rsshub.app/routes/en/travel#museum-of-contemporary-art-chicago',
- },
- ],
- },
-};
diff --git a/lib/v2/mcachicago/router.js b/lib/v2/mcachicago/router.js
deleted file mode 100644
index d98b7c8845a250..00000000000000
--- a/lib/v2/mcachicago/router.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = function (router) {
- router.get('/exhibitions', require('./exhibitions'));
-};
diff --git a/website/docs/routes/travel.mdx b/website/docs/routes/travel.mdx
index 6d7936285c30bb..4ff25ff2831c36 100644
--- a/website/docs/routes/travel.mdx
+++ b/website/docs/routes/travel.mdx
@@ -10,50 +10,12 @@
<Route author="Fatpandac" example="/12306/2022-02-19/重庆/永川东" path="/12306/:date/:from/:to/:type?" paramsDesc={['时间,格式为(YYYY-MM-DD)', '始发站', '终点站', '售票类型,成人和学生可选,默认为成人']} />
-## All the Flight Deals {#all-the-flight-deals}
-
-### Flight Deals {#all-the-flight-deals-flight-deals}
-
-<Route author="HenryQW" path="/atfd/:locations/:nearby?" example="/atfd/us+new%20york,gb+london/1" paramsDesc={['the departing city, consists of an 「ISO 3166-1 country code」 and a 「city name」. Origin\'s ISO 3166-1 country code + city name, eg. `us+new york`, [https://rsshub.app/atfd/us+new york](https://rsshub.app/atfd/us+new%20york). Multiple origins are supported via a comma separated string, eg. `us+new york,gb+london`, [https://rsshub.app/atfd/us+new york,gb+london/](https://rsshub.app/atfd/us+new%20york,gb+london/).', 'whether includes nearby airports, optional value of 0 or 1, default to 0 (exclude nearby airports)']} notOperational="1">
- For ISO 3166-1 country codes please refer to [Wikipedia ISO\_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1)
-
- :::tip
- If the city name contains a space like `Mexico City`, replace the space with `%20`, `Mexico%20City`.
- :::
-</Route>
-
## Brooklyn Museum 纽约布鲁克林博物馆 {#brooklyn-museum-niu-yue-bu-lu-ke-lin-bo-wu-guan}
### Exhibitions {#brooklyn-museum-niu-yue-bu-lu-ke-lin-bo-wu-guan-exhibitions}
<Route author="chazeon" example="/brooklynmuseum/exhibitions" path="/brooklynmuseum/exhibitions/:state?" paramsDesc={['展览进行的状态:`current` 对应展览当前正在进行,`past` 对应过去的展览,`upcoming` 对应即将举办的展览,默认为 `current`']} />
-## Hopper {#hopper}
-
-### Flight Deals {#hopper-flight-deals}
-
-<Route author="HenryQW" path="/hopper/:lowestOnly/:from/:to?" example="/hopper/1/LHR/PEK" paramsDesc={['set to `1` will return the cheapest deal only, instead of all deals, so you don\'t get spammed', 'origin airport IATA code', 'destination airport IATA code, if unset the destination will be set to `anywhere`']} notOperational="1">
- This route returns a list of flight deals (in most cases, 6 flight deals) for a period defined by Hopper's algorithm, which means the travel date will be totally random (could be tomorrow or 10 months from now).
-
- For airport IATA code please refer to [Wikipedia List of airports by IATA code](https://en.wikipedia.org/wiki/List_of_airports_by_IATA_code:_A)
-</Route>
-
-## iMuseum {#imuseum}
-
-### 展览信息 {#imuseum-zhan-lan-xin-xi}
-
-<Route author="sinchang" example="/imuseum/shanghai/all" path="/imuseum/:city/:type?" paramsDesc={['如 shanghai, beijing', '不填则默认为 `all`']} notOperational="1">
- | 全部 | 最新 | 热门 | 即将结束 | 即将开始 | 已结束 |
- | ---- | ------ | ---- | --------- | -------- | -------- |
- | all | latest | hot | end\_soon | coming | outdated |
-</Route>
-
-## Museum of Contemporary Art Chicago 芝加哥当代艺术博物馆 {#museum-of-contemporary-art-chicago-zhi-jia-ge-dang-dai-yi-shu-bo-wu-guan}
-
-### Exhibitions {#museum-of-contemporary-art-chicago-zhi-jia-ge-dang-dai-yi-shu-bo-wu-guan-exhibitions}
-
-<Route author="chazeon" example="/mcachicago/exhibitions" path="/mcachicago/exhibitions" notOperational="1" />
-
## National Geographic {#national-geographic}
### Latest Stories {#national-geographic-latest-stories}
@@ -66,12 +28,6 @@
<Route author="chazeon" example="/newmuseum/exhibitions" path="/newmuseum/exhibitions" />
-## The Guggenheim Museums and Foundation {#the-guggenheim-museums-and-foundation}
-
-### Solomon R. Guggenheim Museum 纽约古根海姆基金会 - Exhibitions {#the-guggenheim-museums-and-foundation-solomon-r-guggenheim-museum-niu-yue-gu-gen-hai-mu-ji-jin-hui-exhibitions}
-
-<Route author="chazeon" example="/guggenheim/exhibitions" path="/guggenheim/exhibitions" notOperational="1" />
-
## 飞客茶馆 {#fei-ke-cha-guan}
### 优惠信息 {#fei-ke-cha-guan-you-hui-xin-xi}
@@ -158,16 +114,6 @@
<Route author="LandonLi" example="/airchina/announcement" path="/airchina/announcement" radar="1" />
-## 中国美术馆 {#zhong-guo-mei-shu-guan}
-
-### 美术馆新闻 {#zhong-guo-mei-shu-guan-mei-shu-guan-xin-wen}
-
-<Route author="HenryQW" example="/namoc/announcement" path="/namoc/:type" paramsDesc={['新闻类型, 可选如下']} notOperational="1">
- | 通知公告 | 新闻 | 媒体联报 | 展览预告 | 焦点专题 |
- | ------------ | ---- | -------- | ---------- | -------- |
- | announcement | news | media | exhibition | specials |
-</Route>
-
## 走进日本 {#zou-jin-ri-ben}
### 政治外交 {#zou-jin-ri-ben-zheng-zhi-wai-jiao}
|
abbf0166f7c4f972a88ac3ebafe384622952e4c2
|
2020-09-07 15:45:39
|
Ethan Shen
|
feat: add 1X photos (#5616)
| false
|
add 1X photos (#5616)
|
feat
|
diff --git a/docs/en/picture.md b/docs/en/picture.md
index 89ab7cd6b61d7e..bca8033c03fe1e 100644
--- a/docs/en/picture.md
+++ b/docs/en/picture.md
@@ -4,6 +4,38 @@ pageClass: routes
# Picture
+## 1X
+
+### Photos
+
+<RouteEn author="nczitzk" example="/1x/latest/all" path="/1x/:type?/:caty?" :paramsDesc="['sort type, `latest` by default, or `popular` or `curators-choice`', 'picture category, `all` by default, see below']">
+
+| Picture Category | Code |
+| -------------- | ------------- |
+| All categories | all |
+| Abstract | abstract |
+| Action | action |
+| Animals | animals |
+| Architecture | architecture |
+| Conceptual | conceptual |
+| Creative edit | creative-edit |
+| Documentary | documentary |
+| Everyday | everyday |
+| Fine Art Nude | fine-art-nude |
+| Humour | humour |
+| Landscape | landscape |
+| Macro | macro |
+| Mood | mood |
+| Night | night |
+| Performance | performance |
+| Portrait | portrait |
+| Still life | still-life |
+| Street | street |
+| Underwater | underwater |
+| Wildlife | wildlife |
+
+</RouteEn>
+
## Awesome Pigtails
### New
diff --git a/docs/picture.md b/docs/picture.md
index c474be23f1bcfe..b0bf368512f294 100644
--- a/docs/picture.md
+++ b/docs/picture.md
@@ -4,6 +4,38 @@ pageClass: routes
# 图片
+## 1X
+
+### Photos
+
+<Route author="nczitzk" example="/1x/latest/all" path="/1x/:type?/:caty?" :paramsDesc="['排序类型,默认为 `latest`,亦可选 `popular` 或 `curators-choice`', '图片类别,默认为 `all`,见下表']">
+
+| 图片类别 | 代码 |
+| -------------- | ------------- |
+| All categories | all |
+| Abstract | abstract |
+| Action | action |
+| Animals | animals |
+| Architecture | architecture |
+| Conceptual | conceptual |
+| Creative edit | creative-edit |
+| Documentary | documentary |
+| Everyday | everyday |
+| Fine Art Nude | fine-art-nude |
+| Humour | humour |
+| Landscape | landscape |
+| Macro | macro |
+| Mood | mood |
+| Night | night |
+| Performance | performance |
+| Portrait | portrait |
+| Still life | still-life |
+| Street | street |
+| Underwater | underwater |
+| Wildlife | wildlife |
+
+</Route>
+
## Awesome Pigtails
### 最新图片
diff --git a/lib/router.js b/lib/router.js
index 29265341939b01..6028e96b2d2cf4 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -3188,4 +3188,7 @@ router.get('/chuhaibiji', require('./routes/chuhaibiji/index'));
// 建宁闲谈
router.get('/blogs/jianning', require('./routes/blogs/jianning'));
+// 1X
+router.get('/1x/:type?/:caty?', require('./routes/1x/index'));
+
module.exports = router;
diff --git a/lib/routes/1x/index.js b/lib/routes/1x/index.js
new file mode 100644
index 00000000000000..5e4fc0c2b91f28
--- /dev/null
+++ b/lib/routes/1x/index.js
@@ -0,0 +1,36 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ ctx.params.type = ctx.params.type || 'latest';
+ ctx.params.caty = ctx.params.caty || 'all';
+
+ const rootUrl = `https://1x.com`;
+ const currentUrl = `${rootUrl}/photos/${ctx.params.type}/${ctx.params.caty}`;
+ const response = await got({
+ method: 'get',
+ url: currentUrl,
+ });
+
+ const $ = cheerio.load(response.data);
+
+ const list = $('#photos_target')
+ .find('td a img')
+ .slice(0, 30)
+ .map((_, item) => {
+ item = $(item);
+ return {
+ title: item.attr('title'),
+ link: `${rootUrl}/${item.parent().attr('href')}`,
+ description: `<img src="${item.attr('src')}">`,
+ author: item.attr('title'),
+ };
+ })
+ .get();
+
+ ctx.state.data = {
+ title: `${$('title').text()} - ${ctx.params.caty}`,
+ link: currentUrl,
+ item: list,
+ };
+};
|
f0ce97976f0420370c97fb15306c445b5f2adbd2
|
2024-05-09 17:44:58
|
dependabot[bot]
|
chore(deps-dev): bump eslint-plugin-n from 17.5.0 to 17.5.1 (#15527)
| false
|
bump eslint-plugin-n from 17.5.0 to 17.5.1 (#15527)
|
chore
|
diff --git a/package.json b/package.json
index 14797239775a47..459fb6b50e41dc 100644
--- a/package.json
+++ b/package.json
@@ -160,7 +160,7 @@
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-nibble": "8.1.0",
- "eslint-plugin-n": "17.5.0",
+ "eslint-plugin-n": "17.5.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-unicorn": "52.0.0",
"eslint-plugin-yml": "1.14.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7b27232591d711..e4df6ed716d0f4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -334,8 +334,8 @@ importers:
specifier: 8.1.0
version: 8.1.0([email protected])
eslint-plugin-n:
- specifier: 17.5.0
- version: 17.5.0([email protected])
+ specifier: 17.5.1
+ version: 17.5.1([email protected])
eslint-plugin-prettier:
specifier: 5.1.3
version: 5.1.3(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])
@@ -2688,8 +2688,8 @@ packages:
peerDependencies:
eslint: '>=8'
- [email protected]:
- resolution: {integrity: sha512-r7i+NY+RVXQi4Q7sKCG5H4464saJWddDk7QFQjtj+wU//sf15QCq3M8LwZU2yiE45yhVUT9DXW+8AbXRQKJLPQ==}
+ [email protected]:
+ resolution: {integrity: sha512-+E242KoY16xtwqqBRgSsDCrZ3K40jg3Np9fOgQyakcHaqymK3bnxYB1F1oe8Ksts8TDDViROFgraoLzbWhfHVw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: '>=8.23.0'
@@ -8032,7 +8032,7 @@ snapshots:
eslint: 8.57.0
eslint-compat-utils: 0.5.0([email protected])
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
'@eslint-community/eslint-utils': 4.4.0([email protected])
enhanced-resolve: 5.16.1
|
f2ac1e1e64dc8b09b118946cbb91ef241af50bf3
|
2024-10-03 17:48:14
|
dependabot[bot]
|
chore(deps-dev): bump @babel/preset-typescript from 7.24.7 to 7.25.7 (#16995)
| false
|
bump @babel/preset-typescript from 7.24.7 to 7.25.7 (#16995)
|
chore
|
diff --git a/package.json b/package.json
index 1d19cc14dc5db2..798aa469ffc922 100644
--- a/package.json
+++ b/package.json
@@ -136,7 +136,7 @@
},
"devDependencies": {
"@babel/preset-env": "7.25.7",
- "@babel/preset-typescript": "7.24.7",
+ "@babel/preset-typescript": "7.25.7",
"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.11.1",
"@microsoft/eslint-formatter-sarif": "3.1.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f6d449ced1eac9..78acf105d75368 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -262,8 +262,8 @@ importers:
specifier: 7.25.7
version: 7.25.7(@babel/[email protected])
'@babel/preset-typescript':
- specifier: 7.24.7
- version: 7.24.7(@babel/[email protected])
+ specifier: 7.25.7
+ version: 7.25.7(@babel/[email protected])
'@eslint/eslintrc':
specifier: 3.1.0
version: 3.1.0
@@ -1012,8 +1012,8 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0
- '@babel/[email protected]':
- resolution: {integrity: sha512-SyXRe3OdWwIwalxDg5UtJnJQO+YPcTfwiIY2B0Xlddh9o7jpWLvv8X1RthIeDOxQ+O1ML5BLPCONToObyVQVuQ==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-rkkpaXJZOFN45Fb+Gki0c+KMIglk4+zZXOoMJuyEK8y8Kkc8Jd3BDmP7qPsz0zQMJj+UD7EprF+AqAXcILnexw==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
@@ -6631,7 +6631,7 @@ snapshots:
'@babel/types': 7.25.7
esutils: 2.0.3
- '@babel/[email protected](@babel/[email protected])':
+ '@babel/[email protected](@babel/[email protected])':
dependencies:
'@babel/core': 7.25.7
'@babel/helper-plugin-utils': 7.25.7
|
01a16fd04a8fa9538f6865240b127d62f3cb7045
|
2024-03-19 10:46:10
|
MajexH
|
fix(route): Fix gov/chongqing/sydwgkzp error (#14827)
| false
|
Fix gov/chongqing/sydwgkzp error (#14827)
|
fix
|
diff --git a/lib/routes/gov/chongqing/gzw.ts b/lib/routes/gov/chongqing/gzw.ts
index 58e79b6391f85e..39ee3786b6f9f1 100644
--- a/lib/routes/gov/chongqing/gzw.ts
+++ b/lib/routes/gov/chongqing/gzw.ts
@@ -7,9 +7,22 @@ import { parseDate } from '@/utils/parse-date';
export const route: Route = {
path: '/chongqing/gzw/:category{.+}?',
- name: 'Unknown',
- maintainers: [],
+ parameters: {
+ category: '分类,见下表,默认为通知公告',
+ },
+ name: '重庆市人民政府 国有资产监督管理委员会',
+ url: 'gzw.cq.gov.cn',
+ maintainers: ['nczitzk'],
handler,
+ radar: [
+ {
+ source: 'gzw.cq.gov.cn/*category',
+ target: '/chongqing/gzw/*category',
+ },
+ ],
+ description: `| 通知公告 | 国企资讯 | 国企简介 | 国企招聘 |
+ | --------- | -------- | -------- | -------- |
+ | tzgg\_191 | gqdj | gqjj | gqzp |`,
};
async function handler(ctx) {
diff --git a/lib/routes/gov/chongqing/rsks.ts b/lib/routes/gov/chongqing/rsks.ts
index 6ef3db5be522ad..09f6f66be11ab1 100644
--- a/lib/routes/gov/chongqing/rsks.ts
+++ b/lib/routes/gov/chongqing/rsks.ts
@@ -8,21 +8,12 @@ export const route: Route = {
path: '/chongqing/rsks',
categories: ['government'],
example: '/gov/chongqing/rsks',
- parameters: {},
- features: {
- requireConfig: false,
- requirePuppeteer: false,
- antiCrawler: false,
- supportBT: false,
- supportPodcast: false,
- supportScihub: false,
- },
radar: [
{
source: ['rlsbj.cq.gov.cn/'],
},
],
- name: '重庆人事考试通知公告',
+ name: '重庆市人民政府 人力社保局 - 人事考试通知',
maintainers: ['Mai19930513'],
handler,
url: 'rlsbj.cq.gov.cn/',
diff --git a/lib/routes/gov/chongqing/sydwgkzp.ts b/lib/routes/gov/chongqing/sydwgkzp.ts
index b7c256277b8aef..7133a02a3a50d3 100644
--- a/lib/routes/gov/chongqing/sydwgkzp.ts
+++ b/lib/routes/gov/chongqing/sydwgkzp.ts
@@ -1,47 +1,41 @@
-import { Route } from '@/types';
+import { Route, Data } from '@/types';
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
-
-// 重庆市事业单位公开招聘
-const sydwgkzpUrl = 'https://rlsbj.cq.gov.cn/zwxx_182/sydw/';
+import type { Context } from 'hono';
export const route: Route = {
- path: '/chongqing/sydwgkzp',
+ path: '/chongqing/sydwgkzp/:year?',
+ url: 'rlsbj.cq.gov.cn/',
categories: ['government'],
example: '/gov/chongqing/sydwgkzp',
- parameters: {},
- features: {
- requireConfig: false,
- requirePuppeteer: false,
- antiCrawler: false,
- supportBT: false,
- supportPodcast: false,
- supportScihub: false,
+ parameters: {
+ year: '需要订阅的年份,格式为`YYYY`,必须小于等于当前年份,默认为当前年份',
},
radar: [
{
source: ['rlsbj.cq.gov.cn/'],
},
],
- name: '人力社保局',
+ name: '重庆市人民政府 人力社保局 - 事业单位公开招聘',
maintainers: ['MajexH'],
handler,
- url: 'rlsbj.cq.gov.cn/',
- description: `#### 人事考试通知 {#chong-qing-shi-ren-min-zheng-fu-ren-li-she-bao-ju-ren-shi-kao-shi-tong-zhi}
+};
+async function handler(ctx: Context): Promise<Data> {
+ // 获取用户输入的 year
+ const { year = currentYear() }: { year?: number } = ctx.req.param();
-#### 事业单位公开招聘 {#chong-qing-shi-ren-min-zheng-fu-ren-li-she-bao-ju-shi-ye-dan-wei-gong-kai-zhao-pin}`,
-};
+ // 替换 url
+ const sydwgkzpUrl = `https://rlsbj.cq.gov.cn/zwxx_182/sydw/sydwgkzp${year}/`;
-async function handler() {
- const { data: response } = await got(sydwgkzpUrl);
+ const { data: response }: { data: any } = await got(sydwgkzpUrl);
const $ = load(response);
// 获取所有的标题
- const list = $('div.page-list .tab-item > li')
+ const list = $('div[class="p-rt rt"] .tab-item > li')
.toArray()
.map((item) => {
item = $(item);
@@ -60,10 +54,10 @@ async function handler() {
const items = await Promise.all(
list.map((item) =>
cache.tryGet(item.link, async () => {
- const { data: response } = await got(item.link);
+ const { data: response }: { data: any } = await got(item.link);
const $ = load(response);
// 主题正文
- item.description = $('div[class="view TRS_UEDITOR trs_paper_default trs_web"]').first().html();
+ item.description = $('div[class="trs_editor_view TRS_UEDITOR trs_paper_default trs_web"]').first().html();
return item;
})
)
@@ -75,3 +69,7 @@ async function handler() {
item: items,
};
}
+
+function currentYear(): number {
+ return new Date().getFullYear();
+}
|
2e5df2aa53b08df66231af6f1def25e8ba173030
|
2023-02-15 01:39:36
|
DIYgod
|
feat: add crossbell
| false
|
add crossbell
|
feat
|
diff --git a/docs/en/social-media.md b/docs/en/social-media.md
index fe0ecf5166d709..7e33349a797a57 100644
--- a/docs/en/social-media.md
+++ b/docs/en/social-media.md
@@ -4,6 +4,24 @@ pageClass: routes
# Social Media
+## Crossbell
+
+### Notes
+
+<RouteEn author="DIYgod" example="/crossbell/notes" path="/crossbell/notes" radar="1" rssbud="1"/>
+
+### Notes of character
+
+<RouteEn author="DIYgod" example="/crossbell/notes/character/10" path="/crossbell/notes/character/:characterId" radar="1" rssbud="1"/>
+
+### Notes of source
+
+<RouteEn author="DIYgod" example="/crossbell/notes/source/xlog" path="/crossbell/notes/source/:source" radar="1" rssbud="1"/>
+
+### Feeds of following
+
+<RouteEn author="DIYgod" example="/crossbell/feeds/following/10" path="/crossbell/feeds/following/:characterId" radar="1" rssbud="1"/>
+
## CuriousCat
### User
diff --git a/docs/social-media.md b/docs/social-media.md
index 34d44f97ac0145..6279d19f5ccadd 100644
--- a/docs/social-media.md
+++ b/docs/social-media.md
@@ -344,6 +344,24 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
</Route>
+## Crossbell
+
+### Notes
+
+<Route author="DIYgod" example="/crossbell/notes" path="/crossbell/notes" radar="1" rssbud="1"/>
+
+### Notes of character
+
+<Route author="DIYgod" example="/crossbell/notes/character/10" path="/crossbell/notes/character/:characterId" radar="1" rssbud="1"/>
+
+### Notes of source
+
+<Route author="DIYgod" example="/crossbell/notes/source/xlog" path="/crossbell/notes/source/:source" radar="1" rssbud="1"/>
+
+### Feeds of following
+
+<Route author="DIYgod" example="/crossbell/feeds/following/10" path="/crossbell/feeds/following/:characterId" radar="1" rssbud="1"/>
+
## Curius
### 用户
diff --git a/lib/v2/crossbell/feeds/following.js b/lib/v2/crossbell/feeds/following.js
new file mode 100644
index 00000000000000..65cea84d46e2b4
--- /dev/null
+++ b/lib/v2/crossbell/feeds/following.js
@@ -0,0 +1,22 @@
+const got = require('@/utils/got');
+
+module.exports = async (ctx) => {
+ const characterId = ctx.params.characterId;
+ const response = await got(`https://indexer.crossbell.io/v1/characters/${characterId}/feed/follow`);
+ ctx.state.data = {
+ title: 'Crossbell Feeds of ' + characterId,
+ link: 'https://crossbell.io/',
+ item: response.data?.list?.map((item) => ({
+ title: `${item.type} ${item.character.metadata?.content?.name}@${item.character.handle}`,
+ description: `${item.type} ${item.note && `<br>Note: ${item.note.metadata?.content?.title || item.note.metadata?.content?.content}`}${
+ item.character && `<br>Character: ${item.character.metadata?.content?.name}@${item.character.handle}`
+ }`,
+ link: item.note ? item.note?.metadata?.content?.external_urls || `https://crossbell.io/notes/${item.note?.characterId}-${item.note?.noteId}` : 'https://xchar.app/' + item.character?.handle,
+ pubDate: item.createdAt,
+ updated: item.updatedAt,
+ author: item.note?.metadata?.content?.authors?.[0] || item.note?.character?.metadata?.content?.name || item.note?.character?.handle || item.owner,
+ guid: item.transactionHash + item.logIndex + item.type,
+ category: [...(item.note?.metadata?.content?.sources || []), ...(item.note?.metadata?.content?.tags || [])],
+ })),
+ };
+};
diff --git a/lib/v2/crossbell/maintainer.js b/lib/v2/crossbell/maintainer.js
new file mode 100644
index 00000000000000..1414ea3b0bafec
--- /dev/null
+++ b/lib/v2/crossbell/maintainer.js
@@ -0,0 +1,6 @@
+module.exports = {
+ '/notes': ['DIYgod'],
+ '/notes/character/:characterId': ['DIYgod'],
+ '/notes/source/:source': ['DIYgod'],
+ '/feeds/following/:characterId': ['DIYgod'],
+};
diff --git a/lib/v2/crossbell/notes/character.js b/lib/v2/crossbell/notes/character.js
new file mode 100644
index 00000000000000..c688feb1a22e67
--- /dev/null
+++ b/lib/v2/crossbell/notes/character.js
@@ -0,0 +1,22 @@
+const got = require('@/utils/got');
+const { getItem } = require('./utils');
+
+module.exports = async (ctx) => {
+ const characterId = ctx.params.characterId;
+
+ const response = await got('https://indexer.crossbell.io/v1/notes', {
+ searchParams: {
+ characterId,
+ includeCharacter: true,
+ },
+ });
+
+ const name = response.data?.list?.[0]?.character?.metadata?.content?.name || response.data?.list?.[0]?.character?.handle || characterId;
+ const handle = response.data?.list?.[0]?.character?.handle;
+
+ ctx.state.data = {
+ title: 'Crossbell Notes from ' + name,
+ link: 'https://xchar.app/' + handle,
+ item: response.data?.list?.map((item) => getItem(item)),
+ };
+};
diff --git a/lib/v2/crossbell/notes/index.js b/lib/v2/crossbell/notes/index.js
new file mode 100644
index 00000000000000..1450ddc4b89c98
--- /dev/null
+++ b/lib/v2/crossbell/notes/index.js
@@ -0,0 +1,16 @@
+const got = require('@/utils/got');
+const { getItem } = require('./utils');
+
+module.exports = async (ctx) => {
+ const response = await got('https://indexer.crossbell.io/v1/notes', {
+ searchParams: {
+ includeCharacter: true,
+ },
+ });
+
+ ctx.state.data = {
+ title: 'Crossbell Notes',
+ link: 'https://crossbell.io/',
+ item: response.data?.list?.map((item) => getItem(item)),
+ };
+};
diff --git a/lib/v2/crossbell/notes/source.js b/lib/v2/crossbell/notes/source.js
new file mode 100644
index 00000000000000..53edab3c4747f6
--- /dev/null
+++ b/lib/v2/crossbell/notes/source.js
@@ -0,0 +1,19 @@
+const got = require('@/utils/got');
+const { getItem } = require('./utils');
+
+module.exports = async (ctx) => {
+ const source = ctx.params.source;
+
+ const response = await got('https://indexer.crossbell.io/v1/notes', {
+ searchParams: {
+ sources: source,
+ includeCharacter: true,
+ },
+ });
+
+ ctx.state.data = {
+ title: 'Crossbell Notes from ' + source,
+ link: 'https://crossbell.io/',
+ item: response.data?.list?.map((item) => getItem(item)),
+ };
+};
diff --git a/lib/v2/crossbell/notes/utils.js b/lib/v2/crossbell/notes/utils.js
new file mode 100644
index 00000000000000..a1f45e9eabb000
--- /dev/null
+++ b/lib/v2/crossbell/notes/utils.js
@@ -0,0 +1,12 @@
+module.exports = {
+ getItem: (note) => ({
+ title: note.metadata?.content?.title || '',
+ description: note.metadata?.content?.content,
+ link: note.metadata?.content?.external_urls || `https://crossbell.io/notes/${note.characterId}-${note.noteId}`,
+ pubDate: note.metadata?.content?.publishedAt,
+ updated: note.metadata?.content?.updatedAt,
+ author: note.metadata?.content?.authors?.[0] || note.character?.metadata?.content?.name || note.character?.handle,
+ guid: `${note.characterId}-${note.noteId}`,
+ category: [...(note.metadata?.content?.sources || []), ...(note.metadata?.content?.tags || [])],
+ }),
+};
diff --git a/lib/v2/crossbell/radar.js b/lib/v2/crossbell/radar.js
new file mode 100644
index 00000000000000..1052da1fb89cf4
--- /dev/null
+++ b/lib/v2/crossbell/radar.js
@@ -0,0 +1,24 @@
+module.exports = {
+ 'crossbell.io': {
+ _name: 'Crossbell',
+ '.': [
+ {
+ title: 'Notes',
+ docs: 'https://docs.rsshub.app/social-media.html#crossbell',
+ source: '/*',
+ target: '/notes',
+ },
+ ],
+ },
+ 'xlog.app': {
+ _name: 'xLog',
+ '.': [
+ {
+ title: 'Notes',
+ docs: 'https://docs.rsshub.app/social-media.html#crossbell',
+ source: '/*',
+ target: '/notes/source/xlog',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/crossbell/router.js b/lib/v2/crossbell/router.js
new file mode 100644
index 00000000000000..1558bc62538d34
--- /dev/null
+++ b/lib/v2/crossbell/router.js
@@ -0,0 +1,6 @@
+module.exports = function (router) {
+ router.get('/notes/character/:characterId', require('./notes/character'));
+ router.get('/notes/source/:source', require('./notes/source'));
+ router.get('/notes', require('./notes/index'));
+ router.get('/feeds/following/:characterId', require('./feeds/following'));
+};
|
485628eae811c7ab57ec8161264f0bef5a5aa0d6
|
2023-02-21 21:02:37
|
qizidog
|
feat(route): add description of /swjtu/jtyu/yjs (#11923)
| false
|
add description of /swjtu/jtyu/yjs (#11923)
|
feat
|
diff --git a/lib/v2/swjtu/jtys/yjs.js b/lib/v2/swjtu/jtys/yjs.js
index e16134c618fe4e..2727225ec616b0 100644
--- a/lib/v2/swjtu/jtys/yjs.js
+++ b/lib/v2/swjtu/jtys/yjs.js
@@ -5,6 +5,31 @@ const { parseDate } = require('@/utils/parse-date');
const rootURL = 'https://ctt.swjtu.edu.cn';
const url_addr = `${rootURL}/yethan/WebIndexAction?setAction=newsList&bigTypeId=0E4BF4D36E232918`;
+const getItem = (item, cache) => {
+ const news_info = item.find('div[class="news-title newsInfo"]');
+ const news_month = item.find('.month').text();
+ const news_day = item.find('.day').text();
+
+ const info_id = news_info.attr('newsid');
+ const info_title = news_info.text();
+ const link = `${rootURL}/yethan/WebIndexAction?setAction=newsInfo&newsId=${info_id}`;
+ return cache.tryGet(link, async () => {
+ const resp = await got({
+ method: 'get',
+ url: link,
+ });
+ const $$ = cheerio.load(resp.data);
+ const info_text = $$('.news-left').html();
+
+ return {
+ title: info_title,
+ pubDate: parseDate(`${news_month}.${news_day}`),
+ link,
+ description: info_text,
+ };
+ });
+};
+
module.exports = async (ctx) => {
const resp = await got({
method: 'get',
@@ -14,22 +39,17 @@ module.exports = async (ctx) => {
const $ = cheerio.load(resp.data);
const list = $("[class='news-list flex']");
+ const items = await Promise.all(
+ list.toArray().map((i) => {
+ const item = $(i);
+ return getItem(item, ctx.cache);
+ })
+ );
+
ctx.state.data = {
title: '西南交大交运学院-研究生通知',
link: url_addr,
- item:
- list &&
- list.toArray().map((i) => {
- const item = $(i);
- const news_info = item.find('div[class="news-title newsInfo"]');
- const news_month = item.find('.month');
- const news_day = item.find('.day');
- return {
- title: `标题:${news_info.text()}`,
- pubDate: parseDate(`${news_month.text()}.${news_day.text()}`),
- link: `${rootURL}/yethan/WebIndexAction?setAction=newsInfo&newsId=${news_info.attr('newsid')}`,
- };
- }),
+ item: items,
allowEmpty: true,
};
};
|
ffeca603af797b7da2230eedaaf56d61fe38fe40
|
2019-10-05 23:40:34
|
dependabot-preview[bot]
|
chore(deps-dev): bump nock from 11.3.5 to 11.3.6
| false
|
bump nock from 11.3.5 to 11.3.6
|
chore
|
diff --git a/package.json b/package.json
index 6bf5bdf23e442d..35e2fde5033144 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
"eslint-plugin-prettier": "3.1.1",
"jest": "24.9.0",
"mockdate": "2.0.5",
- "nock": "11.3.5",
+ "nock": "11.3.6",
"nodejieba": "2.3.2",
"nodemon": "1.19.3",
"pinyin": "2.9.0",
diff --git a/yarn.lock b/yarn.lock
index ab4322ddea6ef0..2219d8348a1695 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7449,10 +7449,10 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"
[email protected]:
- version "11.3.5"
- resolved "https://registry.yarnpkg.com/nock/-/nock-11.3.5.tgz#f2c7b4b672a04c35342593b6bfd821497881199c"
- integrity sha512-6WGeZcWc3RExkBcMSYSrUm/5YukDo52m/jhwniQyrnuiCnKRljBwwje9vTwJyEi4J6m2bq0Aj6C1vzuM6iuaeg==
[email protected]:
+ version "11.3.6"
+ resolved "https://registry.yarnpkg.com/nock/-/nock-11.3.6.tgz#cd87eb47ed9755d6d1e04dee1d56722267cb3283"
+ integrity sha512-54MSX4qeRnhwQQ2PSHlHc6pM6zNf7Dq9ni0BTFTurnDbUUssXl2Jy3E95ffaE8rZ/W/FWa9VSfzWDDnbdAsoTg==
dependencies:
chai "^4.1.2"
debug "^4.1.0"
|
5d66e646979f0160a0f8ca2325f9001e0ba42948
|
2025-02-28 14:04:09
|
wolfg
|
fix(route/instructables): get api key from #js-page-context (#18326)
| false
|
get api key from #js-page-context (#18326)
|
fix
|
diff --git a/lib/routes/instructables/projects.ts b/lib/routes/instructables/projects.ts
index 00d48f9dc9cf81..5708fd6ed818b3 100644
--- a/lib/routes/instructables/projects.ts
+++ b/lib/routes/instructables/projects.ts
@@ -1,5 +1,7 @@
import { Route } from '@/types';
-import got from '@/utils/got';
+import ofetch from '@/utils/ofetch';
+import { load } from 'cheerio';
+import { parseDate } from '@/utils/parse-date';
export const route: Route = {
path: '/projects/:category?',
@@ -30,10 +32,10 @@ export const route: Route = {
};
async function handler(ctx) {
- const category = ctx.req.param('category') ?? 'all';
+ const { category = 'all' } = ctx.req.param();
+ const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50;
- const siteDomain = 'www.instructables.com';
- const apiKey = 'NU5CdGwyRDdMVnVmM3l4cWNqQzFSVzJNZU5jaUxFU3dGK3J2L203MkVmVT02ZWFYeyJleGNsdWRlX2ZpZWxkcyI6WyJvdXRfb2YiLCJzZWFyY2hfdGltZV9tcyIsInN0ZXBCb2R5Il0sInBlcl9wYWdlIjo1MH0=';
+ const siteDomain = 'instructables.com';
let pathPrefix, projectFilter;
if (category === 'all') {
@@ -45,32 +47,35 @@ async function handler(ctx) {
projectFilter = category === 'teachers' ? `&& teachers:=${filterValue}` : ` && category:=${filterValue}`;
}
- const link = `https://${siteDomain}/${pathPrefix}projects?projects=all`;
+ const pageLink = `https://${siteDomain}/${pathPrefix}projects`;
- const response = await got({
+ const pageResponse = await ofetch(pageLink);
+ const $ = load(pageResponse);
+ const { typesenseProxy, typesenseApiKey } = JSON.parse($('script#js-page-context').text());
+
+ const data = await ofetch(`${typesenseProxy}/collections/projects/documents/search`, {
method: 'get',
- url: `https://${siteDomain}/api_proxy/search/collections/projects/documents/search`,
+ baseURL: `https://${siteDomain}`,
headers: {
- Referer: link,
+ Referer: pageLink,
Host: siteDomain,
- 'x-typesense-api-key': apiKey,
+ 'x-typesense-api-key': typesenseApiKey,
},
- searchParams: {
+ query: {
q: '*',
query_by: 'title,stepBody,screenName',
page: 1,
- per_page: 50,
+ per_page: limit,
sort_by: 'publishDate:desc',
include_fields: 'title,urlString,coverImageUrl,screenName,publishDate,favorites,views,primaryClassification,featureFlag,prizeLevel,IMadeItCount',
filter_by: `featureFlag:=true${projectFilter}`,
},
+ parseResponse: JSON.parse,
});
- const data = response.data;
-
return {
title: 'Instructables Projects', // 项目的标题
- link, // 指向项目的链接
+ link: `https://${siteDomain}/projects`, // 指向项目的链接
description: 'Instructables Projects', // 描述项目
language: 'en', // 频道语言
item: data.hits.map((item) => ({
@@ -78,7 +83,7 @@ async function handler(ctx) {
link: `https://${siteDomain}/${item.document.urlString}`,
author: item.document.screenName,
description: `<img src="${item.document.coverImageUrl}?auto=webp&crop=1.2%3A1&frame=1&width=500" width="500">`,
- pubDate: new Date(item.document.publishDate).toUTCString(),
+ pubDate: parseDate(item.document.publishDate),
category: item.document.primaryClassification,
})),
};
|
19b981f4d3098afa3a7ce06938358e50bbc5370d
|
2020-01-20 13:22:25
|
DIYgod
|
fix: discuz param
| false
|
discuz param
|
fix
|
diff --git a/lib/router.js b/lib/router.js
index 9e2a141428e6dc..b4b8f01fa02d38 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -2138,7 +2138,7 @@ router.get('/gbcc/trust', require('./routes/gbcc/trust'));
router.get('/apnews/topics/:topic', require('./routes/apnews/topics'));
// discuz
-router.get('/discuz/:link', require('./routes/discuz/discuz'));
+router.get('/discuz/:link(.*)', require('./routes/discuz/discuz'));
// China Dialogue 中外对话
router.get('/chinadialogue/topics/:topic', require('./routes/chinadialogue/topics'));
diff --git a/lib/routes/discuz/discuz.js b/lib/routes/discuz/discuz.js
index 07f9a3454ec32b..fa27cc5328e14e 100644
--- a/lib/routes/discuz/discuz.js
+++ b/lib/routes/discuz/discuz.js
@@ -1,6 +1,7 @@
const buildData = require('@/utils/common-config');
module.exports = async (ctx) => {
- const link = ctx.params.link;
+ let link = ctx.params.link;
+ link = link.replace(/:\/\//, ':/').replace(/:\//, '://');
ctx.state.data = await buildData({
link,
url: link,
|
192f538435c3efe4d1a581bf8f7d484ae44e5b53
|
2024-10-24 18:51:17
|
dependabot[bot]
|
chore(deps): bump @opentelemetry/sdk-trace-base from 1.26.0 to 1.27.0 (#17283)
| false
|
bump @opentelemetry/sdk-trace-base from 1.26.0 to 1.27.0 (#17283)
|
chore
|
diff --git a/package.json b/package.json
index e2a8010302bb53..357d93dbb6c5e1 100644
--- a/package.json
+++ b/package.json
@@ -58,7 +58,7 @@
"@opentelemetry/exporter-trace-otlp-http": "0.53.0",
"@opentelemetry/resources": "1.26.0",
"@opentelemetry/sdk-metrics": "1.26.0",
- "@opentelemetry/sdk-trace-base": "1.26.0",
+ "@opentelemetry/sdk-trace-base": "1.27.0",
"@opentelemetry/semantic-conventions": "1.27.0",
"@postlight/parser": "2.2.3",
"@rss3/sdk": "0.0.23",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0ce1166f0940c9..d7072fcb1ae0db 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -33,8 +33,8 @@ importers:
specifier: 1.26.0
version: 1.26.0(@opentelemetry/[email protected])
'@opentelemetry/sdk-trace-base':
- specifier: 1.26.0
- version: 1.26.0(@opentelemetry/[email protected])
+ specifier: 1.27.0
+ version: 1.27.0(@opentelemetry/[email protected])
'@opentelemetry/semantic-conventions':
specifier: 1.27.0
version: 1.27.0
@@ -1463,6 +1463,12 @@ packages:
peerDependencies:
'@opentelemetry/api': '>=1.0.0 <1.10.0'
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-yQPKnK5e+76XuiqUH/gKyS8wv/7qITd5ln56QkBTf3uggr0VkXOXfcaAuG330UfdYu83wsyoBwqwxigpIG+Jkg==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.0.0 <1.10.0'
+
'@opentelemetry/[email protected]':
resolution: {integrity: sha512-STP2FZQOykUByPnibbouTirNxnG69Ph8TiMXDsaZuWxGDJ7wsYsRQydJkAVpvG+p0hTMP/hIfZp9zT/1iHpIkQ==}
engines: {node: '>=14'}
@@ -1493,6 +1499,12 @@ packages:
peerDependencies:
'@opentelemetry/api': '>=1.0.0 <1.10.0'
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-jOwt2VJ/lUD5BLc+PMNymDrUCpm5PKi1E9oSVYAvz01U/VdndGmrtV3DU1pG4AwlYhJRHbHfOUIlpBeXCPw6QQ==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.0.0 <1.10.0'
+
'@opentelemetry/[email protected]':
resolution: {integrity: sha512-dhSisnEgIj/vJZXZV6f6KcTnyLDx/VuQ6l3ejuZpMpPlh9S1qMHiZU9NMmOkVkwwHkMy3G6mEBwdP23vUZVr4g==}
engines: {node: '>=14'}
@@ -1511,6 +1523,12 @@ packages:
peerDependencies:
'@opentelemetry/api': '>=1.0.0 <1.10.0'
+ '@opentelemetry/[email protected]':
+ resolution: {integrity: sha512-btz6XTQzwsyJjombpeqCX6LhiMQYpzt2pIYNPnw0IPO/3AhT6yjnf8Mnv3ZC2A4eRYOjqrg+bfaXg9XHDRJDWQ==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ '@opentelemetry/api': '>=1.0.0 <1.10.0'
+
'@opentelemetry/[email protected]':
resolution: {integrity: sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==}
engines: {node: '>=14'}
@@ -2186,8 +2204,8 @@ packages:
[email protected]:
resolution: {integrity: sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==}
- [email protected]:
- resolution: {integrity: sha512-Vm8kAeOcfzHPTH8sq0tHBnUqYrkXdroaBVVylqFT4cF5wnMfKEIxxy2jIGu2zKVNl9P8MAP9XBWwXJ9N2+jfEw==}
+ [email protected]:
+ resolution: {integrity: sha512-EFZHSIBkDgSHIwj2l2QZfP4U5OcD4xFAOwhSb/vlr9PIqyGJGvB/nfClJbcnh3EY4jtPE4zsb5ztae96bVF79A==}
[email protected]:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
@@ -2307,8 +2325,8 @@ packages:
[email protected]:
resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==}
- [email protected]:
- resolution: {integrity: sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==}
+ [email protected]:
+ resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==}
engines: {node: '>=12'}
[email protected]:
@@ -2756,8 +2774,8 @@ packages:
engines: {node: '>=14'}
hasBin: true
- [email protected]:
- resolution: {integrity: sha512-NxnmFBHDl5Sachd2P46O7UJiMaMHMLSofoIWVJq3mj8NJgG0umiSeljAVP9lGzjI0UDLJJ5jjoGjcrB8RSbjLQ==}
+ [email protected]:
+ resolution: {integrity: sha512-vOzZS6uZwhhbkZbcRyiy99Wg+pYFV5hk+5YaECvx0+Z31NR3Tt5zS6dze2OepT6PCTzVzT0dIJItti+uAW5zmw==}
[email protected]:
resolution: {integrity: sha512-5gxbEjcb/Z2n6TTmXZx9wVi3N/DOzE7RXY3Xg9dakDuhX/izwumB9rGjeWUV6dTA0D0+juvo+JonZgNR9sgA5A==}
@@ -6907,6 +6925,11 @@ snapshots:
'@opentelemetry/api': 1.9.0
'@opentelemetry/semantic-conventions': 1.27.0
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.9.0
+ '@opentelemetry/semantic-conventions': 1.27.0
+
'@opentelemetry/[email protected](@opentelemetry/[email protected])':
dependencies:
'@opentelemetry/api': 1.9.0
@@ -6946,6 +6969,12 @@ snapshots:
'@opentelemetry/core': 1.26.0(@opentelemetry/[email protected])
'@opentelemetry/semantic-conventions': 1.27.0
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.9.0
+ '@opentelemetry/core': 1.27.0(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.27.0
+
'@opentelemetry/[email protected](@opentelemetry/[email protected])':
dependencies:
'@opentelemetry/api': 1.9.0
@@ -6966,6 +6995,13 @@ snapshots:
'@opentelemetry/resources': 1.26.0(@opentelemetry/[email protected])
'@opentelemetry/semantic-conventions': 1.27.0
+ '@opentelemetry/[email protected](@opentelemetry/[email protected])':
+ dependencies:
+ '@opentelemetry/api': 1.9.0
+ '@opentelemetry/core': 1.27.0(@opentelemetry/[email protected])
+ '@opentelemetry/resources': 1.27.0(@opentelemetry/[email protected])
+ '@opentelemetry/semantic-conventions': 1.27.0
+
'@opentelemetry/[email protected]': {}
'@otplib/[email protected]': {}
@@ -7498,7 +7534,7 @@ snapshots:
dependencies:
'@vitest/spy': 2.0.5
'@vitest/utils': 2.0.5
- chai: 5.1.1
+ chai: 5.1.2
tinyrainbow: 1.2.0
'@vitest/[email protected]':
@@ -7693,7 +7729,7 @@ snapshots:
dependencies:
bare-events: 2.5.0
bare-path: 2.1.3
- bare-stream: 2.3.1
+ bare-stream: 2.3.2
optional: true
[email protected]:
@@ -7704,7 +7740,7 @@ snapshots:
bare-os: 2.4.4
optional: true
- [email protected]:
+ [email protected]:
dependencies:
streamx: 2.20.1
optional: true
@@ -7759,7 +7795,7 @@ snapshots:
[email protected]:
dependencies:
caniuse-lite: 1.0.30001669
- electron-to-chromium: 1.5.43
+ electron-to-chromium: 1.5.45
node-releases: 2.0.18
update-browserslist-db: 1.1.1([email protected])
@@ -7837,7 +7873,7 @@ snapshots:
[email protected]: {}
- [email protected]:
+ [email protected]:
dependencies:
assertion-error: 2.0.1
check-error: 2.1.1
@@ -8300,7 +8336,7 @@ snapshots:
minimatch: 9.0.1
semver: 7.6.3
- [email protected]: {}
+ [email protected]: {}
[email protected]: {}
@@ -11458,7 +11494,7 @@ snapshots:
'@vitest/snapshot': 2.0.5
'@vitest/spy': 2.0.5
'@vitest/utils': 2.0.5
- chai: 5.1.1
+ chai: 5.1.2
debug: 4.3.7
execa: 8.0.1
magic-string: 0.30.12
|
7e53e2268ab6de5874e09dbfe04f3d1f2ef5f713
|
2023-12-21 11:29:41
|
dependabot[bot]
|
chore(deps-dev): bump eslint-plugin-n from 16.4.0 to 16.5.0 (#14091)
| false
|
bump eslint-plugin-n from 16.4.0 to 16.5.0 (#14091)
|
chore
|
diff --git a/package.json b/package.json
index 7879d11765d9f2..d58992d3c79235 100644
--- a/package.json
+++ b/package.json
@@ -185,7 +185,7 @@
"cross-env": "7.0.3",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
- "eslint-plugin-n": "16.4.0",
+ "eslint-plugin-n": "16.5.0",
"eslint-plugin-prettier": "5.1.0",
"eslint-plugin-yml": "1.11.0",
"fs-extra": "11.2.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index bf7ecfc4eb7637..e72c95b91fd0ac 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -308,8 +308,8 @@ devDependencies:
specifier: 9.1.0
version: 9.1.0([email protected])
eslint-plugin-n:
- specifier: 16.4.0
- version: 16.4.0([email protected])
+ specifier: 16.5.0
+ version: 16.5.0([email protected])
eslint-plugin-prettier:
specifier: 5.1.0
version: 5.1.0(@types/[email protected])([email protected])([email protected])([email protected])
@@ -3313,8 +3313,8 @@ packages:
eslint-compat-utils: 0.1.2([email protected])
dev: true
- /[email protected]([email protected]):
- resolution: {integrity: sha512-IkqJjGoWYGskVaJA7WQuN8PINIxc0N/Pk/jLeYT4ees6Fo5lAhpwGsYek6gS9tCUxgDC4zJ+OwY2bY/6/9OMKQ==}
+ /[email protected]([email protected]):
+ resolution: {integrity: sha512-Hw02Bj1QrZIlKyj471Tb1jSReTl4ghIMHGuBGiMVmw+s0jOPbI4CBuYpGbZr+tdQ+VAvSK6FDSta3J4ib/SKHQ==}
engines: {node: '>=16.0.0'}
peerDependencies:
eslint: '>=7.0.0'
|
aa72a2c78c8eb6302ad90412d55d1fb7feae2db3
|
2021-05-11 03:15:18
|
AgFlore
|
fix(route): douban 404 from resharing a deleted status (#7409)
| false
|
douban 404 from resharing a deleted status (#7409)
|
fix
|
diff --git a/lib/routes/douban/people/status.js b/lib/routes/douban/people/status.js
index 88971be86b93e8..0378b32df30ab6 100644
--- a/lib/routes/douban/people/status.js
+++ b/lib/routes/douban/people/status.js
@@ -433,7 +433,7 @@ async function getFullTextItems(ctx, items) {
cache = await ctx.cache.get(url);
if (cache) {
item.status.reshared_status.text = cache;
- } else {
+ } else if (tryFixStatus(item.status.reshared_status).isFixSuccess) {
const {
data: { text },
} = await got({ url, headers });
|
cec102b4724997d22bf7fceb8ca38a9906c63159
|
2024-07-15 14:14:32
|
dependabot[bot]
|
chore(deps): bump @tonyrl/rand-user-agent from 2.0.71 to 2.0.72 (#16172)
| false
|
bump @tonyrl/rand-user-agent from 2.0.71 to 2.0.72 (#16172)
|
chore
|
diff --git a/package.json b/package.json
index a8aed7283a5749..6dbe788bd8a14c 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"@postlight/parser": "2.2.3",
"@scalar/hono-api-reference": "0.5.101",
"@sentry/node": "7.116.0",
- "@tonyrl/rand-user-agent": "2.0.71",
+ "@tonyrl/rand-user-agent": "2.0.72",
"aes-js": "3.1.2",
"art-template": "4.13.2",
"bbcodejs": "0.0.4",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 73a00b978e4a9e..8852b2000b487d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -48,8 +48,8 @@ importers:
specifier: 7.116.0
version: 7.116.0
'@tonyrl/rand-user-agent':
- specifier: 2.0.71
- version: 2.0.71
+ specifier: 2.0.72
+ version: 2.0.72
aes-js:
specifier: 3.1.2
version: 3.1.2
@@ -1953,8 +1953,8 @@ packages:
peerDependencies:
'@testing-library/dom': '>=7.21.4'
- '@tonyrl/[email protected]':
- resolution: {integrity: sha512-Eccx69YHUryoNMIwJGZaqPBl+aR1bo05cMWeVQm0JiiUAIvz+Lkdwfa+vWFh703XuVowm+odgniC1Jc0NBZWjQ==}
+ '@tonyrl/[email protected]':
+ resolution: {integrity: sha512-LBmF4dJnWlEjEZA+UBMx0+RSGqfe7jybVVQlhhp96CNirmUpJGOE6cHzvOlrB8z7efIE2jd2DKONvqsW8tTYyw==}
engines: {node: '>=14.16'}
'@tootallnate/[email protected]':
@@ -9155,7 +9155,7 @@ snapshots:
dependencies:
'@testing-library/dom': 10.1.0
- '@tonyrl/[email protected]': {}
+ '@tonyrl/[email protected]': {}
'@tootallnate/[email protected]': {}
|
ecba4f7a1f4b94a407b755dc59f0769cfc820f20
|
2024-08-19 17:37:02
|
Andvari
|
feat(route/gis): Add route (#16461)
| false
|
Add route (#16461)
|
feat
|
diff --git a/lib/routes/gisreportsonline/index.ts b/lib/routes/gisreportsonline/index.ts
new file mode 100644
index 00000000000000..fb90dd51d490d1
--- /dev/null
+++ b/lib/routes/gisreportsonline/index.ts
@@ -0,0 +1,60 @@
+import { Route } from '@/types';
+
+import { load } from 'cheerio';
+import { parseDate } from '@/utils/parse-date';
+import cache from '@/utils/cache';
+import ofetch from '@/utils/ofetch';
+
+export const route: Route = {
+ path: '/:path{.*}',
+ categories: ['new-media'],
+ example: '/gis/c/security-challenges/',
+ parameters: { path: '包含"Reports"页面下的路径' },
+ name: '报告',
+ maintainers: ['dzx-dzx'],
+ radar: [
+ {
+ source: ['www.gisreportsonline.com'],
+ },
+ ],
+ handler,
+};
+
+async function handler(ctx) {
+ const rootUrl = 'https://www.gisreportsonline.com';
+ const currentUrl = `${rootUrl}/${ctx.req.param('path')}`;
+ const response = await ofetch(currentUrl);
+
+ const $ = load(response);
+
+ const list = $('article h3 a')
+ .toArray()
+ .map((e) => ({ link: $(e).attr('href'), title: $(e).text() }));
+
+ const items = await Promise.all(
+ list.map((item) =>
+ cache.tryGet(item.link, async () => {
+ const content = load(await ofetch(item.link));
+ const ldjson = JSON.parse(content('script.rank-math-schema-pro').text())['@graph'].find((e) => e['@type'] === 'NewsArticle');
+
+ item.pubDate = parseDate(ldjson.datePublished);
+ item.updated = parseDate(ldjson.dateModified);
+ item.author = [ldjson.author];
+ item.category = ldjson.keywords.split(',');
+ item.language = ldjson.inLanguage;
+
+ item.description = content('header.entry-header ~ :not(#pos-conclusion ~ *)')
+ .toArray()
+ .map((e) => content(e).html())
+ .join('');
+
+ return item;
+ })
+ )
+ );
+ return {
+ title: $('title').text(),
+ link: currentUrl,
+ item: items,
+ };
+}
diff --git a/lib/routes/gisreportsonline/namespace.ts b/lib/routes/gisreportsonline/namespace.ts
new file mode 100644
index 00000000000000..80c606cbf384b5
--- /dev/null
+++ b/lib/routes/gisreportsonline/namespace.ts
@@ -0,0 +1,6 @@
+import type { Namespace } from '@/types';
+
+export const namespace: Namespace = {
+ name: 'GIS Reports',
+ url: 'www.gisreportsonline.com',
+};
|
b71250ee67283c0915fcf5ed58334789b3daaffe
|
2020-05-06 23:26:01
|
dependabot-preview[bot]
|
chore(deps): bump puppeteer from 3.0.2 to 3.0.3
| false
|
bump puppeteer from 3.0.2 to 3.0.3
|
chore
|
diff --git a/package.json b/package.json
index 74f09e55a4ff5c..eccbcffe34c34a 100644
--- a/package.json
+++ b/package.json
@@ -102,7 +102,7 @@
"parse-torrent": "7.1.2",
"pidusage": "2.0.18",
"plist": "3.0.1",
- "puppeteer": "3.0.2",
+ "puppeteer": "3.0.3",
"query-string": "6.12.1",
"redis": "3.0.2",
"require-all": "3.0.0",
diff --git a/yarn.lock b/yarn.lock
index 807226625681b6..4b016df5b42969 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -9987,10 +9987,10 @@ punycode@^2.1.0, punycode@^2.1.1:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
[email protected]:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-3.0.2.tgz#1d08cdb7c0c2666f5e743221b1cb1946fea493f0"
- integrity sha512-5jS/POFVDW9fqb76O8o0IBpXOnq+Na8ocGMggYtnjCRBRqmAFvX0csmwgLOHkYnQ/vCBcBPYlOq0Pp60z1850Q==
[email protected]:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-3.0.3.tgz#91c4ce46b3822b849e096413457fe8ced7d5aeca"
+ integrity sha512-sWtx9XezIwXdXHNelvnyPEmMjXXiCAuUulEONZFqRO3l+w0vP7dNcGDUIf2HLr4HLLi6r9hcUuO62s/W6rkD/w==
dependencies:
"@types/mime-types" "^2.1.0"
debug "^4.1.0"
|
a434c9a50b60a1c4a1b99f28eee7b5fbc66ce016
|
2019-05-12 12:32:54
|
阿卡琳
|
refactor: bangumi 每日放送添加id 修改缓存时间 (#2097)
| false
|
bangumi 每日放送添加id 修改缓存时间 (#2097)
|
refactor
|
diff --git a/lib/routes/bangumi/calendar/_base.js b/lib/routes/bangumi/calendar/_base.js
index 06f4040f1e769c..4af04917fe893b 100644
--- a/lib/routes/bangumi/calendar/_base.js
+++ b/lib/routes/bangumi/calendar/_base.js
@@ -1,5 +1,19 @@
const axios = require('../../../utils/axios');
+/** @type { (timezoneOffset: number) => Date } */
+const tomorrowMidnight = (timezoneOffset) => {
+ const result = new Date(Date.now());
+ const localHour = result.getHours() + timezoneOffset;
+ if (localHour < 0) {
+ result.setUTCHours(-timezoneOffset, 0, 0, 0);
+ } else if (localHour < 24) {
+ result.setUTCHours(24 - timezoneOffset, 0, 0, 0);
+ } else {
+ result.setUTCHours(48 - timezoneOffset, 0, 0, 0);
+ }
+ return result;
+};
+
module.exports = async (ctx) => {
const bgmCalendarUrl = 'https://api.bgm.tv/calendar';
const bgmDataUrl = 'https://cdn.jsdelivr.net/npm/bangumi-data/dist/data.json';
@@ -33,7 +47,7 @@ module.exports = async (ctx) => {
data.items = items;
}
- ctx.cache.set(url[i], JSON.stringify(data), 86400);
+ ctx.cache.set(url[i], JSON.stringify(data), tomorrowMidnight(8).getTime() - Date.now());
return Promise.resolve(data);
}
})
diff --git a/lib/routes/bangumi/calendar/today.js b/lib/routes/bangumi/calendar/today.js
index f6efaecacf3cbb..e3e0ef805cbe6a 100644
--- a/lib/routes/bangumi/calendar/today.js
+++ b/lib/routes/bangumi/calendar/today.js
@@ -4,10 +4,12 @@ module.exports = async (ctx) => {
const [list, data] = await getData(ctx);
const siteMeta = data.siteMeta;
- const now = new Date(Date.now());
+ const today = new Date(Date.now());
- now.setHours(now.getHours() + 9);
- const day = now.getUTCDay();
+ // 将 UTC 时间向前移动9小时,即可在数值上表示东京时间
+ today.setUTCHours(today.getUTCHours() + 9);
+
+ const day = today.getUTCDay();
const todayList = list.filter((l) => l.weekday.id % 7 === day)[0];
@@ -33,6 +35,9 @@ module.exports = async (ctx) => {
updated.setMinutes(begin.getMinutes());
updated.setSeconds(begin.getSeconds());
+ const link = `http://bangumi.tv/subject/${bgm.bgm_id}`;
+ const id = `${link}#${new Intl.DateTimeFormat('zh-CN').format(updated)}`;
+
const image = `<img referrerpolicy="no-referrer" src=${bgm.image} />`;
const html =
image +
@@ -51,6 +56,8 @@ module.exports = async (ctx) => {
'</ul>';
return {
+ id,
+ guid: id,
title: [
bgm.title,
Object.values(bgm.titleTranslate)
@@ -59,7 +66,7 @@ module.exports = async (ctx) => {
].join('|'),
updated: updated.toISOString(),
pubDate: updated.toUTCString(),
- link: `http://bangumi.tv/subject/${bgm.bgm_id}`,
+ link,
description: html,
content: { html },
};
|
6a39068ee3fa69d1a453e82bc40872690e4c2bd8
|
2024-06-06 19:49:40
|
dependabot[bot]
|
chore(deps-dev): bump @babel/preset-typescript from 7.24.6 to 7.24.7 (#15831)
| false
|
bump @babel/preset-typescript from 7.24.6 to 7.24.7 (#15831)
|
chore
|
diff --git a/package.json b/package.json
index 32b0de0031debb..b237329240bf24 100644
--- a/package.json
+++ b/package.json
@@ -127,7 +127,7 @@
},
"devDependencies": {
"@babel/preset-env": "7.24.6",
- "@babel/preset-typescript": "7.24.6",
+ "@babel/preset-typescript": "7.24.7",
"@microsoft/eslint-formatter-sarif": "3.1.0",
"@stylistic/eslint-plugin": "2.1.0",
"@types/aes-js": "3.1.4",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 57498f9addebee..aa821b7c168b8a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -235,8 +235,8 @@ importers:
specifier: 7.24.6
version: 7.24.6(@babel/[email protected])
'@babel/preset-typescript':
- specifier: 7.24.6
- version: 7.24.6(@babel/[email protected])
+ specifier: 7.24.7
+ version: 7.24.7(@babel/[email protected])
'@microsoft/eslint-formatter-sarif':
specifier: 3.1.0
version: 3.1.0
@@ -980,8 +980,8 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0
- '@babel/[email protected]':
- resolution: {integrity: sha512-U10aHPDnokCFRXgyT/MaIRTivUu2K/mu0vJlwRS9LxJmJet+PFQNKpggPyFCUtC6zWSBPjvxjnpNkAn3Uw2m5w==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-SyXRe3OdWwIwalxDg5UtJnJQO+YPcTfwiIY2B0Xlddh9o7jpWLvv8X1RthIeDOxQ+O1ML5BLPCONToObyVQVuQ==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
@@ -2791,8 +2791,8 @@ packages:
engines: {node: '>=14'}
hasBin: true
- [email protected]:
- resolution: {integrity: sha512-6FlqP0NSWvxFf1v+gHu+LCn5wjr1pmkj5nPr7BsxPnj41EDR4EWhK/KmQN0ytHUqgTR1lkpHRYxvHBLZFQtkKw==}
+ [email protected]:
+ resolution: {integrity: sha512-rkg5/N3L+Y844JyfgPUyuKK0Hk0efo3JNxUDKvz3HgP6EmN4rNGhr2D8boLsfTV/hGo7ZGAL8djw+jlg99zQyA==}
[email protected]:
resolution: {integrity: sha512-5gxbEjcb/Z2n6TTmXZx9wVi3N/DOzE7RXY3Xg9dakDuhX/izwumB9rGjeWUV6dTA0D0+juvo+JonZgNR9sgA5A==}
@@ -6570,7 +6570,7 @@ snapshots:
'@babel/types': 7.24.7
esutils: 2.0.3
- '@babel/[email protected](@babel/[email protected])':
+ '@babel/[email protected](@babel/[email protected])':
dependencies:
'@babel/core': 7.24.7
'@babel/helper-plugin-utils': 7.24.7
@@ -8017,7 +8017,7 @@ snapshots:
[email protected]:
dependencies:
caniuse-lite: 1.0.30001629
- electron-to-chromium: 1.4.791
+ electron-to-chromium: 1.4.792
node-releases: 2.0.14
update-browserslist-db: 1.0.16([email protected])
@@ -8568,7 +8568,7 @@ snapshots:
minimatch: 9.0.1
semver: 7.6.2
- [email protected]: {}
+ [email protected]: {}
[email protected]: {}
|
b17eaf984803197ec6e75797f709ca3bf53ff4fa
|
2022-04-04 20:01:48
|
Chenxing Luo
|
feat(route): 增加了六个美国博物馆的展讯 (#9451)
| false
|
增加了六个美国博物馆的展讯 (#9451)
|
feat
|
diff --git a/docs/en/travel.md b/docs/en/travel.md
index c052ced98b54c5..5b198a85e1dd78 100644
--- a/docs/en/travel.md
+++ b/docs/en/travel.md
@@ -20,6 +20,14 @@ If the city name contains a space like `Mexico City`, replace the space with `%2
</RouteEn>
+## Brooklyn Museum
+
+<RouteEn author="chazeon"
+ example="/brooklynmuseum/exhibitions"
+ path="/brooklynmuseum/exhibitions/:state?"
+ :paramsDesc="['state of the exhibition: `current`,`past`, or `upcoming`, the default value is `current`']"
+/>
+
## Hopper
### Flight Deals
@@ -31,3 +39,27 @@ This route returns a list of flight deals (in most cases, 6 flight deals) for a
For airport IATA code please refer to [Wikipedia List of airports by IATA code](https://en.wikipedia.org/wiki/List_of_airports_by_IATA_code:_A)
</RouteEn>
+
+## Museum of Contemporary Art Chicago
+
+<RouteEn author="chazeon" example="/mcachicago/exhibitions" path="/mcachicago/exhibitions" />
+
+## New Museum
+
+<RouteEn author="chazeon" example="/newmuseum/exhibitions" path="/newmuseum/exhibitions" />
+
+## Solomon R. Guggenheim Museum
+
+<RouteEn author="chazeon" example="/guggenheim/exhibitions" path="/guggenheim/exhibitions" />
+
+## The Jewish Museum
+
+<RouteEn author="chazeon" example="/jewishmuseum/exhibitions" path="/jewishmuseum/exhibitions" />
+
+## The Metropolitan Museum of Art
+
+<RouteEn author="chazeon"
+ example="/metmuseum/exhibitions"
+ path="/metmusem/exhibitions/:state?"
+ :paramsDesc="['state of the exhibition: `current`,`past`, or `upcoming`, the default value is `current`']" anticrawler="1"
+/>
diff --git a/docs/travel.md b/docs/travel.md
index 5753924d7fd3c5..b362e8d2d7d7b0 100644
--- a/docs/travel.md
+++ b/docs/travel.md
@@ -114,6 +114,38 @@ IATA 国际航空运输协会机场代码,参见[维基百科 国际航空运
</Route>
+## 纽约布鲁克林博物馆
+
+<Route author="chazeon"
+ example="/brooklynmuseum/exhibitions"
+ path="/brooklynmuseum/exhibitions/:state?"
+ :paramsDesc="['展览进行的状态:`current` 对应展览当前正在进行,`past` 对应过去的展览,`upcoming` 对应即将举办的展览,默认为 `current`']"
+/>
+
+## 纽约大都会美术馆
+
+<Route author="chazeon"
+ example="/metmuseum/exhibitions"
+ path="/metmusem/exhibitions/:state?"
+ :paramsDesc="['展览进行的状态:`current` 对应展览当前正在进行,`past` 对应过去的展览,`upcoming` 对应即将举办的展览,默认为 `current`']" anticrawler="1"
+/>
+
+## 纽约古根海姆基金会
+
+<Route author="chazeon" example="/guggenheim/exhibitions" path="/guggenheim/exhibitions" />
+
+## 纽约新美术馆
+
+<Route author="chazeon" example="/newmuseum/exhibitions" path="/newmuseum/exhibitions" />
+
+## 纽约犹太人博物馆
+
+<Route author="chazeon" example="/jewishmuseum/exhibitions" path="/jewishmuseum/exhibitions" />
+
+## 芝加哥当代艺术博物馆
+
+<Route author="chazeon" example="/mcachicago/exhibitions" path="/mcachicago/exhibitions" />
+
## 中国美术馆
### 美术馆新闻
diff --git a/lib/v2/brooklynmuseum/exhibitions.js b/lib/v2/brooklynmuseum/exhibitions.js
new file mode 100644
index 00000000000000..2dfa5a9fd15dac
--- /dev/null
+++ b/lib/v2/brooklynmuseum/exhibitions.js
@@ -0,0 +1,27 @@
+const buildData = require('@/utils/common-config');
+
+module.exports = async (ctx) => {
+ let link;
+ const state = ctx.params.state;
+
+ switch (state) {
+ case undefined:
+ case 'current':
+ link = 'https://www.brooklynmuseum.org/exhibitions/';
+ break;
+ default:
+ link = `https://www.brooklynmuseum.org/exhibitions/${state}`;
+ }
+
+ ctx.state.data = await buildData({
+ link,
+ url: link,
+ title: 'Brooklyn Museum - Exhibitions',
+ item: {
+ item: '.exhibitions .image-card',
+ title: `$('h2 > a, h3 > a').text()`,
+ link: `$('h2 > a, h3 > a').attr('href')`,
+ description: `$('h6').text()`,
+ },
+ });
+};
diff --git a/lib/v2/brooklynmuseum/maintainer.js b/lib/v2/brooklynmuseum/maintainer.js
new file mode 100644
index 00000000000000..2b582f7fce773b
--- /dev/null
+++ b/lib/v2/brooklynmuseum/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/exhibitions': ['chazeon'],
+};
diff --git a/lib/v2/brooklynmuseum/radar.js b/lib/v2/brooklynmuseum/radar.js
new file mode 100644
index 00000000000000..7a518af6b297e9
--- /dev/null
+++ b/lib/v2/brooklynmuseum/radar.js
@@ -0,0 +1,11 @@
+module.exports = {
+ 'brooklynmuseum.org': {
+ _name: 'Brooklyn Museum',
+ www: [
+ {
+ title: 'Exhibitions',
+ docs: 'https://docs.rsshub.app/en/travel.html#brooklyn-museum',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/brooklynmuseum/router.js b/lib/v2/brooklynmuseum/router.js
new file mode 100644
index 00000000000000..3b6bc4063e9c62
--- /dev/null
+++ b/lib/v2/brooklynmuseum/router.js
@@ -0,0 +1,3 @@
+module.exports = function (router) {
+ router.get('/exhibitions/:state?', require('./exhibitions'));
+};
diff --git a/lib/v2/guggenheim/exhibitions.js b/lib/v2/guggenheim/exhibitions.js
new file mode 100644
index 00000000000000..150152604d8e80
--- /dev/null
+++ b/lib/v2/guggenheim/exhibitions.js
@@ -0,0 +1,29 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+
+module.exports = async (ctx) => {
+ const link = 'https://www.guggenheim.org/exhibitions';
+
+ const response = await got({
+ url: link,
+ method: 'GET',
+ });
+
+ const code = cheerio.load(response.data)('#app-js-extra').html();
+ const data = JSON.parse(code.match(/var bootstrap = ([^\n]*);/)[1]);
+ const exhibitions = data.initial.main.posts.featuredExhibitions;
+ const items = [].concat(exhibitions.past.items ?? [], exhibitions.on_view.items ?? [], exhibitions.upcoming.items ?? []);
+
+ ctx.state.data = {
+ link,
+ url: link,
+ title: 'The Guggenheim Museums and Foundation - Exhibitions',
+ item: items.map((ex) => ({
+ title: ex.title,
+ link: `https://www.guggenheim.org/exhibition/${ex.slug}`,
+ description: ex.excerpt,
+ pubDate: ex.dates ? parseDate(`${ex.dates.start.month} ${ex.dates.start.day}, ${ex.dates.start.year}`, 'MMMM D, YYYY') : null,
+ })),
+ };
+};
diff --git a/lib/v2/guggenheim/maintainer.js b/lib/v2/guggenheim/maintainer.js
new file mode 100644
index 00000000000000..2b582f7fce773b
--- /dev/null
+++ b/lib/v2/guggenheim/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/exhibitions': ['chazeon'],
+};
diff --git a/lib/v2/guggenheim/radar.js b/lib/v2/guggenheim/radar.js
new file mode 100644
index 00000000000000..7d69aedeba0f67
--- /dev/null
+++ b/lib/v2/guggenheim/radar.js
@@ -0,0 +1,11 @@
+module.exports = {
+ 'guggenheim.org': {
+ _name: 'Solomon R. Guggenheim Museum',
+ www: [
+ {
+ title: 'Exhibitions',
+ docs: 'https://docs.rsshub.app/en/travel.html#solomon-r-guggenheim-museum',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/guggenheim/router.js b/lib/v2/guggenheim/router.js
new file mode 100644
index 00000000000000..d98b7c8845a250
--- /dev/null
+++ b/lib/v2/guggenheim/router.js
@@ -0,0 +1,3 @@
+module.exports = function (router) {
+ router.get('/exhibitions', require('./exhibitions'));
+};
diff --git a/lib/v2/jewishmuseum/exhibitions.js b/lib/v2/jewishmuseum/exhibitions.js
new file mode 100644
index 00000000000000..ae5bc01cc4ee81
--- /dev/null
+++ b/lib/v2/jewishmuseum/exhibitions.js
@@ -0,0 +1,16 @@
+const buildData = require('@/utils/common-config');
+
+module.exports = async (ctx) => {
+ const link = 'https://thejewishmuseum.org/exhibitions';
+
+ ctx.state.data = await buildData({
+ link,
+ url: link,
+ title: 'Jewish Museums - Exhibitions',
+ item: {
+ item: '#current article.exhibition, #upcoming article, #past article.exhibition',
+ title: `$('article.exhibition h3').text()`,
+ link: `$('article.exhibition > a').attr('href')`,
+ },
+ });
+};
diff --git a/lib/v2/jewishmuseum/maintainer.js b/lib/v2/jewishmuseum/maintainer.js
new file mode 100644
index 00000000000000..2b582f7fce773b
--- /dev/null
+++ b/lib/v2/jewishmuseum/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/exhibitions': ['chazeon'],
+};
diff --git a/lib/v2/jewishmuseum/radar.js b/lib/v2/jewishmuseum/radar.js
new file mode 100644
index 00000000000000..223b1a7af374f1
--- /dev/null
+++ b/lib/v2/jewishmuseum/radar.js
@@ -0,0 +1,11 @@
+module.exports = {
+ 'thejewishmuseum.org': {
+ _name: 'Jewish Museum',
+ '.': [
+ {
+ title: 'Exhibitions',
+ docs: 'https://docs.rsshub.app/en/travel.html#the-jewish-museum',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/jewishmuseum/router.js b/lib/v2/jewishmuseum/router.js
new file mode 100644
index 00000000000000..d98b7c8845a250
--- /dev/null
+++ b/lib/v2/jewishmuseum/router.js
@@ -0,0 +1,3 @@
+module.exports = function (router) {
+ router.get('/exhibitions', require('./exhibitions'));
+};
diff --git a/lib/v2/mcachicago/exhibitions.js b/lib/v2/mcachicago/exhibitions.js
new file mode 100644
index 00000000000000..9fe1e4b41ea71b
--- /dev/null
+++ b/lib/v2/mcachicago/exhibitions.js
@@ -0,0 +1,17 @@
+const buildData = require('@/utils/common-config');
+
+module.exports = async (ctx) => {
+ const link = 'https://mcachicago.org/exhibitions';
+
+ ctx.state.data = await buildData({
+ link,
+ url: link,
+ title: 'MCA Chicago - Exhibitions',
+ item: {
+ item: '#exhibitions .card',
+ title: `$('.title').text()`,
+ link: `$('a').attr('href')`,
+ // description: `$('a').html()`,
+ },
+ });
+};
diff --git a/lib/v2/mcachicago/maintainer.js b/lib/v2/mcachicago/maintainer.js
new file mode 100644
index 00000000000000..2b582f7fce773b
--- /dev/null
+++ b/lib/v2/mcachicago/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/exhibitions': ['chazeon'],
+};
diff --git a/lib/v2/mcachicago/radar.js b/lib/v2/mcachicago/radar.js
new file mode 100644
index 00000000000000..8d24a4852f5e2e
--- /dev/null
+++ b/lib/v2/mcachicago/radar.js
@@ -0,0 +1,11 @@
+module.exports = {
+ 'mcachicago.org': {
+ _name: 'MCA Chicago',
+ '.': [
+ {
+ title: 'Exhibitions',
+ docs: 'https://docs.rsshub.app/en/travel.html#museum-of-contemporary-art-chicago',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/mcachicago/router.js b/lib/v2/mcachicago/router.js
new file mode 100644
index 00000000000000..d98b7c8845a250
--- /dev/null
+++ b/lib/v2/mcachicago/router.js
@@ -0,0 +1,3 @@
+module.exports = function (router) {
+ router.get('/exhibitions', require('./exhibitions'));
+};
diff --git a/lib/v2/metmuseum/exhibitions.js b/lib/v2/metmuseum/exhibitions.js
new file mode 100644
index 00000000000000..6297491490a0f5
--- /dev/null
+++ b/lib/v2/metmuseum/exhibitions.js
@@ -0,0 +1,31 @@
+const got = require('@/utils/got');
+const { parseDate } = require('@/utils/parse-date');
+
+function generateExhibitionItem(result) {
+ return {
+ title: result.title,
+ link: `https://www.metmuseum.org${result.url}`,
+ description: result.description,
+ pubDate: parseDate(result.startDate),
+ guid: result.id,
+ };
+}
+
+module.exports = async (ctx) => {
+ const searchType = ctx.params.state ?? 'current';
+
+ const url = `https://www.metmuseum.org/ghidorah/ExhibitionListing/Search?searchType=${searchType}`;
+
+ const response = await got({
+ url,
+ method: 'GET',
+ });
+
+ const data = response.data.data;
+
+ ctx.state.data = {
+ title: 'The Metropolitan Museum of Art - Exhibitions',
+ link: 'https://www.metmuseum.org/exhibitions',
+ item: data.results.map(generateExhibitionItem),
+ };
+};
diff --git a/lib/v2/metmuseum/maintainer.js b/lib/v2/metmuseum/maintainer.js
new file mode 100644
index 00000000000000..2b582f7fce773b
--- /dev/null
+++ b/lib/v2/metmuseum/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/exhibitions': ['chazeon'],
+};
diff --git a/lib/v2/metmuseum/radar.js b/lib/v2/metmuseum/radar.js
new file mode 100644
index 00000000000000..c7154582d81ab3
--- /dev/null
+++ b/lib/v2/metmuseum/radar.js
@@ -0,0 +1,11 @@
+module.exports = {
+ 'metmuseum.org': {
+ _name: 'The Metropolitan Museum of Art',
+ www: [
+ {
+ title: 'Exhibitions',
+ docs: 'https://docs.rsshub.app/en/travel.html#the-metropolitan-museum-of-art',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/metmuseum/router.js b/lib/v2/metmuseum/router.js
new file mode 100644
index 00000000000000..3b6bc4063e9c62
--- /dev/null
+++ b/lib/v2/metmuseum/router.js
@@ -0,0 +1,3 @@
+module.exports = function (router) {
+ router.get('/exhibitions/:state?', require('./exhibitions'));
+};
diff --git a/lib/v2/newmuseum/exhibitions.js b/lib/v2/newmuseum/exhibitions.js
new file mode 100644
index 00000000000000..7798526cc883c0
--- /dev/null
+++ b/lib/v2/newmuseum/exhibitions.js
@@ -0,0 +1,27 @@
+const buildData = require('@/utils/common-config');
+
+module.exports = async (ctx) => {
+ let link;
+ const state = ctx.query.state;
+
+ switch (state) {
+ case undefined:
+ case 'current':
+ link = 'https://www.newmuseum.org/exhibitions/';
+ break;
+ default:
+ link = `https://www.newmuseum.org/exhibitions/${state}`;
+ }
+
+ ctx.state.data = await buildData({
+ link,
+ url: link,
+ title: 'New Museum - Exhibitions',
+ item: {
+ item: '.exh',
+ title: `$('.exh .title').text()`,
+ link: `$('.exh > a').attr('href')`,
+ description: `$('.exh .body-reveal').text()`,
+ },
+ });
+};
diff --git a/lib/v2/newmuseum/maintainer.js b/lib/v2/newmuseum/maintainer.js
new file mode 100644
index 00000000000000..2b582f7fce773b
--- /dev/null
+++ b/lib/v2/newmuseum/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/exhibitions': ['chazeon'],
+};
diff --git a/lib/v2/newmuseum/radar.js b/lib/v2/newmuseum/radar.js
new file mode 100644
index 00000000000000..483b923139b570
--- /dev/null
+++ b/lib/v2/newmuseum/radar.js
@@ -0,0 +1,11 @@
+module.exports = {
+ 'newmuseum.org': {
+ _name: 'New Museum',
+ www: [
+ {
+ title: 'Exhibitions',
+ docs: 'https://docs.rsshub.app/en/travel.html#new-museum',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/newmuseum/router.js b/lib/v2/newmuseum/router.js
new file mode 100644
index 00000000000000..d98b7c8845a250
--- /dev/null
+++ b/lib/v2/newmuseum/router.js
@@ -0,0 +1,3 @@
+module.exports = function (router) {
+ router.get('/exhibitions', require('./exhibitions'));
+};
|
506bcf04f11cede81d952cc6df889bf71f737e23
|
2021-03-31 01:39:05
|
GitHub Action
|
style: auto format
| false
|
auto format
|
style
|
diff --git a/docs/install/README.md b/docs/install/README.md
index 0665c38f5063b2..c927ae5384c4c2 100644
--- a/docs/install/README.md
+++ b/docs/install/README.md
@@ -51,7 +51,7 @@ $ docker-compose up -d
$ docker-compose down
```
-如果之前已经下载/使用过镜像,下方命令可以帮助你获取最新版本:这可能可以解决一些问题。
+如果之前已经下载 / 使用过镜像,下方命令可以帮助你获取最新版本:这可能可以解决一些问题。
```bash
$ docker pull diygod/rsshub
|
670f6f3ca7f1b6208293c9b3767d925ae7f0d89f
|
2024-02-01 07:50:39
|
tmr
|
fix: replace weibo a href img (#14354)
| false
|
replace weibo a href img (#14354)
|
fix
|
diff --git a/lib/middleware/anti-hotlink.js b/lib/middleware/anti-hotlink.js
index 9a216126ab6e6a..82c56de4f58c5c 100644
--- a/lib/middleware/anti-hotlink.js
+++ b/lib/middleware/anti-hotlink.js
@@ -70,6 +70,7 @@ const process = (html, image_hotlink_template, multimedia_hotlink_template, wrap
if (image_hotlink_template) {
replaceUrls($, 'img, picture > source', image_hotlink_template);
replaceUrls($, 'video[poster]', image_hotlink_template, 'poster');
+ replaceUrls($, '*[data-rsshub-image="href"]', image_hotlink_template, 'href');
}
if (multimedia_hotlink_template) {
replaceUrls($, 'video, video > source, audio, audio > source', multimedia_hotlink_template);
diff --git a/lib/v2/weibo/utils.js b/lib/v2/weibo/utils.js
index 18d95384751572..aa9c8fc50af784 100644
--- a/lib/v2/weibo/utils.js
+++ b/lib/v2/weibo/utils.js
@@ -82,7 +82,10 @@ const weiboUtils = {
htmlNewLineUnreplaced = htmlNewLineUnreplaced.replaceAll(/<a href="(.*?)">全文<\/a>/g, '');
// 处理外部链接
- htmlNewLineUnreplaced = htmlNewLineUnreplaced.replaceAll(/https:\/\/weibo\.cn\/sinaurl\/.*?&u=(http.*?")/g, (match, p1) => decodeURIComponent(p1));
+ htmlNewLineUnreplaced = htmlNewLineUnreplaced.replaceAll(/"https:\/\/weibo\.cn\/sinaurl.*?[&?]u=(http.*?)"/g, (match, p1) => `"${decodeURIComponent(p1)}"`);
+
+ // 处理图片的链接
+ htmlNewLineUnreplaced = htmlNewLineUnreplaced.replaceAll(/<a\s+href="https?:\/\/.+\.(jpg|png|gif)"/g, (match) => `${match} data-rsshub-image="href"`);
let html = htmlNewLineUnreplaced.replaceAll('\n', '<br>');
|
3793781dff9dcd531b05c0fd8c47a8167b677e9c
|
2022-03-01 03:44:07
|
dependabot[bot]
|
chore(deps): bump @sentry/node from 6.18.0 to 6.18.1 (#9224)
| false
|
bump @sentry/node from 6.18.0 to 6.18.1 (#9224)
|
chore
|
diff --git a/package.json b/package.json
index 135165e5182b8f..4d75a3dbf29280 100644
--- a/package.json
+++ b/package.json
@@ -78,7 +78,7 @@
"dependencies": {
"@koa/router": "10.1.1",
"@postlight/mercury-parser": "2.2.1",
- "@sentry/node": "6.18.0",
+ "@sentry/node": "6.18.1",
"aes-js": "3.1.2",
"art-template": "4.13.2",
"bbcodejs": "0.0.4",
diff --git a/yarn.lock b/yarn.lock
index 5aed4c50ecbcc4..12288aa0d09b23 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1436,72 +1436,72 @@
domhandler "^4.2.0"
selderee "^0.6.0"
-"@sentry/[email protected]":
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.18.0.tgz#9ebfff67265cbe1af29f1cce0f712d9bd36b331f"
- integrity sha512-I3iQVfMWHXR/LtevJg83aD7UAiUBLz1xAW8y3gd5lJej96UNv/4TbCmKZumYnEJMXf8EcFlg8t48W0Bl1GxhEg==
- dependencies:
- "@sentry/hub" "6.18.0"
- "@sentry/minimal" "6.18.0"
- "@sentry/types" "6.18.0"
- "@sentry/utils" "6.18.0"
+"@sentry/[email protected]":
+ version "6.18.1"
+ resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.18.1.tgz#6d09c4f59b30b62d5d288b5f3f3af56f1f7e6336"
+ integrity sha512-9V8Q+3Asi+3RL67CSIMMZ9mjMsu2/hrpQszYStX7hPPpAZIlAKk2MT5B+na/r80iWKhy+3Ts6aDFF218QtnsVw==
+ dependencies:
+ "@sentry/hub" "6.18.1"
+ "@sentry/minimal" "6.18.1"
+ "@sentry/types" "6.18.1"
+ "@sentry/utils" "6.18.1"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.18.0.tgz#8c425bc340b2792c5ac9c6feed2f444d9b7f5bb7"
- integrity sha512-E2GrrNcidyT67ONU3btHO5vyS1bPQNdWqC09sUc1F3q/nQyvc7L2W09TKY2veaMZQtC9EU760fTG1hMmgGwPmw==
+"@sentry/[email protected]":
+ version "6.18.1"
+ resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.18.1.tgz#fcfb8cb84515efefaf4e48472305ea5a71455abb"
+ integrity sha512-+zGzgc/xX3an/nKA3ELMn9YD9VmqbNaNwWZ5/SjNUvzsYHh2UNZ7YzT8WawQsRVOXLljyCKxkWpFB4EchiYGbw==
dependencies:
- "@sentry/types" "6.18.0"
- "@sentry/utils" "6.18.0"
+ "@sentry/types" "6.18.1"
+ "@sentry/utils" "6.18.1"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.18.0.tgz#03da29b45b62b3073fbd110e423608ada17ef52c"
- integrity sha512-QkkWOhX3NMycUNLj96thMQ0BclmfxE2VdDf9ZqRkvdFzxI1FVY5NEArqD4wtlrCIoYN1ioAYrvdb48/BTuGung==
+"@sentry/[email protected]":
+ version "6.18.1"
+ resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.18.1.tgz#eac73d2262589930aa0bb33e0e12380ac5b766a9"
+ integrity sha512-dm+0MuasWNi/LASvHX+09oCo8IBZY5WpMK8qXvQMnwQ9FVfklrjcfEI3666WORDCmeUhDCSeL2MbjPDm+AmPLg==
dependencies:
- "@sentry/hub" "6.18.0"
- "@sentry/types" "6.18.0"
+ "@sentry/hub" "6.18.1"
+ "@sentry/types" "6.18.1"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/@sentry/node/-/node-6.18.0.tgz#b1dbeb2a405597c119a56c621a7867d148efaaaa"
- integrity sha512-gESzabgJSs3uuOpZQ4tdI3V0k1nl9fqToTHOJDMeOqusHYfY/wlRDtdvN0Qn+vdvkGI/Eh3u8RnFQXCzkbCAbQ==
- dependencies:
- "@sentry/core" "6.18.0"
- "@sentry/hub" "6.18.0"
- "@sentry/tracing" "6.18.0"
- "@sentry/types" "6.18.0"
- "@sentry/utils" "6.18.0"
+"@sentry/[email protected]":
+ version "6.18.1"
+ resolved "https://registry.yarnpkg.com/@sentry/node/-/node-6.18.1.tgz#8eddc80226bda77dd91100eb522e1e7d88963461"
+ integrity sha512-aTb2gwfZUq0lGDRGH5zNOYDfFMOQZu6E0QcAsvH2ZBcEj3rUWZz3r25COFrHmfzHLUV1KcF2AmnWo1QU1jmm0g==
+ dependencies:
+ "@sentry/core" "6.18.1"
+ "@sentry/hub" "6.18.1"
+ "@sentry/tracing" "6.18.1"
+ "@sentry/types" "6.18.1"
+ "@sentry/utils" "6.18.1"
cookie "^0.4.1"
https-proxy-agent "^5.0.0"
lru_map "^0.3.3"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.18.0.tgz#c9678f1c095eb58abec4de5ffd33f00420d2cbbe"
- integrity sha512-thwVrYT+ba58h6F6Im4t+JH9o+7H+75ribkeTgM7NRhNuiGajlXNmb37Dh9gP5Iy76jNV8GATy4cOcuVc7P1jA==
+"@sentry/[email protected]":
+ version "6.18.1"
+ resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.18.1.tgz#7cc54b328dd051102900ade53e907e7441426f83"
+ integrity sha512-OxozmSfxGx246Ae1XhO01I7ZWxO3briwMBh55E5KyjQb8fuS9gVE7Uy8ZRs5hhNjDutFAU7nMtC0zipfVxP6fg==
dependencies:
- "@sentry/hub" "6.18.0"
- "@sentry/minimal" "6.18.0"
- "@sentry/types" "6.18.0"
- "@sentry/utils" "6.18.0"
+ "@sentry/hub" "6.18.1"
+ "@sentry/minimal" "6.18.1"
+ "@sentry/types" "6.18.1"
+ "@sentry/utils" "6.18.1"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.18.0.tgz#89cee850d16c88621459d9f2a7f6cff9e9d3fb5f"
- integrity sha512-SypDwXL1URE/XLkP4Ve+pFs41e+2OUYZ0lCimNreQQv46//pFXxP3LwU9Tc0Az4ZfxXnGiwofvt73XyBq9VpRQ==
+"@sentry/[email protected]":
+ version "6.18.1"
+ resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.18.1.tgz#e2de38dd0da8096a5d22f8effc6756c919266ede"
+ integrity sha512-wp741NoBKnXE/4T9L723sWJ8EcNMxeTIT1smgNJOfbPwrsDICoYmGEt6JFa05XHpWBGI66WuNvnDjoHVeh6zhA==
-"@sentry/[email protected]":
- version "6.18.0"
- resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.18.0.tgz#99ad577020a269e43629feb6305c121065c992d1"
- integrity sha512-mKegOabkAjoUHfokjI5oi3CMez5GD3xXOrBFcLVc9GFDXCgNMdYnHyEn/mmy8PikFdGHxZ3oI/16ZGU22wi5aw==
+"@sentry/[email protected]":
+ version "6.18.1"
+ resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.18.1.tgz#1aa819502b042540612f4db7bcb86c7b176f5a6b"
+ integrity sha512-IFZmuvA+c5lDGlZEri13JSyUP0BHelzY0S4dcKxAzskPW+BtBdQDgYGV90iED1y+IRMLawWb34GF7HyJSouN1Q==
dependencies:
- "@sentry/types" "6.18.0"
+ "@sentry/types" "6.18.1"
tslib "^1.9.3"
"@sindresorhus/is@^0.14.0":
|
e17536621c3bd9fa8d89e638785077c4151eef4f
|
2024-11-06 15:36:00
|
Tony
|
feat(route): toutiao (#17468)
| false
|
toutiao (#17468)
|
feat
|
diff --git a/lib/routes/toutiao/a-bogus.ts b/lib/routes/toutiao/a-bogus.ts
new file mode 100644
index 00000000000000..1522472f3a1b8c
--- /dev/null
+++ b/lib/routes/toutiao/a-bogus.ts
@@ -0,0 +1,540 @@
+/* eslint-disable unicorn/prefer-spread */
+/* eslint-disable unicorn/prefer-math-trunc */
+// @ts-nocheck
+
+// Credits:
+// https://github.com/NearHuiwen/TiktokDouyinCrawler/blob/main/utils/a_bogus.js
+// https://github.com/110Art/a-bogus/blob/main/a_bogus.js
+// https://github.com/ShilongLee/Crawler/blob/main/lib/js/douyin.js
+
+// Reference:
+// https://github.com/Endy-c/gm-crypt/blob/87bfc13f4b234c538d56798ed2457da16bc006ac/src/sm3.js
+
+import logger from '@/utils/logger';
+
+function rc4_encrypt(plaintext, key) {
+ const s: number[] = [];
+ for (let i = 0; i < 256; i++) {
+ s[i] = i;
+ }
+ for (let i = 0, j = 0; i < 256; i++) {
+ j = (j + s[i] + key.codePointAt(i % key.length)) % 256;
+ const temp = s[i];
+ s[i] = s[j];
+ s[j] = temp;
+ }
+
+ const cipher: string[] = [];
+ for (let i = 0, j = 0, k = 0; k < plaintext.length; k++) {
+ i = (i + 1) % 256;
+ j = (j + s[i]) % 256;
+ const temp = s[i];
+ s[i] = s[j];
+ s[j] = temp;
+ const t = (s[i] + s[j]) % 256;
+ cipher.push(String.fromCodePoint(s[t] ^ plaintext.codePointAt(k)));
+ }
+ return cipher.join('');
+}
+
+function rotateLeft32(e, r) {
+ return ((e << (r %= 32)) | (e >>> (32 - r))) >>> 0;
+}
+
+function T(j) {
+ if (0 <= j && j < 16) {
+ return 0x79_cc_45_19;
+ } else if (16 <= j && j < 64) {
+ return 0x7a_87_9d_8a;
+ } else {
+ logger.error('invalid j for constant Tj');
+ }
+}
+
+function FF(j, x, y, z) {
+ if (0 <= j && j < 16) {
+ return (x ^ y ^ z) >>> 0;
+ } else if (16 <= j && j < 64) {
+ return ((x & y) | (x & z) | (y & z)) >>> 0;
+ } else {
+ logger.error('invalid j for bool function FF');
+ return 0;
+ }
+}
+
+function GG(j, x, y, z) {
+ if (0 <= j && j < 16) {
+ return (x ^ y ^ z) >>> 0;
+ } else if (16 <= j && j < 64) {
+ return ((x & y) | (~x & z)) >>> 0;
+ } else {
+ logger.error('invalid j for bool function GG');
+ return 0;
+ }
+}
+
+function reset(this: any) {
+ this.reg[0] = 0x73_80_16_6f;
+ this.reg[1] = 0x49_14_b2_b9;
+ this.reg[2] = 0x17_24_42_d7;
+ this.reg[3] = 0xda_8a_06_00;
+ this.reg[4] = 0xa9_6f_30_bc;
+ this.reg[5] = 0x16_31_38_aa;
+ this.reg[6] = 0xe3_8d_ee_4d;
+ this.reg[7] = 0xb0_fb_0e_4e;
+ this.chunk = [];
+ this.size = 0;
+}
+
+function strToBytes(str) {
+ const n = encodeURIComponent(str).replaceAll(/%([0-9A-F]{2})/g, (e, r) => String.fromCodePoint('0x' + r));
+ const a = Array.from({ length: n.length });
+ Array.prototype.forEach.call(n, (e, r) => {
+ a[r] = e.codePointAt(0);
+ });
+ return a;
+}
+
+function write(this: any, message) {
+ const a = typeof message === 'string' ? strToBytes(message) : message;
+ this.size += a.length;
+ let f = 64 - this.chunk.length;
+ if (a.length < f) {
+ this.chunk = this.chunk.concat(a);
+ } else {
+ this.chunk = this.chunk.concat(a.slice(0, f));
+ while (this.chunk.length >= 64) {
+ this._compress(this.chunk);
+ this.chunk = f < a.length ? a.slice(f, Math.min(f + 64, a.length)) : [];
+ f += 64;
+ }
+ }
+}
+
+function sum(this: any, message, encoding) {
+ if (message) {
+ this.reset();
+ this.write(message);
+ }
+ this._fill();
+ for (let f = 0; f < this.chunk.length; f += 64) {
+ this._compress(this.chunk.slice(f, f + 64));
+ }
+ let digest;
+ if (encoding === 'hex') {
+ digest = '';
+ for (let f = 0; f < 8; f++) {
+ digest += se(this.reg[f].toString(16), 8, '0');
+ }
+ } else {
+ digest = Array.from({ length: 32 });
+ for (let f = 0; f < 8; f++) {
+ let c = this.reg[f];
+ digest[4 * f + 3] = (255 & c) >>> 0;
+ c >>>= 8;
+ digest[4 * f + 2] = (255 & c) >>> 0;
+ c >>>= 8;
+ digest[4 * f + 1] = (255 & c) >>> 0;
+ c >>>= 8;
+ digest[4 * f] = (255 & c) >>> 0;
+ }
+ }
+ this.reset();
+ return digest;
+}
+
+function expand(e) {
+ const r: number[] = Array.from({ length: 132 });
+ for (let t = 0; t < 16; t++) {
+ r[t] = e[4 * t] << 24;
+ r[t] |= e[4 * t + 1] << 16;
+ r[t] |= e[4 * t + 2] << 8;
+ r[t] |= e[4 * t + 3];
+ r[t] >>>= 0;
+ }
+ for (let n = 16; n < 68; n++) {
+ let a = r[n - 16] ^ r[n - 9] ^ rotateLeft32(r[n - 3], 15);
+ a = a ^ rotateLeft32(a, 15) ^ rotateLeft32(a, 23);
+ r[n] = (a ^ rotateLeft32(r[n - 13], 7) ^ r[n - 6]) >>> 0;
+ }
+ for (let n = 0; n < 64; n++) {
+ r[n + 68] = (r[n] ^ r[n + 4]) >>> 0;
+ }
+ return r;
+}
+
+function _compress(this: any, t) {
+ if (t < 64) {
+ logger.error('compress error: not enough data');
+ return;
+ } else {
+ const f = expand(t);
+ const i = this.reg.slice(0);
+ for (let c = 0; c < 64; c++) {
+ let o = rotateLeft32(i[0], 12) + i[4] + rotateLeft32(T(c), c);
+ o = (0xff_ff_ff_ff & o) >>> 0;
+ o = rotateLeft32(o, 7);
+
+ const s = (o ^ rotateLeft32(i[0], 12)) >>> 0;
+ let u = FF(c, i[0], i[1], i[2]);
+ u = u + i[3] + s + f[c + 68];
+ u = (0xff_ff_ff_ff & u) >>> 0;
+
+ let b = GG(c, i[4], i[5], i[6]);
+ b = b + i[7] + o + f[c];
+ b = (0xff_ff_ff_ff & b) >>> 0;
+ i[3] = i[2];
+ i[2] = rotateLeft32(i[1], 9);
+ i[1] = i[0];
+ i[0] = u;
+ i[7] = i[6];
+ i[6] = rotateLeft32(i[5], 19);
+ i[5] = i[4];
+ i[4] = (b ^ rotateLeft32(b, 9) ^ rotateLeft32(b, 17)) >>> 0;
+ }
+ for (let l = 0; l < 8; l++) {
+ this.reg[l] = (this.reg[l] ^ i[l]) >>> 0;
+ }
+ }
+}
+
+function _fill(this: any) {
+ const a = 8 * this.size;
+ let f = this.chunk.push(128) % 64;
+ for (64 - f < 8 && (f -= 64); f < 56; f++) {
+ this.chunk.push(0);
+ }
+ for (let i = 0; i < 4; i++) {
+ const c = Math.floor(a / 0x1_00_00_00_00);
+ this.chunk.push((c >>> (8 * (3 - i))) & 0xff);
+ }
+ for (let i = 0; i < 4; i++) {
+ this.chunk.push((a >>> (8 * (3 - i))) & 0xff);
+ }
+}
+
+function SM3(this: any) {
+ this.reg = [];
+ this.chunk = [];
+ this.size = 0;
+ this.reset();
+}
+SM3.prototype.reset = reset;
+SM3.prototype.write = write;
+SM3.prototype.sum = sum;
+SM3.prototype._compress = _compress;
+SM3.prototype._fill = _fill;
+
+function result_encrypt(long_str: string, num: 's0' | 's1' | 's2' | 's3' | 's4') {
+ const s_obj = {
+ s0: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
+ s1: 'Dkdpgh4ZKsQB80/Mfvw36XI1R25+WUAlEi7NLboqYTOPuzmFjJnryx9HVGcaStCe=',
+ s2: 'Dkdpgh4ZKsQB80/Mfvw36XI1R25-WUAlEi7NLboqYTOPuzmFjJnryx9HVGcaStCe=',
+ s3: 'ckdp1h4ZKsUB80/Mfvw36XIgR25+WQAlEi7NLboqYTOPuzmFjJnryx9HVGDaStCe',
+ s4: 'Dkdpgh2ZmsQB80/MfvV36XI1R45-WUAlEixNLwoqYTOPuzKFjJnry79HbGcaStCe',
+ };
+ const constant = {
+ '0': 16_515_072,
+ '1': 258048,
+ '2': 4032,
+ str: s_obj[num],
+ };
+
+ let result = '';
+ let lound = 0;
+ let long_int = get_long_int(lound, long_str);
+ for (let i = 0; i < (long_str.length / 3) * 4; i++) {
+ if (Math.floor(i / 4) !== lound) {
+ lound += 1;
+ long_int = get_long_int(lound, long_str);
+ }
+ const key = i % 4;
+ let temp_int: number;
+ switch (key) {
+ case 0:
+ temp_int = (long_int & constant['0']) >> 18;
+ result += constant.str.charAt(temp_int);
+ break;
+ case 1:
+ temp_int = (long_int & constant['1']) >> 12;
+ result += constant.str.charAt(temp_int);
+ break;
+ case 2:
+ temp_int = (long_int & constant['2']) >> 6;
+ result += constant.str.charAt(temp_int);
+ break;
+ case 3:
+ temp_int = long_int & 63;
+ result += constant.str.charAt(temp_int);
+ break;
+ default:
+ break;
+ }
+ }
+ return result;
+}
+
+function get_long_int(round, long_str) {
+ round = round * 3;
+ return (long_str.codePointAt(round) << 16) | (long_str.codePointAt(round + 1) << 8) | long_str.codePointAt(round + 2);
+}
+
+function gener_random(random, option) {
+ return [
+ (random & 255 & 170) | (option[0] & 85), // 163
+ (random & 255 & 85) | (option[0] & 170), // 87
+ ((random >> 8) & 255 & 170) | (option[1] & 85), // 37
+ ((random >> 8) & 255 & 85) | (option[1] & 170), // 41
+ ];
+}
+
+// ////////////////////////////////////////////
+function generate_rc4_bb_str(url_search_params, user_agent, window_env_str, suffix = 'cus', Arguments = [0, 1, 14]) {
+ const sm3 = new SM3();
+ const start_time = Date.now();
+ /**
+ * 进行3次加密处理
+ * 1: url_search_params两次sm3之的结果
+ * 2: 对后缀两次sm3之的结果
+ * 3: 对ua处理之后的结果
+ */
+ // url_search_params两次sm3之的结果
+ const url_search_params_list = sm3.sum(sm3.sum(url_search_params + suffix));
+ // 对后缀两次sm3之的结果
+ const cus = sm3.sum(sm3.sum(suffix));
+ // 对ua处理之后的结果
+ const ua = sm3.sum(result_encrypt(rc4_encrypt(user_agent, Reflect.apply(String.fromCharCode, null, [0.003_906_25, 1, 14])), 's3'));
+ //
+ const end_time = Date.now();
+ // b
+ const b = {
+ 8: 3, // 固定
+ 10: end_time, // 3次加密结束时间
+ 15: {
+ aid: 6383,
+ pageId: 6241,
+ boe: false,
+ ddrt: 7,
+ paths: {
+ include: [{}, {}, {}, {}, {}, {}, {}],
+ exclude: [],
+ },
+ track: {
+ mode: 0,
+ delay: 300,
+ paths: [],
+ },
+ dump: true,
+ rpU: '',
+ },
+ 16: start_time, // 3次加密开始时间
+ 18: 44, // 固定
+ 19: [1, 0, 1, 5],
+ };
+
+ // 3次加密开始时间
+ b[20] = (b[16] >> 24) & 255;
+ b[21] = (b[16] >> 16) & 255;
+ b[22] = (b[16] >> 8) & 255;
+ b[23] = b[16] & 255;
+ b[24] = (b[16] / 256 / 256 / 256 / 256) >> 0;
+ b[25] = (b[16] / 256 / 256 / 256 / 256 / 256) >> 0;
+
+ // 参数Arguments [0, 1, 14, ...]
+ // let Arguments = [0, 1, 14]
+ b[26] = (Arguments[0] >> 24) & 255;
+ b[27] = (Arguments[0] >> 16) & 255;
+ b[28] = (Arguments[0] >> 8) & 255;
+ b[29] = Arguments[0] & 255;
+
+ b[30] = (Arguments[1] / 256) & 255;
+ b[31] = Arguments[1] % 256 & 255;
+ b[32] = (Arguments[1] >> 24) & 255;
+ b[33] = (Arguments[1] >> 16) & 255;
+
+ b[34] = (Arguments[2] >> 24) & 255;
+ b[35] = (Arguments[2] >> 16) & 255;
+ b[36] = (Arguments[2] >> 8) & 255;
+ b[37] = Arguments[2] & 255;
+
+ // (url_search_params + "cus") 两次sm3之的结果
+ /** let url_search_params_list = [
+ 91, 186, 35, 86, 143, 253, 6, 76,
+ 34, 21, 167, 148, 7, 42, 192, 219,
+ 188, 20, 182, 85, 213, 74, 213, 147,
+ 37, 155, 93, 139, 85, 118, 228, 213
+ ]*/
+ b[38] = url_search_params_list[21];
+ b[39] = url_search_params_list[22];
+
+ // ("cus") 对后缀两次sm3之的结果
+ /**
+ * let cus = [
+ 136, 101, 114, 147, 58, 77, 207, 201,
+ 215, 162, 154, 93, 248, 13, 142, 160,
+ 105, 73, 215, 241, 83, 58, 51, 43,
+ 255, 38, 168, 141, 216, 194, 35, 236
+ ]*/
+ b[40] = cus[21];
+ b[41] = cus[22];
+
+ // 对ua处理之后的结果
+ /**
+ * let ua = [
+ 129, 190, 70, 186, 86, 196, 199, 53,
+ 99, 38, 29, 209, 243, 17, 157, 69,
+ 147, 104, 53, 23, 114, 126, 66, 228,
+ 135, 30, 168, 185, 109, 156, 251, 88
+ ]*/
+ b[42] = ua[23];
+ b[43] = ua[24];
+
+ // 3次加密结束时间
+ b[44] = (b[10] >> 24) & 255;
+ b[45] = (b[10] >> 16) & 255;
+ b[46] = (b[10] >> 8) & 255;
+ b[47] = b[10] & 255;
+ b[48] = b[8];
+ b[49] = (b[10] / 256 / 256 / 256 / 256) >> 0;
+ b[50] = (b[10] / 256 / 256 / 256 / 256 / 256) >> 0;
+
+ // object配置项
+ b[51] = b[15].pageId;
+ b[52] = (b[15].pageId >> 24) & 255;
+ b[53] = (b[15].pageId >> 16) & 255;
+ b[54] = (b[15].pageId >> 8) & 255;
+ b[55] = b[15].pageId & 255;
+
+ b[56] = b[15].aid;
+ b[57] = b[15].aid & 255;
+ b[58] = (b[15].aid >> 8) & 255;
+ b[59] = (b[15].aid >> 16) & 255;
+ b[60] = (b[15].aid >> 24) & 255;
+
+ // 中间进行了环境检测
+ // 代码索引: 2496 索引值: 17 (索引64关键条件)
+ // '1536|747|1536|834|0|30|0|0|1536|834|1536|864|1525|747|24|24|Win32'.charCodeAt()得到65位数组
+ /**
+ * let window_env_list = [49, 53, 51, 54, 124, 55, 52, 55, 124, 49, 53, 51, 54, 124, 56, 51, 52, 124, 48, 124, 51,
+ * 48, 124, 48, 124, 48, 124, 49, 53, 51, 54, 124, 56, 51, 52, 124, 49, 53, 51, 54, 124, 56,
+ * 54, 52, 124, 49, 53, 50, 53, 124, 55, 52, 55, 124, 50, 52, 124, 50, 52, 124, 87, 105, 110,
+ * 51, 50]
+ */
+ const window_env_list: number[] = [];
+ for (let index = 0; index < window_env_str.length; index++) {
+ window_env_list.push(window_env_str.codePointAt(index));
+ }
+ b[64] = window_env_list.length;
+ b[65] = b[64] & 255;
+ b[66] = (b[64] >> 8) & 255;
+
+ b[69] = [].length;
+ b[70] = b[69] & 255;
+ b[71] = (b[69] >> 8) & 255;
+
+ b[72] =
+ b[18] ^
+ b[20] ^
+ b[26] ^
+ b[30] ^
+ b[38] ^
+ b[40] ^
+ b[42] ^
+ b[21] ^
+ b[27] ^
+ b[31] ^
+ b[35] ^
+ b[39] ^
+ b[41] ^
+ b[43] ^
+ b[22] ^
+ b[28] ^
+ b[32] ^
+ b[36] ^
+ b[23] ^
+ b[29] ^
+ b[33] ^
+ b[37] ^
+ b[44] ^
+ b[45] ^
+ b[46] ^
+ b[47] ^
+ b[48] ^
+ b[49] ^
+ b[50] ^
+ b[24] ^
+ b[25] ^
+ b[52] ^
+ b[53] ^
+ b[54] ^
+ b[55] ^
+ b[57] ^
+ b[58] ^
+ b[59] ^
+ b[60] ^
+ b[65] ^
+ b[66] ^
+ b[70] ^
+ b[71];
+ let bb = [
+ b[18],
+ b[20],
+ b[52],
+ b[26],
+ b[30],
+ b[34],
+ b[58],
+ b[38],
+ b[40],
+ b[53],
+ b[42],
+ b[21],
+ b[27],
+ b[54],
+ b[55],
+ b[31],
+ b[35],
+ b[57],
+ b[39],
+ b[41],
+ b[43],
+ b[22],
+ b[28],
+ b[32],
+ b[60],
+ b[36],
+ b[23],
+ b[29],
+ b[33],
+ b[37],
+ b[44],
+ b[45],
+ b[59],
+ b[46],
+ b[47],
+ b[48],
+ b[49],
+ b[50],
+ b[24],
+ b[25],
+ b[65],
+ b[66],
+ b[70],
+ b[71],
+ ];
+ bb = bb.concat(window_env_list).concat(b[72]);
+ return rc4_encrypt(String.fromCharCode.apply(null, bb), Reflect.apply(String.fromCharCode, null, [121]));
+}
+
+function generate_random_str() {
+ let random_str_list: number[] = [];
+ random_str_list = random_str_list.concat(gener_random(Math.random() * 10000, [3, 45]));
+ random_str_list = random_str_list.concat(gener_random(Math.random() * 10000, [1, 0]));
+ random_str_list = random_str_list.concat(gener_random(Math.random() * 10000, [1, 5]));
+ return String.fromCharCode.apply(null, random_str_list);
+}
+
+export function generate_a_bogus(url_search_params, user_agent) {
+ const result_str = generate_random_str() + generate_rc4_bb_str(url_search_params, user_agent, '1536|747|1536|834|0|30|0|0|1536|834|1536|864|1525|747|24|24|Win32');
+ return result_encrypt(result_str, 's4') + '=';
+}
diff --git a/lib/routes/toutiao/namespace.ts b/lib/routes/toutiao/namespace.ts
new file mode 100644
index 00000000000000..5f89ec4ccd17dd
--- /dev/null
+++ b/lib/routes/toutiao/namespace.ts
@@ -0,0 +1,7 @@
+import type { Namespace } from '@/types';
+
+export const namespace: Namespace = {
+ name: '今日头条',
+ url: 'www.toutiao.com',
+ lang: 'zh-CN',
+};
diff --git a/lib/routes/toutiao/types.ts b/lib/routes/toutiao/types.ts
new file mode 100644
index 00000000000000..a422596ac6cae0
--- /dev/null
+++ b/lib/routes/toutiao/types.ts
@@ -0,0 +1,324 @@
+export interface Feed {
+ abstract: string;
+ aggr_type: number;
+ article_sub_type: number;
+ article_type: number;
+ article_url: string;
+ article_version: number;
+ ban_comment: boolean;
+ behot_time: number;
+ bury_count: number;
+ bury_style_show: number;
+ cell_ctrls: CellCtrls;
+ cell_flag: number;
+ cell_layout_style: number;
+ cell_type: number;
+ comment_count: number;
+ common_raw_data: string;
+ /**
+ * Appears only if cell_type is 32
+ */
+ content?: string;
+ content_decoration: string;
+ control_meta: ControlMeta;
+ cursor: number;
+ data_type: number;
+ digg_count: number;
+ display_url: string;
+ forum_extra_data: string;
+ forward_info: ForwardInfo;
+ gallary_image_count: number;
+ group_flags: number;
+ group_id: string;
+ group_source: number;
+ group_type: number;
+ has_image: boolean;
+ has_m3u8_video: boolean;
+ has_mp4_video: boolean;
+ has_video: boolean;
+ hot: number;
+ id: string;
+ is_original: boolean;
+ itemCell: ItemCell;
+ itemCellDebug: null;
+ item_id: string;
+ item_id_str: string;
+ item_version: number;
+ label_style: number;
+ level: number;
+ like_count: number;
+ log_pb: LogPb;
+ lynx_server: LynxServer;
+ natant_level: number;
+ preload_web: number;
+ publish_time: number;
+ /**
+ * Appears only if cell_type is 32
+ */
+ rich_content?: string;
+ read_count: number;
+ reback_flag: number;
+ repin_count: number;
+ repin_time: number;
+ req_id: string;
+ share_url: string;
+ show_more: ShowMore;
+ source: string;
+ subject_group_id: number;
+ tag_id: number;
+ tip: number;
+ title: string;
+ url: string;
+ /**
+ * Appears only if cell_type is 32
+ */
+ user?: UserInfo;
+ user_bury: number;
+ user_digg: number;
+ user_info?: UserInfo;
+ user_like: number;
+ user_repin: number;
+ user_repin_time: number;
+ video_duration: number;
+ video_style: number;
+ image_list: ImageListItem[];
+ large_image_list: LargeImageListItem[];
+ middle_image: MiddleImage;
+ video_detail_info: VideoDetailInfo;
+}
+
+interface CellCtrls {
+ cell_flag: number;
+ cell_height: number;
+ cell_layout_style: number;
+}
+
+interface ControlMeta {
+ modify: Modify;
+ remove: Remove;
+ share: Share;
+}
+
+interface Modify {
+ hide: boolean;
+ name: string;
+ permission: boolean;
+ tips: string;
+}
+
+interface Remove {
+ hide: boolean;
+ name: string;
+ permission: boolean;
+ tips: string;
+}
+
+interface Share {
+ hide: boolean;
+ name: string;
+ permission: boolean;
+ tips: string;
+}
+
+interface ForwardInfo {
+ forward_count: number;
+}
+
+interface ItemCell {
+ actionCtrl: ActionCtrl;
+ articleBase: ArticleBase;
+ articleClassification: ArticleClassification;
+ cellCtrl: CellCtrl;
+ extra: Extra;
+ imageList: ImageList;
+ itemCounter: ItemCounter;
+ locationInfo: LocationInfo;
+ shareInfo: ShareInfo;
+ tagInfo: TagInfo;
+ userInteraction: UserInteraction;
+ videoInfo: VideoInfo;
+}
+
+interface ActionCtrl {
+ actionBar: ActionBar;
+ banBury: boolean;
+ banComment: boolean;
+ banDigg: boolean;
+ controlMeta: ActionControlMeta;
+}
+
+interface ActionBar {
+ actionSettingList: ActionSetting[];
+}
+
+interface ActionSetting {
+ actionType: number;
+ styleSetting: StyleSetting;
+}
+
+interface StyleSetting {
+ iconKey: string;
+ layoutDirection: number;
+ text: string;
+}
+
+interface ActionControlMeta {
+ modify: ActionModify;
+ remove: ActionRemove;
+ share: ActionShare;
+}
+
+interface ActionModify {
+ permission: boolean;
+ tips: string;
+}
+
+interface ActionRemove {
+ permission: boolean;
+ tips: string;
+}
+
+interface ActionShare {
+ permission: boolean;
+ tips: string;
+}
+
+interface ArticleBase {
+ gidStr: string;
+ itemStatus: number;
+}
+
+interface ArticleClassification {
+ aggrType: number;
+ articleSubType: number;
+ articleType: number;
+ bizID: number;
+ bizTag: number;
+ groupSource: number;
+ isForAudioPlaylist: boolean;
+ isOriginal: boolean;
+ isSubject: boolean;
+ level: number;
+}
+
+interface CellCtrl {
+ buryStyleShow: number;
+ cellFlag: number;
+ cellLayoutStyle: number;
+ cellType: number;
+ cellUIType: string;
+ groupFlags: number;
+}
+
+interface Extra {
+ ping: string;
+}
+
+type ImageList = unknown;
+
+interface ItemCounter {
+ commentCount: number;
+ diggCount: number;
+ forwardCount: number;
+ readCount: number;
+ repinCount: number;
+ shareCount: number;
+ showCount: number;
+ textCount: number;
+ videoWatchCount: number;
+ buryCount: number;
+}
+
+interface LocationInfo {
+ publishLocInfo: string;
+}
+
+interface ShareInfo {
+ shareURL: string;
+ shareControl: ShareControl;
+}
+
+interface ShareControl {
+ isHighQuality: boolean;
+}
+
+type TagInfo = unknown;
+
+interface UserInteraction {
+ userDigg: boolean;
+ userRepin: boolean;
+}
+
+type VideoInfo = unknown;
+
+interface LogPb {
+ cell_layout_style: string;
+ group_id_str: string;
+ group_source: string;
+ impr_id: string;
+ is_following: string;
+ is_yaowen: string;
+}
+
+type LynxServer = unknown;
+
+interface ShowMore {
+ title: string;
+ url: string;
+}
+
+interface UserInfo {
+ avatar_url: string;
+ description: string;
+ desc: string;
+ follow: boolean;
+ name: string;
+ user_auth_info: string;
+ user_id: string;
+ user_verified: boolean;
+ verified_content: string;
+}
+
+interface ImageListItem {
+ height: number;
+ uri: string;
+ url: string;
+ url_list: UrlList[];
+ width: number;
+}
+
+interface UrlList {
+ url: string;
+}
+
+interface LargeImageListItem {
+ height: number;
+ uri: string;
+ url: string;
+ url_list: UrlList[];
+ width: number;
+}
+
+interface MiddleImage {
+ height: number;
+ uri: string;
+ url: string;
+ url_list: UrlList[];
+ width: number;
+}
+
+interface VideoDetailInfo {
+ detail_video_large_image: DetailVideoLargeImage;
+ direct_play: number;
+ group_flags: number;
+ show_pgc_subscribe: number;
+ video_id: string;
+}
+
+interface DetailVideoLargeImage {
+ height: number;
+ uri: string;
+ url: string;
+ url_list: UrlList[];
+ width: number;
+}
diff --git a/lib/routes/toutiao/user.ts b/lib/routes/toutiao/user.ts
new file mode 100644
index 00000000000000..5a8d50cb9df64e
--- /dev/null
+++ b/lib/routes/toutiao/user.ts
@@ -0,0 +1,71 @@
+import { Route } from '@/types';
+import cache from '@/utils/cache';
+import ofetch from '@/utils/ofetch';
+import { parseDate } from '@/utils/parse-date';
+import randUserAgent from '@/utils/rand-user-agent';
+import { generate_a_bogus } from './a-bogus';
+import { Feed } from './types';
+import RejectError from '@/errors/types/reject';
+import { config } from '@/config';
+
+export const route: Route = {
+ path: '/user/token/:token',
+ categories: ['new-media'],
+ example: '/toutiao/user/token/MS4wLjABAAAAEmbqJP2CmC8XXv1BpMvQ3sQHKAxFsq8wHxj8XVIQWja6tMcB-QEbFkzkRNgMl12M',
+ parameters: { token: '用户 token,可在用户主页 URL 找到' },
+ features: {
+ antiCrawler: true,
+ },
+ radar: [
+ {
+ source: ['www.toutiao.com/c/user/token/:token'],
+ },
+ ],
+ name: '头条主页',
+ maintainers: ['TonyRL'],
+ handler,
+};
+
+async function handler(ctx) {
+ const { token } = ctx.req.param();
+ const ua = randUserAgent({ browser: 'chrome', os: 'windows', device: 'desktop' });
+
+ const feed = (await cache.tryGet(`toutiao:user:${token}`, async () => {
+ const query = `category=profile_all&token=${token}&max_behot_time=0&entrance_gid&aid=24&app_name=toutiao_web`;
+
+ const data = await ofetch(`https://www.toutiao.com/api/pc/list/feed?${query}&a_bogus=${generate_a_bogus(query, ua)}`, {
+ headers: {
+ 'User-Agent': ua,
+ },
+ });
+
+ return data.data;
+ },config.cache.routeExpire,
+ false
+)) as Feed[];
+
+ if (!feed) {
+ throw new RejectError('无法获取用户信息');
+ }
+
+ const items = feed.map((item) => {
+ const enclosure = item.large_image_list?.pop();
+ return {
+ title: item.title,
+ description: item.rich_content ?? item.abstract ?? item.content,
+ link: `https://www.toutiao.com/${item.cell_type === 60 ? 'article' : /* 32 */ 'w'}/${item.id}/`,
+ pubDate: parseDate(item.publish_time, 'X'),
+ author: item.user_info?.name ?? item.user?.name ?? item.source,
+ enclosure_url: enclosure?.url,
+ enclosure_type: enclosure?.url ? `image/${new URL(enclosure.url).pathname.split('.').pop()}` : undefined,
+ };
+ });
+
+ return {
+ title: `${feed[0].user_info?.name ?? feed[0].user?.name ?? feed[0].source}的头条主页 - 今日头条(www.toutiao.com)`,
+ description: feed[0].user_info?.description ?? feed[0].user?.desc,
+ link: `https://www.toutiao.com/c/user/token/${token}/`,
+ image: feed[0].user_info?.avatar_url ?? feed[0].user?.avatar_url,
+ item: items,
+ };
+}
|
f77d2dc0d6301a91193c5974b1e08d25d0435136
|
2019-05-19 14:51:47
|
我愿人长久
|
fix: Update university.md (#2173)
| false
|
Update university.md (#2173)
|
fix
|
diff --git a/docs/university.md b/docs/university.md
index c40da0cfa03f1d..78fb6808e34d1a 100644
--- a/docs/university.md
+++ b/docs/university.md
@@ -68,7 +68,7 @@ pageClass: routes
### 硕士研究生招生通知
-<Route author="ihewro" example="/bupt/yz/int" path="/bupt/yzwf/:type" :paramsDesc="['学院英文缩写']">
+<Route author="ihewro" example="/bupt/yz/int" path="/bupt/yz/:type" :paramsDesc="['学院英文缩写']">
| 综合 | 信息与通信工程学院 | 电子工程学院 | 计算机学院 | 自动化学院 | 软件学院 | 数字媒体与设计艺术学院 | 网络空间安全学院 | 理学院 | 经济管理学院 | 人文学院 | 马克思主义学院 | 网络技术研究院 | 信息光子学与光通信研究院 |
| ---- | ------------------ | ------------ | ---------- | ---------- | -------- | ---------------------- | ---------------- | ------ | ------------ | -------- | -------------- | -------------- | ------------------------ |
|
de25d5f7f6acf07440cae9163b15e7f1fc1dc198
|
2019-04-09 08:23:53
|
renovate[bot]
|
fix(deps): update dependency googleapis to v39 (#1842)
| false
|
update dependency googleapis to v39 (#1842)
|
fix
|
diff --git a/package.json b/package.json
index ce13512489a8f9..3d5b370bdc015e 100644
--- a/package.json
+++ b/package.json
@@ -57,7 +57,7 @@
"dayjs": "^1.7.7",
"form-data": "^2.3.2",
"git-rev-sync": "1.12.0",
- "googleapis": "38.0.0",
+ "googleapis": "39.2.0",
"he": "^1.1.1",
"iconv-lite": "0.4.24",
"imgur": "^0.3.1",
diff --git a/yarn.lock b/yarn.lock
index caeda3fe5855d2..a2c2b55d09d958 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4910,10 +4910,10 @@ googleapis-common@^0.7.0:
url-template "^2.0.8"
uuid "^3.2.1"
[email protected]:
- version "38.0.0"
- resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-38.0.0.tgz#780453875d56ea3cc2ed70063cd59db068b8a0f0"
- integrity sha512-8p3gYviQniL4bsRJV79ZIXHEPjVpI+z8UBNrrHcBOv6aEGWZPKa2bpStMocHXNQ4E39GhZdMON857e0BAJ2Z0Q==
[email protected]:
+ version "39.2.0"
+ resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-39.2.0.tgz#5c81f721e9da2e80cb0b25821ed60d3bc200c3da"
+ integrity sha512-66X8TG1B33zAt177sG1CoKoYHPP/B66tEpnnSANGCqotMuY5gqSQO8G/0gqHZR2jRgc5CHSSNOJCnpI0SuDxMQ==
dependencies:
google-auth-library "^3.0.0"
googleapis-common "^0.7.0"
|
2a23c6aa8d0214bd4fcd5053fafb65074b9a1d71
|
2019-10-12 08:42:05
|
dependabot-preview[bot]
|
chore(deps-dev): bump vuepress from 1.1.0 to 1.2.0
| false
|
bump vuepress from 1.1.0 to 1.2.0
|
chore
|
diff --git a/package.json b/package.json
index fe049dc07cb9ab..fc07acb835e982 100644
--- a/package.json
+++ b/package.json
@@ -54,7 +54,7 @@
"prettier-check": "2.0.0",
"pretty-quick": "1.11.1",
"supertest": "4.0.2",
- "vuepress": "1.1.0",
+ "vuepress": "1.2.0",
"yorkie": "2.0.0"
},
"dependencies": {
diff --git a/yarn.lock b/yarn.lock
index 964ce64ec6977c..eb00548ee9f7e6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1287,10 +1287,10 @@
"@vue/babel-plugin-transform-vue-jsx" "^1.0.0"
camelcase "^5.0.0"
-"@vue/component-compiler-utils@^2.5.1":
- version "2.6.0"
- resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.6.0.tgz#aa46d2a6f7647440b0b8932434d22f12371e543b"
- integrity sha512-IHjxt7LsOFYc0DkTncB7OXJL7UzwOLPPQCfEUNyxL2qt+tF12THV+EO33O1G2Uk4feMSWua3iD39Itszx0f0bw==
+"@vue/component-compiler-utils@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-3.0.0.tgz#d16fa26b836c06df5baaeb45f3d80afc47e35634"
+ integrity sha512-am+04/0UX7ektcmvhYmrf84BDVAD8afFOf4asZjN84q8xzxFclbk5x0MtxuKGfp+zjN5WWPJn3fjFAWtDdIGSw==
dependencies:
consolidate "^0.15.1"
hash-sum "^1.0.2"
@@ -1302,18 +1302,18 @@
source-map "~0.6.1"
vue-template-es2015-compiler "^1.9.0"
-"@vuepress/core@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@vuepress/core/-/core-1.1.0.tgz#32fd2b65a4613085cbd2b812bf67afe3a037dc65"
- integrity sha512-qC+R9kdTpui9QjQGUXUsmfAbToWOnoYjP2AJqMT/RsKUhQsXAIMe2Z0L/Vw2Z3bmlTUq26v+B1zlFgYzGuyIEQ==
+"@vuepress/core@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@vuepress/core/-/core-1.2.0.tgz#8e0c636b7f8676202fdd1ecfbe31bfe245dab2a8"
+ integrity sha512-ZIsUkQIF+h4Yk6q4okoRnRwRhcYePu/kNiL0WWPDGycjai8cFqFjLDP/tJjfTKXmn9A62j2ETjSwaiMxCtDkyw==
dependencies:
"@babel/core" "^7.0.0"
"@vue/babel-preset-app" "^3.1.1"
- "@vuepress/markdown" "^1.1.0"
- "@vuepress/markdown-loader" "^1.1.0"
- "@vuepress/plugin-last-updated" "^1.1.0"
- "@vuepress/plugin-register-components" "^1.1.0"
- "@vuepress/shared-utils" "^1.1.0"
+ "@vuepress/markdown" "^1.2.0"
+ "@vuepress/markdown-loader" "^1.2.0"
+ "@vuepress/plugin-last-updated" "^1.2.0"
+ "@vuepress/plugin-register-components" "^1.2.0"
+ "@vuepress/shared-utils" "^1.2.0"
autoprefixer "^9.5.1"
babel-loader "^8.0.4"
cache-loader "^3.0.0"
@@ -1332,34 +1332,34 @@
postcss-safe-parser "^4.0.1"
toml "^3.0.0"
url-loader "^1.0.1"
- vue "^2.5.16"
- vue-loader "^15.2.4"
- vue-router "^3.0.2"
- vue-server-renderer "^2.5.16"
- vue-template-compiler "^2.5.16"
+ vue "^2.6.10"
+ vue-loader "^15.7.1"
+ vue-router "^3.1.3"
+ vue-server-renderer "^2.6.10"
+ vue-template-compiler "^2.6.10"
vuepress-html-webpack-plugin "^3.2.0"
- vuepress-plugin-container "^2.0.0"
+ vuepress-plugin-container "^2.0.2"
webpack "^4.8.1"
webpack-chain "^4.6.0"
webpack-dev-server "^3.5.1"
webpack-merge "^4.1.2"
webpackbar "3.2.0"
-"@vuepress/markdown-loader@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@vuepress/markdown-loader/-/markdown-loader-1.1.0.tgz#ab8ac2d286c255f9fa39ecb2f4542053314825ac"
- integrity sha512-X4+E9kbFt3OSXKxtQbNxeuzxbXdSMhXz8tliUW+/+1zx7RGn1ApcR0x7Y6/irESUgZ+GxOT3jyiCDZA4usHhLA==
+"@vuepress/markdown-loader@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@vuepress/markdown-loader/-/markdown-loader-1.2.0.tgz#f8972014616b4ab46a99c9aaac2dd414d437411c"
+ integrity sha512-gOZzoHjfp/W6t+qKBRdbHS/9TwRnNuhY7V+yFzxofNONFHQULofIN/arG+ptYc2SuqJ541jqudNQW+ldHNMC2w==
dependencies:
- "@vuepress/markdown" "^1.1.0"
+ "@vuepress/markdown" "^1.2.0"
loader-utils "^1.1.0"
lru-cache "^5.1.1"
-"@vuepress/markdown@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@vuepress/markdown/-/markdown-1.1.0.tgz#f9095c91019d21dbc3daedfd3773c6d5c29117ec"
- integrity sha512-O2ivsIkUrSUPDx+9N43XKSOGtprV4G1k6/4o3wZjjCn6GXYRsRE906cFDlbryHxQ49Z7Yfz3gyZIGMnThxLo/w==
+"@vuepress/markdown@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@vuepress/markdown/-/markdown-1.2.0.tgz#7c457e0fab52ef8ac4dd1898ae450bc3aec30746"
+ integrity sha512-RLRQmTu5wJbCO4Qv+J0K53o5Ew7nAGItLwWyzCbIUB6pRsya3kqSCViWQVlKlS53zFTmRHuAC9tJMRdzly3mCA==
dependencies:
- "@vuepress/shared-utils" "^1.1.0"
+ "@vuepress/shared-utils" "^1.2.0"
markdown-it "^8.4.1"
markdown-it-anchor "^5.0.2"
markdown-it-chain "^1.3.0"
@@ -1367,12 +1367,12 @@
markdown-it-table-of-contents "^0.4.0"
prismjs "^1.13.0"
-"@vuepress/plugin-active-header-links@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@vuepress/plugin-active-header-links/-/plugin-active-header-links-1.1.0.tgz#cd62c1712040676035f34fed16a088e1c08811d8"
- integrity sha512-sa5ySYl/kTyr1AMakeW375wWs1aQ6psiJiSFclxkGvxcuGZ89F27ELvd43DKaETAlH90LcoE/j7TXMA895qXmw==
+"@vuepress/plugin-active-header-links@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@vuepress/plugin-active-header-links/-/plugin-active-header-links-1.2.0.tgz#46495c89e51a95e57139be007dffbcae4b229260"
+ integrity sha512-vdi7l96pElJvEmcx6t9DWJNH25TIurS8acjN3+b7o4NzdaszFn5j6klN6WtI4Z+5BVDrxHP5W1F3Ebw8SZyupA==
dependencies:
- lodash.throttle "^4.1.1"
+ lodash.debounce "^4.0.8"
"@vuepress/[email protected]":
version "1.2.0"
@@ -1386,17 +1386,17 @@
resolved "https://registry.yarnpkg.com/@vuepress/plugin-google-analytics/-/plugin-google-analytics-1.2.0.tgz#54555fd14f01a032c5acff04ecbbe0911577d7d0"
integrity sha512-0zol5D4Efb5GKel7ADO/s65MLtKSLnOEGkeWzuipkWomSQPzP7TJ3+/RcYBnGdyBFHd1BSpTUHGK0b/IGwM3UA==
-"@vuepress/plugin-last-updated@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@vuepress/plugin-last-updated/-/plugin-last-updated-1.1.0.tgz#65f2de734f3744026297b4667f3b5276ef99fd06"
- integrity sha512-x2SaAKWk26RK9O0slnZ55eSlBFYdYjFgqkRIfaOf4f2biWqTa9nzaIbvjzvcx3AZKlOWMl81KRwybhDL8E9OsA==
+"@vuepress/plugin-last-updated@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@vuepress/plugin-last-updated/-/plugin-last-updated-1.2.0.tgz#7b34065b793848b0482a222b7a6f1b7df3668cdc"
+ integrity sha512-j4uZb/MXDyG+v9QCG3T/rkiaOhC/ib7NKCt1cjn3GOwvWTDmB5UZm9EBhUpbDNrBgxW+SaHOe3kMVNO8bGOTGw==
dependencies:
cross-spawn "^6.0.5"
-"@vuepress/plugin-nprogress@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@vuepress/plugin-nprogress/-/plugin-nprogress-1.1.0.tgz#ca7106adc7016ed0d90a22555066c11da597ef59"
- integrity sha512-XhUyAO+mzYFOFupX/pNlPbv0bT596Lk000Q2PhWfRliwUzpUd0/u5Z6B6fasIVj01Yqih/gAGOZpr2ZwSCNJYw==
+"@vuepress/plugin-nprogress@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@vuepress/plugin-nprogress/-/plugin-nprogress-1.2.0.tgz#ff6166946a0b118a39a562acb57983529afce4d2"
+ integrity sha512-0apt3Dp6XVCOkLViX6seKSEJgARihi+pX3/r8j8ndFp9Y+vmgLFZnQnGE5iKNi1ty+A6PZOK0RQcBjwTAU4pAw==
dependencies:
nprogress "^0.2.0"
@@ -1409,19 +1409,19 @@
register-service-worker "^1.5.2"
workbox-build "^4.3.1"
-"@vuepress/plugin-register-components@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@vuepress/plugin-register-components/-/plugin-register-components-1.1.0.tgz#42ea75bcad3fb562fbb86c424136f86e13641162"
- integrity sha512-HXGdcmBdGHLhI8KHr09GnnZEzgCuaIQx1WBqDNfbigSVKEx910L56ej+Whl6VFd7D0uOLUlW4kb9ELM0sjJpKg==
+"@vuepress/plugin-register-components@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@vuepress/plugin-register-components/-/plugin-register-components-1.2.0.tgz#95aa0e0af94b2758b26ab98814c43b0f7bcd502b"
+ integrity sha512-C32b8sbGtDEX8I3SUUKS/w2rThiRFiKxmzNcJD996me7VY/4rgmZ8CxGtb6G9wByVoK0UdG1SOkrgOPdSCm80A==
dependencies:
- "@vuepress/shared-utils" "^1.1.0"
+ "@vuepress/shared-utils" "^1.2.0"
-"@vuepress/plugin-search@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@vuepress/plugin-search/-/plugin-search-1.1.0.tgz#3b7a344a7df1bab27f10a46e6b57680c8f5d4c7e"
- integrity sha512-GoxvcM65ZAZycnsoZJ/wx9F3hXKzzJQdS7lNnAuHrvCheT5tVO1wwMumVP/unZU/59zCQ1PiyReYntLSp5bXVg==
+"@vuepress/plugin-search@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@vuepress/plugin-search/-/plugin-search-1.2.0.tgz#0b27c467b7fd42bd4d9e32de0fe2fb81a24bd311"
+ integrity sha512-QU3JfnMfImDAArbJOVH1q1iCDE5QrT99GLpNGo6KQYZWqY1TWAbgyf8C2hQdaI03co1lkU2Wn/iqzHJ5WHlueg==
-"@vuepress/shared-utils@^1.1.0", "@vuepress/shared-utils@^1.2.0":
+"@vuepress/shared-utils@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@vuepress/shared-utils/-/shared-utils-1.2.0.tgz#8d9ab40c24f75f027ef32c2ad0169f0f08e949fa"
integrity sha512-wo5Ng2/xzsmIYCzvWxgLFlDBp7FkmJp2shAkbSurLNAh1vixhs0+LyDxsk01+m34ktJSp9rTUUsm6khw/Fvo0w==
@@ -1436,19 +1436,20 @@
semver "^6.0.0"
upath "^1.1.0"
-"@vuepress/theme-default@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@vuepress/theme-default/-/theme-default-1.1.0.tgz#915c97bb69985d6fccd815f829532d67d828e10a"
- integrity sha512-U+kFHakSBEXFAdfItyeCbP//q2hm9R8+vnTFjbMMVgRZ2SHPnDUC/7WWGoEUzfEpFHHPrG1OzC9iI/o5v8p5AQ==
+"@vuepress/theme-default@^1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@vuepress/theme-default/-/theme-default-1.2.0.tgz#3303af21a00031a3482ed1c494508234f545cbf1"
+ integrity sha512-mJxAMYQQv4OrGFsArMlONu8RpCzPUVx81dumkyTT4ay5PXAWTj+WDeFQLOT3j0g9QrDJGnHhbiw2aS+R/0WUyQ==
dependencies:
- "@vuepress/plugin-active-header-links" "^1.1.0"
- "@vuepress/plugin-nprogress" "^1.1.0"
- "@vuepress/plugin-search" "^1.1.0"
+ "@vuepress/plugin-active-header-links" "^1.2.0"
+ "@vuepress/plugin-nprogress" "^1.2.0"
+ "@vuepress/plugin-search" "^1.2.0"
docsearch.js "^2.5.2"
lodash "^4.17.15"
stylus "^0.54.5"
stylus-loader "^3.0.2"
- vuepress-plugin-container "^2.0.0"
+ vuepress-plugin-container "^2.0.2"
+ vuepress-plugin-smooth-scroll "^0.0.3"
"@webassemblyjs/[email protected]":
version "1.8.5"
@@ -6857,11 +6858,6 @@ lodash.templatesettings@^4.0.0:
dependencies:
lodash._reinterpolate "^3.0.0"
-lodash.throttle@^4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
- integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=
-
lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
@@ -9678,6 +9674,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.2.tgz#5207858c3815cc69110703c6b94e46c15634395d"
integrity sha512-JDhEpTKzXusOqXZ0BUIdH+CjFdO/CR3tLlf5CN34IypI+xMmXW1uB16OOY8z3cICbJlDAVJzNbwBhNO0wt9OAw==
+smoothscroll-polyfill@^0.4.3:
+ version "0.4.4"
+ resolved "https://registry.yarnpkg.com/smoothscroll-polyfill/-/smoothscroll-polyfill-0.4.4.tgz#3a259131dc6930e6ca80003e1cb03b603b69abf8"
+ integrity sha512-TK5ZA9U5RqCwMpfoMq/l1mrH0JAR7y7KRvOBx0n2869aLxch+gT9GhN3yUfjiw+d/DiF1mKo14+hd62JyMmoBg==
+
snapdragon-node@^2.0.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
@@ -10866,23 +10867,23 @@ vue-hot-reload-api@^2.3.0:
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz#2756f46cb3258054c5f4723de8ae7e87302a1ccf"
integrity sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g==
-vue-loader@^15.2.4:
- version "15.7.0"
- resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.7.0.tgz#27275aa5a3ef4958c5379c006dd1436ad04b25b3"
- integrity sha512-x+NZ4RIthQOxcFclEcs8sXGEWqnZHodL2J9Vq+hUz+TDZzBaDIh1j3d9M2IUlTjtrHTZy4uMuRdTi8BGws7jLA==
+vue-loader@^15.7.1:
+ version "15.7.1"
+ resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.7.1.tgz#6ccacd4122aa80f69baaac08ff295a62e3aefcfd"
+ integrity sha512-fwIKtA23Pl/rqfYP5TSGK7gkEuLhoTvRYW+TU7ER3q9GpNLt/PjG5NLv3XHRDiTg7OPM1JcckBgds+VnAc+HbA==
dependencies:
- "@vue/component-compiler-utils" "^2.5.1"
+ "@vue/component-compiler-utils" "^3.0.0"
hash-sum "^1.0.2"
loader-utils "^1.1.0"
vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0"
-vue-router@^3.0.2:
- version "3.0.6"
- resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.6.tgz#2e4f0f9cbb0b96d0205ab2690cfe588935136ac3"
- integrity sha512-Ox0ciFLswtSGRTHYhGvx2L44sVbTPNS+uD2kRISuo8B39Y79rOo0Kw0hzupTmiVtftQYCZl87mwldhh2L9Aquw==
+vue-router@^3.1.3:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.1.3.tgz#e6b14fabc0c0ee9fda0e2cbbda74b350e28e412b"
+ integrity sha512-8iSa4mGNXBjyuSZFCCO4fiKfvzqk+mhL0lnKuGcQtO1eoj8nq3CmbEG8FwK5QqoqwDgsjsf1GDuisDX4cdb/aQ==
-vue-server-renderer@^2.5.16:
+vue-server-renderer@^2.6.10:
version "2.6.10"
resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.6.10.tgz#cb2558842ead360ae2ec1f3719b75564a805b375"
integrity sha512-UYoCEutBpKzL2fKCwx8zlRtRtwxbPZXKTqbl2iIF4yRZUNO/ovrHyDAJDljft0kd+K0tZhN53XRHkgvCZoIhug==
@@ -10904,7 +10905,7 @@ vue-style-loader@^4.1.0:
hash-sum "^1.0.2"
loader-utils "^1.0.2"
-vue-template-compiler@^2.5.16:
+vue-template-compiler@^2.6.10:
version "2.6.10"
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.10.tgz#323b4f3495f04faa3503337a82f5d6507799c9cc"
integrity sha512-jVZkw4/I/HT5ZMvRnhv78okGusqe0+qH2A0Em0Cp8aq78+NK9TII263CDVz2QXZsIT+yyV/gZc/j/vlwa+Epyg==
@@ -10917,7 +10918,7 @@ vue-template-es2015-compiler@^1.9.0:
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==
-vue@^2.5.16:
+vue@^2.6.10:
version "2.6.10"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.10.tgz#a72b1a42a4d82a721ea438d1b6bf55e66195c637"
integrity sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==
@@ -10935,20 +10936,27 @@ vuepress-html-webpack-plugin@^3.2.0:
toposort "^1.0.0"
util.promisify "1.0.0"
-vuepress-plugin-container@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/vuepress-plugin-container/-/vuepress-plugin-container-2.0.1.tgz#b20ef97dd91f137c8be119460927c5ffd64e0f77"
- integrity sha512-SMlWJl0uZYkqAxD2RUZmIrANZWKgiZdM64K7WmdyHyQPYI+NUj3ugi5D+zDn62BoO9NfQTiskEIa2u619SRweA==
+vuepress-plugin-container@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/vuepress-plugin-container/-/vuepress-plugin-container-2.0.2.tgz#3489cc732c7a210b31f202556e1346125dffeb73"
+ integrity sha512-SrGYYT7lkie7xlIlAVhn+9sDW42MytNCoxWL/2uDr+q9wZA4h1uYlQvfc2DVjy+FsM9PPPSslkeo/zCpYVY82g==
dependencies:
markdown-it-container "^2.0.0"
[email protected]:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-1.1.0.tgz#ca0d787d93188b2fd05820a650d7e3643c9e7675"
- integrity sha512-LAgS9nXsmvjTuCc/LHPWnIsPOuVuZtxh1MjVZf/xJ3Yy5kXoPhqbGUptlQdQt3izjIlns9zin5K6MNBY3u5l5g==
+vuepress-plugin-smooth-scroll@^0.0.3:
+ version "0.0.3"
+ resolved "https://registry.yarnpkg.com/vuepress-plugin-smooth-scroll/-/vuepress-plugin-smooth-scroll-0.0.3.tgz#6eff2d4c186cca917cc9f7df2b0af7de7c8c6438"
+ integrity sha512-qsQkDftLVFLe8BiviIHaLV0Ea38YLZKKonDGsNQy1IE0wllFpFIEldWD8frWZtDFdx6b/O3KDMgVQ0qp5NjJCg==
+ dependencies:
+ smoothscroll-polyfill "^0.4.3"
+
[email protected]:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-1.2.0.tgz#2f2cdf337ad40a3e4866dfd33e97b840db386af7"
+ integrity sha512-EfHo8Cc73qo+1Pm18hM0qOGynmDr8q5fu2664obynsdCJ1zpvoShVnA0Msraw4SI2xDc0iAoIb3dTwxUIM8DAw==
dependencies:
- "@vuepress/core" "^1.1.0"
- "@vuepress/theme-default" "^1.1.0"
+ "@vuepress/core" "^1.2.0"
+ "@vuepress/theme-default" "^1.2.0"
cac "^6.3.9"
envinfo "^7.2.0"
opencollective-postinstall "^2.0.2"
|
7fd8dcf3266bf46b055846c6eecb595926c0a752
|
2022-12-08 06:40:10
|
dependabot[bot]
|
chore(deps): bump puppeteer from 19.3.0 to 19.4.0 (#11408)
| false
|
bump puppeteer from 19.3.0 to 19.4.0 (#11408)
|
chore
|
diff --git a/package.json b/package.json
index 950af556d87994..24dfe58b57bc52 100644
--- a/package.json
+++ b/package.json
@@ -131,7 +131,7 @@
"pidusage": "3.0.2",
"plist": "3.0.6",
"proxy-chain": "2.2.0",
- "puppeteer": "19.3.0",
+ "puppeteer": "19.4.0",
"puppeteer-extra": "3.3.4",
"puppeteer-extra-plugin-stealth": "2.11.1",
"query-string": "7.1.3",
diff --git a/yarn.lock b/yarn.lock
index 540bb6246535c2..5382947dd6524c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1919,11 +1919,6 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.0.tgz#f38c7139247a1d619f6cc6f27b072606af7c289d"
integrity sha512-IOXCvVRToe7e0ny7HpT/X9Rb2RYtElG1a+VshjwT00HxrM2dWBApHQoqsI6WiY7Q03vdf2bCrIGzVrkF/5t10w==
-"@types/parse-json@^4.0.0":
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
- integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
-
"@types/prettier@^2.1.5":
version "2.7.1"
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e"
@@ -4304,16 +4299,15 @@ core-util-is@~1.0.0:
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
[email protected]:
- version "7.0.1"
- resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d"
- integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==
[email protected]:
+ version "8.0.0"
+ resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.0.0.tgz#e9feae014eab580f858f8a0288f38997a7bebe97"
+ integrity sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==
dependencies:
- "@types/parse-json" "^4.0.0"
import-fresh "^3.2.1"
+ js-yaml "^4.1.0"
parse-json "^5.0.0"
path-type "^4.0.0"
- yaml "^1.10.0"
cosmiconfig@^5.0.0:
version "5.2.1"
@@ -4928,10 +4922,10 @@ detect-node@^2.0.4:
resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1"
integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==
[email protected]:
- version "0.0.1056733"
- resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1056733.tgz#55bb1d56761014cc221131cca5e6bad94eefb2b9"
- integrity sha512-CmTu6SQx2g3TbZzDCAV58+LTxVdKplS7xip0g5oDXpZ+isr0rv5dDP8ToyVRywzPHkCCPKgKgScEcwz4uPWDIA==
[email protected]:
+ version "0.0.1068969"
+ resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1068969.tgz#8b9a4bc48aed1453bed08d62b07481f9abf4d6d8"
+ integrity sha512-ATFTrPbY1dKYhPPvpjtwWKSK2mIwGmRwX54UASn9THEuIZCe2n9k3vVuMmt6jWeL+e5QaaguEv/pMyR+JQB7VQ==
[email protected]:
version "1.0.3"
@@ -11416,14 +11410,14 @@ pupa@^2.0.1:
dependencies:
escape-goat "^2.0.0"
[email protected]:
- version "19.3.0"
- resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-19.3.0.tgz#deba854f3dd3f74a04db200274827a67e200f39e"
- integrity sha512-P8VAAOBnBJo/7DKJnj1b0K9kZBF2D8lkdL94CjJ+DZKCp182LQqYemPI9omUSZkh4bgykzXjZhaVR1qtddTTQg==
[email protected]:
+ version "19.4.0"
+ resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-19.4.0.tgz#3f52945d8cfa20cf8721a7902afcd8a1a299b54d"
+ integrity sha512-gG/jxseleZStinBn86x8r7trjcE4jcjx1hIQWOpACQhquHYMuKnrWxkzg+EDn8sN3wUtF/Ry9mtJgjM49oUOFQ==
dependencies:
cross-fetch "3.1.5"
debug "4.3.4"
- devtools-protocol "0.0.1056733"
+ devtools-protocol "0.0.1068969"
extract-zip "2.0.1"
https-proxy-agent "5.0.1"
proxy-from-env "1.1.0"
@@ -11479,17 +11473,17 @@ [email protected]:
debug "^4.1.1"
deepmerge "^4.2.2"
[email protected]:
- version "19.3.0"
- resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-19.3.0.tgz#defa8b6a6401b23cdc4f634c441b55d61f6b3d65"
- integrity sha512-WJbi/ULaeuFOz7cfMgJlJCBAZiyqIFeQ6os4h5ex3PVTt2qosXgwI9eruFZqFAwJRv8x5pOuMhWR0aSRgyDqEg==
[email protected]:
+ version "19.4.0"
+ resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-19.4.0.tgz#3adfcb415e96d7b5900a66a1097947272313ee9f"
+ integrity sha512-sRzWEfFSZCCcFUJflGtYI2V7A6qK4Jht+2JiI2LZgn+Nv/LOZZsBDEaGl98ZrS8oEcUA5on4p2yJbE0nzHNzIg==
dependencies:
- cosmiconfig "7.0.1"
- devtools-protocol "0.0.1056733"
+ cosmiconfig "8.0.0"
+ devtools-protocol "0.0.1068969"
https-proxy-agent "5.0.1"
progress "2.0.3"
proxy-from-env "1.1.0"
- puppeteer-core "19.3.0"
+ puppeteer-core "19.4.0"
q@^1.1.2:
version "1.5.1"
@@ -14721,11 +14715,6 @@ yaml-eslint-parser@^1.1.0:
lodash "^4.17.21"
yaml "^2.0.0"
-yaml@^1.10.0:
- version "1.10.2"
- resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
- integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
-
yaml@^2.0.0:
version "2.1.3"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.3.tgz#9b3a4c8aff9821b696275c79a8bee8399d945207"
|
d17914c8c52523dfe84a506e57dfc081272dc93a
|
2020-10-29 20:46:03
|
dependabot-preview[bot]
|
chore(deps): bump @sentry/node from 5.27.1 to 5.27.2
| false
|
bump @sentry/node from 5.27.1 to 5.27.2
|
chore
|
diff --git a/package.json b/package.json
index cfb56a1b82eecf..d15bdd20b75637 100644
--- a/package.json
+++ b/package.json
@@ -66,7 +66,7 @@
"dependencies": {
"@koa/router": "9.4.0",
"@postlight/mercury-parser": "2.2.0",
- "@sentry/node": "5.27.1",
+ "@sentry/node": "5.27.2",
"aes-js": "3.1.2",
"art-template": "4.13.2",
"cheerio": "1.0.0-rc.3",
diff --git a/yarn.lock b/yarn.lock
index 42ec7db30f40e4..305ed576098bc0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1345,72 +1345,72 @@
dependencies:
safe-buffer "^5.0.1"
-"@sentry/[email protected]":
- version "5.27.1"
- resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.27.1.tgz#489604054d821e1de155f80fe650085b37cad235"
- integrity sha512-n5CxzMbOAT6HZK4U4cOUAAikkRnnHhMNhInrjfZh7BoiuX1k63Hru2H5xk5WDuEaTTr5RaBA/fqPl7wxHySlwQ==
- dependencies:
- "@sentry/hub" "5.27.1"
- "@sentry/minimal" "5.27.1"
- "@sentry/types" "5.27.1"
- "@sentry/utils" "5.27.1"
+"@sentry/[email protected]":
+ version "5.27.2"
+ resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.27.2.tgz#94d62364e3d0bf9d0b9b891699ad35d31cd69da3"
+ integrity sha512-FMX0Aignhi9Rk4tZkjwSXCsFFQc8FIOgUTvfIKCdayLhKxfbY0H37b0fFNzaQ9v15SFzIZJ9uzw4PTmjzEh6Uw==
+ dependencies:
+ "@sentry/hub" "5.27.2"
+ "@sentry/minimal" "5.27.2"
+ "@sentry/types" "5.27.2"
+ "@sentry/utils" "5.27.2"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "5.27.1"
- resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.27.1.tgz#c95faaf18257c365acc09246fafd27276bfd6a2f"
- integrity sha512-RBHo3T92s6s4Ian1pZcPlmNtFqB+HAP6xitU+ZNA48bYUK+R1vvqEcI8Xs83FyNaRGCgclp9erDFQYyAuxY4vw==
+"@sentry/[email protected]":
+ version "5.27.2"
+ resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.27.2.tgz#06923e0b7b5e96cd2cd8b1d44cb83dbd8b8eed26"
+ integrity sha512-KCAWF5oDXd/Pjzbcmfj53F5ZzOX53Rzi23a2mWyUXMdPXoXIiMrIcdC/DqrqKV787LvOJcSFaTychJCH3t15/A==
dependencies:
- "@sentry/types" "5.27.1"
- "@sentry/utils" "5.27.1"
+ "@sentry/types" "5.27.2"
+ "@sentry/utils" "5.27.2"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "5.27.1"
- resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.27.1.tgz#d6ce881ba3c262db29520177a4c1f0e0f5388697"
- integrity sha512-MHXCeJdA1NAvaJuippcM8nrWScul8iTN0Q5nnFkGctGIGmmiZHTXAYkObqJk7H3AK+CP7r1jqN2aQj5Nd9CtyA==
+"@sentry/[email protected]":
+ version "5.27.2"
+ resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.27.2.tgz#c9b90d71383891e69f4abecf32fdba9d91d3328a"
+ integrity sha512-n9SssI30rpS1tw6hH0ylxVlONdmZCqiPy60fotxUzql6mCo/nW7tcADsW15fvQlUQ160VaGf3iMj+hpHkRBerw==
dependencies:
- "@sentry/hub" "5.27.1"
- "@sentry/types" "5.27.1"
+ "@sentry/hub" "5.27.2"
+ "@sentry/types" "5.27.2"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "5.27.1"
- resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.27.1.tgz#17f94e46a42ebdec41996c4783714a64b8d74774"
- integrity sha512-OJCpUK6bbWlDCqiTZVP4ybQQDSly2EafbvvO7hoQ5ktr87WkRCgLpTNI7Doa5ANGuLNnVUvRNIsIH1DJqLZLNg==
+"@sentry/[email protected]":
+ version "5.27.2"
+ resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.27.2.tgz#50f98d5b812460e97a7b3f2c25b29925b0507fab"
+ integrity sha512-JHY+EYjq3iqVnTPIow7KzKX+lIqJXZGVT0xHdPrhaVcfBtUUBYTpjO7SSCkINPt6dPKVRq0QDzIfevd5nybR7A==
dependencies:
- "@sentry/core" "5.27.1"
- "@sentry/hub" "5.27.1"
- "@sentry/tracing" "5.27.1"
- "@sentry/types" "5.27.1"
- "@sentry/utils" "5.27.1"
+ "@sentry/core" "5.27.2"
+ "@sentry/hub" "5.27.2"
+ "@sentry/tracing" "5.27.2"
+ "@sentry/types" "5.27.2"
+ "@sentry/utils" "5.27.2"
cookie "^0.4.1"
https-proxy-agent "^5.0.0"
lru_map "^0.3.3"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "5.27.1"
- resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.27.1.tgz#198cd97514363369d29eef9b597be9332ab170c4"
- integrity sha512-GBmdR8Ky/nv4KOa6+DEnOSBkFOFhM+asR8Y/gw2qSUWCwzKuWHh9BEnDwxtSI8CMvgUwOIZ5wiiqJGc1unYfCw==
+"@sentry/[email protected]":
+ version "5.27.2"
+ resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.27.2.tgz#a87bed1d96dacdb443894732abb5828e950b14ed"
+ integrity sha512-5Lptd32VtKBzIzTmFqcKgcetTMRraMvjPFTX8kFVX4aGDaUGOx0cCZeAURNoHDfHfjCazYK8yV6BkJfi6YJNww==
dependencies:
- "@sentry/hub" "5.27.1"
- "@sentry/minimal" "5.27.1"
- "@sentry/types" "5.27.1"
- "@sentry/utils" "5.27.1"
+ "@sentry/hub" "5.27.2"
+ "@sentry/minimal" "5.27.2"
+ "@sentry/types" "5.27.2"
+ "@sentry/utils" "5.27.2"
tslib "^1.9.3"
-"@sentry/[email protected]":
- version "5.27.1"
- resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.27.1.tgz#031480a4cf8f0b6e6337fb03ee884deedcef6f40"
- integrity sha512-g1aX0V0fz5BTo0mjgSVY9XmPLGZ6p+8OEzq3ubKzDUf59VHl+Vt8viZ8VXw/vsNtfAjBHn7BzSuzJo7cXJJBtA==
+"@sentry/[email protected]":
+ version "5.27.2"
+ resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.27.2.tgz#606e973cee865e83e75491e33e9b2732a0f79c94"
+ integrity sha512-oszEOlWJuySvGc2HJ2KLTgtYwRFnHWDu8YIZ99UhmO2PcGQ5HlZJpV2oC8n3x0g1YSSlAaThjKbliJEAT7fmPg==
-"@sentry/[email protected]":
- version "5.27.1"
- resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.27.1.tgz#0ed9d9685aae6f4ef9eb6b9ebb81e361fd1c5452"
- integrity sha512-VIzK8utuvFO9EogZcKJPgmLnlJtYbaPQ0jCw7od9HRw1ckrSBc84sA0uuuY6pB6KSM+7k6EjJ5IdIBaCz5ep/A==
+"@sentry/[email protected]":
+ version "5.27.2"
+ resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.27.2.tgz#9d52a2ad73aaab41c45202c289c4a63127ce4ebb"
+ integrity sha512-ZrdRgcFapi1NACbtvnPLOIXKjBPVTlhGzmXNCVao0uRBBRNJa5i2Mjp/U/Xy/fT0K1MGJQ+F9YZjZPnAMsDNbw==
dependencies:
- "@sentry/types" "5.27.1"
+ "@sentry/types" "5.27.2"
tslib "^1.9.3"
"@sindresorhus/is@^0.14.0":
|
2949bb4f21e7662555d5a979fec131f413d936b3
|
2022-02-14 18:55:43
|
Ethan Shen
|
fix(route): 龙空 (#9096)
| false
|
龙空 (#9096)
|
fix
|
diff --git a/docs/bbs.md b/docs/bbs.md
index e01c0efd6cae8d..2955d34c14aeeb 100644
--- a/docs/bbs.md
+++ b/docs/bbs.md
@@ -504,11 +504,11 @@ pageClass: routes
### 分区
-<Route author="ma6254" example="/lkong/forum/60" path="/lkong/forum/:id/:digest?" :paramsDesc="['分区 id, 可在分区的URL里找到','默认获取全部主题,任意值则只获取精华主题']"/>
+<Route author="ma6254 nczitzk" example="/lkong/forum/60" path="/lkong/forum/:id/:digest?" :paramsDesc="['分区 id, 可在分区的URL里找到','默认获取全部主题,任意值则只获取精华主题']"/>
### 帖子
-<Route author="ma6254" example="/lkong/thread/2356933" path="/lkong/thread/:id?" :paramsDesc="['帖子 id, 可在帖子的URL里找到']"/>
+<Route author="ma6254 nczitzk" example="/lkong/thread/2356933" path="/lkong/thread/:id?" :paramsDesc="['帖子 id, 可在帖子的URL里找到']"/>
## 龙腾网
diff --git a/lib/router.js b/lib/router.js
index 16312dd531c0e0..07ccad7528fda5 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -1954,8 +1954,8 @@ router.get('/yidoutang/case/:type', lazyloadRouteHandler('./routes/yidoutang/cas
router.get('/kaiyan/index', lazyloadRouteHandler('./routes/kaiyan/index'));
// 龙空
-router.get('/lkong/forum/:id/:digest?', lazyloadRouteHandler('./routes/lkong/forum'));
-router.get('/lkong/thread/:id', lazyloadRouteHandler('./routes/lkong/thread'));
+// router.get('/lkong/forum/:id/:digest?', lazyloadRouteHandler('./routes/lkong/forum'));
+// router.get('/lkong/thread/:id', lazyloadRouteHandler('./routes/lkong/thread'));
// router.get('/lkong/user/:id', lazyloadRouteHandler('./routes/lkong/user'));
// 坂道系列资讯
diff --git a/lib/routes/lkong/forum.js b/lib/routes/lkong/forum.js
deleted file mode 100644
index b3b3a4a70091f8..00000000000000
--- a/lib/routes/lkong/forum.js
+++ /dev/null
@@ -1,75 +0,0 @@
-const got = require('@/utils/got');
-
-module.exports = async (ctx) => {
- const id = ctx.params.id;
- const type_path = ctx.params.digest ? '/digest' : '';
- const type_name = ctx.params.digest ? ' 精华' : '';
-
- const response = await got({
- method: 'get',
- url: `http://lkong.cn/forum/index.php?mod=ajax&action=forumconfig_${id}`,
- });
- const forumconfig = response.data;
-
- const response_forum_item = await got({
- method: 'get',
- url: `http://lkong.cn/forum/index.php?mod=data&sars=forum/${id}${type_path}`,
- });
-
- const data = response_forum_item.data;
-
- const items = await Promise.all(
- data.data.map(async (i) => {
- const item = {
- title: i.subject,
- pubDate: new Date(i.dateline + ' +8').toUTCString(),
- };
- if (i.id.startsWith('thread_')) {
- const thread_id = i.id.substr('thread_'.length);
-
- const thread_list_url = `http://lkong.cn/thread/index.php?mod=data&sars=thread/${thread_id}`;
- const thread_config_url = `http://lkong.cn/forum/index.php?mod=ajax&action=threadconfig_${thread_id}`;
- let thread_list;
- let thread_config;
-
- const cache = await ctx.cache.get(thread_list_url);
- if (cache) {
- thread_list = JSON.parse(cache);
- } else {
- const response_thread_list = await got({
- method: 'get',
- url: thread_list_url,
- });
- thread_list = response_thread_list.data;
- ctx.cache.set(thread_list_url, JSON.stringify(thread_list));
- }
-
- const cache1 = await ctx.cache.get(thread_config_url);
- if (cache1) {
- thread_config = JSON.parse(cache1);
- } else {
- const response_thread_config = await got({
- method: 'get',
- url: thread_config_url,
- });
- thread_config = response_thread_config.data;
- ctx.cache.set(thread_config_url, JSON.stringify(thread_config));
- }
-
- item.link = `http://lkong.cn/thread/${thread_id}`;
- item.description = thread_list.data[0].message;
- item.title = thread_config.subject;
- }
-
- return item;
- })
- );
-
- ctx.state.data = {
- title: `龙空 ${forumconfig.name}${type_name}`,
- link: `http://lkong.cn/forum/${id}${type_path}`,
- description: forumconfig.blackboard,
- image: `http://img.lkong.cn/forumavatar/000/00/00/${id}_avatar_middle.jpg`,
- item: items,
- };
-};
diff --git a/lib/routes/lkong/thread.js b/lib/routes/lkong/thread.js
deleted file mode 100644
index 0d734684decf03..00000000000000
--- a/lib/routes/lkong/thread.js
+++ /dev/null
@@ -1,56 +0,0 @@
-const got = require('@/utils/got');
-
-module.exports = async (ctx) => {
- const id = ctx.params.id;
-
- const response_thread_config = await got({
- method: 'get',
- url: `http://lkong.cn/forum/index.php?mod=ajax&action=threadconfig_${id}`,
- });
- const threadConfig = response_thread_config.data;
- function* genPage(i) {
- for (let a = 0; a < i; a++) {
- yield a + 1;
- }
- }
-
- const thread_item = await Promise.all(
- [...genPage(threadConfig.replies / 20)].map(async (page) => {
- const thread_page_url = `http://lkong.cn/forum/index.php?mod=data&sars=thread/${id}/${page}`;
- let thread_page;
-
- const cache = await ctx.cache.get(thread_page_url);
- if (cache) {
- thread_page = JSON.parse(cache);
- } else {
- const response = await got({
- method: 'get',
- url: `http://lkong.cn/forum/index.php?mod=data&sars=thread/${id}/${page}`,
- });
- thread_page = response.data;
- ctx.cache.set(thread_page_url, JSON.stringify(thread_page));
- }
-
- const new_item = thread_page.data.map((i) => ({
- title: `${i.lou}楼`,
- pubDate: new Date(i.dateline + ' +8').toUTCString(),
- author: i.author,
- description: i.message,
- link: `http://lkong.cn/thread/${id}/${page}.p_${i.pid}`,
- }));
- return new_item;
- })
- );
-
- const thread_items = [];
- thread_item.forEach((page_item) => {
- page_item.forEach((item) => {
- thread_items.push(item);
- });
- });
- ctx.state.data = {
- title: `龙空 ${threadConfig.forumname} ${threadConfig.subject}`,
- link: `http://lkong.cn/thread/${id}`,
- item: thread_items,
- };
-};
diff --git a/lib/v2/lkong/forum.js b/lib/v2/lkong/forum.js
new file mode 100644
index 00000000000000..4095d64df25e0f
--- /dev/null
+++ b/lib/v2/lkong/forum.js
@@ -0,0 +1,54 @@
+const got = require('@/utils/got');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+const { viewForum, viewThread } = require('./query');
+
+module.exports = async (ctx) => {
+ const id = ctx.params.id ?? '8';
+ const digest = ctx.params.digest;
+
+ const rootUrl = 'https://www.lkong.com';
+ const apiUrl = 'https://api.lkong.com/api';
+ const currentUrl = `${rootUrl}/forum/${id}`;
+
+ const response = await got({
+ method: 'post',
+ url: apiUrl,
+ json: viewForum(id),
+ });
+
+ let items = response.data.data[digest ? 'hots' : 'threads'].map((item) => ({
+ guid: item.tid,
+ title: item.title,
+ link: `${rootUrl}/thread/${item.tid}`,
+ }));
+
+ items = await Promise.all(
+ items.map((item) =>
+ ctx.cache.tryGet(item.link, async () => {
+ const detailResponse = await got({
+ method: 'post',
+ url: apiUrl,
+ json: viewThread(item.guid, 1),
+ });
+
+ item.author = detailResponse.data.data.thread.author.name;
+ item.pubDate = parseDate(detailResponse.data.data.thread.dateline);
+ item.description = art(path.join(__dirname, 'templates/content.art'), {
+ content: JSON.parse(detailResponse.data.data.posts[0].content),
+ });
+
+ return item;
+ })
+ )
+ );
+
+ ctx.state.data = {
+ title: `${response.data.data.forum.name} - 龙空`,
+ link: currentUrl,
+ item: items,
+ description: response.data.data.forumCount.info,
+ };
+};
diff --git a/lib/v2/lkong/maintainer.js b/lib/v2/lkong/maintainer.js
new file mode 100644
index 00000000000000..4e54f0c5ca0400
--- /dev/null
+++ b/lib/v2/lkong/maintainer.js
@@ -0,0 +1,4 @@
+module.exports = {
+ '/forum/:id?/:digest?': ['nczitzk', 'ma6254'],
+ '/thread/:id': ['nczitzk', 'ma6254'],
+};
diff --git a/lib/v2/lkong/query.js b/lib/v2/lkong/query.js
new file mode 100644
index 00000000000000..03305463f176af
--- /dev/null
+++ b/lib/v2/lkong/query.js
@@ -0,0 +1,82 @@
+module.exports = {
+ viewForum: (id) => ({
+ operationName: 'ViewForum',
+ query:
+ 'query ViewForum($fid: Int!, $page: Int, $action: String) {' +
+ ' forum(fid: $fid) {' +
+ ' name' +
+ ' }' +
+ ' forumCount(fid: $fid) {' +
+ ' info' +
+ ' }' +
+ ' hots: threadsFragment(fid: $fid, type: "hot") {' +
+ ' tid' +
+ ' title' +
+ ' }' +
+ ' threads(fid: $fid, action: $action, page: $page) {' +
+ ' ...threadComponent' +
+ ' }' +
+ '}' +
+ '' +
+ 'fragment threadComponent on Thread {' +
+ ' tid' +
+ ' title' +
+ '}',
+ variables: {
+ fid: parseInt(id),
+ },
+ }),
+ viewThread: (id, page) => ({
+ operationName: 'ViewThread',
+ query:
+ 'query ViewThread($tid: Int!, $page: Int, $pid: String, $authorid: Int) {' +
+ ' thread(tid: $tid, authorid: $authorid, pid: $pid) {' +
+ ' ...threadComponent' +
+ ' }' +
+ ' ...repliesComponent' +
+ '}' +
+ '' +
+ 'fragment threadComponent on Thread {' +
+ ' tid' +
+ ' title' +
+ ' dateline' +
+ ' author {' +
+ ' name' +
+ ' }' +
+ ' replies' +
+ ' tags {' +
+ ' name' +
+ ' }' +
+ '}' +
+ '' +
+ 'fragment repliesComponent on Query {' +
+ ' posts(tid: $tid, page: $page, pid: $pid, authorid: $authorid) {' +
+ ' lou' +
+ ' pid' +
+ ' content' +
+ ' quote {' +
+ ' author {' +
+ ' name' +
+ ' }' +
+ ' pid' +
+ ' content' +
+ ' }' +
+ ' dateline' +
+ ' user {' +
+ ' name' +
+ ' }' +
+ ' }' +
+ '}',
+ variables: {
+ tid: parseInt(id),
+ page,
+ },
+ }),
+ countReplies: (id) => ({
+ operationName: 'ViewThread',
+ query: 'query ViewThread($tid: Int!){thread(tid: $tid){...threadComponent}}fragment threadComponent on Thread{replies}',
+ variables: {
+ tid: parseInt(id),
+ },
+ }),
+};
diff --git a/lib/v2/lkong/radar.js b/lib/v2/lkong/radar.js
new file mode 100644
index 00000000000000..5fb6152450f533
--- /dev/null
+++ b/lib/v2/lkong/radar.js
@@ -0,0 +1,19 @@
+module.exports = {
+ 'lkong.com': {
+ _name: '龙空',
+ '.': [
+ {
+ title: '分区',
+ docs: 'https://docs.rsshub.app/bbs.html#long-kong-fen-qu',
+ source: ['/forum/:id', '/'],
+ target: '/lkong/forum/:id?/:digest?',
+ },
+ {
+ title: '帖子',
+ docs: 'https://docs.rsshub.app/bbs.html#long-kong-tie-zi',
+ source: ['/thread/:id', '/'],
+ target: '/lkong/thread/:id',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/lkong/router.js b/lib/v2/lkong/router.js
new file mode 100644
index 00000000000000..f2ff5ffda9fad6
--- /dev/null
+++ b/lib/v2/lkong/router.js
@@ -0,0 +1,4 @@
+module.exports = function (router) {
+ router.get('/forum/:id?/:digest?', require('./forum'));
+ router.get('/thread/:id', require('./thread'));
+};
diff --git a/lib/v2/lkong/templates/content.art b/lib/v2/lkong/templates/content.art
new file mode 100644
index 00000000000000..fddcdfd7f14794
--- /dev/null
+++ b/lib/v2/lkong/templates/content.art
@@ -0,0 +1,18 @@
+{{ each content paragraph }}
+{{ if paragraph.type == 'paragraph' }}
+<p>
+{{ each paragraph.children child }}
+{{ if child.text }}
+<span {{ if child.color }}style="color: {{ child.color }}"{{ /if }}>
+{{ if child.bold }}<strong>{{ /if }}
+{{ child.text }}
+{{ if child.bold }}</strong>{{ /if }}
+</span>
+{{ /if }}
+{{ if child.type == 'emotion' }}
+<img src="https://image.lkong.com/bq/em{{ child.id }}.gif">
+{{ /if }}
+{{ /each }}
+</p>
+{{ /if }}
+{{ /each }}
\ No newline at end of file
diff --git a/lib/v2/lkong/templates/quote.art b/lib/v2/lkong/templates/quote.art
new file mode 100644
index 00000000000000..9d4f34a8c950f1
--- /dev/null
+++ b/lib/v2/lkong/templates/quote.art
@@ -0,0 +1,23 @@
+<div class="quote">
+<a href="{{ target }}" class="quote-link">
+<svg xmlns="http://www.w3.org/2000/svg" width="13.16" height="12" viewBox="0 0 13.16 12" class="css-1f5j0lz"><path d="M5.71,0,0,5l5.71,5V6.57S13.63,4,12,12c0,0,5.11-9.71-6.42-9L5.71,0Z"></path></svg>
+{{ author }}</a>:
+{{@ content }}
+</div>
+
+<style>
+.quote {
+ margin: 15px 0px 15px;
+ width: 100%;
+ border: 1px solid #eee;
+ background-color: #f5f5f5;
+ border-radius: 4px;
+ padding: 8px 14px;
+ cursor: pointer;
+}
+
+.quote-link {
+ color: #1890ff;
+ text-decoration: none;
+}
+</style>
\ No newline at end of file
diff --git a/lib/v2/lkong/thread.js b/lib/v2/lkong/thread.js
new file mode 100644
index 00000000000000..6ad38d26158898
--- /dev/null
+++ b/lib/v2/lkong/thread.js
@@ -0,0 +1,57 @@
+const got = require('@/utils/got');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+const { viewThread, countReplies } = require('./query');
+
+module.exports = async (ctx) => {
+ const id = ctx.params.id;
+
+ const rootUrl = 'https://www.lkong.com';
+ const apiUrl = 'https://api.lkong.com/api';
+ const currentUrl = `${rootUrl}/thread/${id}`;
+
+ const countResponse = await got({
+ method: 'post',
+ url: apiUrl,
+ json: countReplies(id),
+ });
+
+ if (countResponse.data.errors) {
+ throw Error(countResponse.data.errors[0].message);
+ }
+
+ const response = await got({
+ method: 'post',
+ url: apiUrl,
+ json: viewThread(id, Math.ceil(countResponse.data.data.thread.replies / 20)),
+ });
+
+ const items = response.data.data.posts.map((item) => ({
+ guid: item.pid,
+ author: item.user.name,
+ title: `#${item.lou} ${item.user.name}`,
+ link: `${rootUrl}/thread/${id}?pid=${item.pid}`,
+ pubDate: parseDate(item.dateline),
+ description:
+ (item.quote
+ ? art(path.join(__dirname, 'templates/quote.art'), {
+ target: `${rootUrl}/thread/${id}?pid=${item.quote.pid}`,
+ author: item.quote.author.name,
+ content: art(path.join(__dirname, 'templates/content.art'), {
+ content: JSON.parse(item.quote.content),
+ }),
+ })
+ : '') +
+ art(path.join(__dirname, 'templates/content.art'), {
+ content: JSON.parse(item.content),
+ }),
+ }));
+
+ ctx.state.data = {
+ title: `${response.data.data.thread.title} - 龙空`,
+ link: currentUrl,
+ item: items,
+ };
+};
|
759694cd8c10f0d90384068cf44390a32f423c31
|
2021-02-15 15:40:59
|
dependabot-preview[bot]
|
chore(deps): bump chrono-node from 2.2.0 to 2.2.1
| false
|
bump chrono-node from 2.2.0 to 2.2.1
|
chore
|
diff --git a/package.json b/package.json
index f71d019821c6f9..f00d1ece82f373 100644
--- a/package.json
+++ b/package.json
@@ -71,7 +71,7 @@
"art-template": "4.13.2",
"bbcodejs": "0.0.4",
"cheerio": "1.0.0-rc.3",
- "chrono-node": "2.2.0",
+ "chrono-node": "2.2.1",
"crypto-js": "4.0.0",
"currency-symbol-map": "4.0.4",
"dayjs": "1.10.3",
diff --git a/yarn.lock b/yarn.lock
index b898a3a02f536a..bc8030a6383c04 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3479,10 +3479,10 @@ chrome-trace-event@^1.0.0:
dependencies:
tslib "^1.9.0"
[email protected]:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/chrono-node/-/chrono-node-2.2.0.tgz#4da0d859e4fa936dd1985ab67165a963faffa113"
- integrity sha512-pUqcosaEJDiSB5vgb1gieZl05smyUs9lR/0v5IVwZW2EbWfRKSi3YvjK1fWcCi02BYAio/ukeOUF4+PJM7Baiw==
[email protected]:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/chrono-node/-/chrono-node-2.2.1.tgz#6591c95724011fd7cadd8ae394bacb5004357bf2"
+ integrity sha512-Cdw4LxAlVb3BbfoAIw50v8MhVmFGBzzvTpQUO3F5ezyo/MnZ3db3G73cHNE2aiNsAhK9qpg39RpUl6jxTIUGeA==
dependencies:
dayjs "^1.10.0"
|
044399a44f13eb8028b1c4c6604c070ca409b68f
|
2025-03-11 15:29:57
|
dependabot[bot]
|
chore(deps): bump @scalar/hono-api-reference from 0.5.183 to 0.5.184 (#18564)
| false
|
bump @scalar/hono-api-reference from 0.5.183 to 0.5.184 (#18564)
|
chore
|
diff --git a/package.json b/package.json
index 9e6a18e51335af..36d5a807ef3ddc 100644
--- a/package.json
+++ b/package.json
@@ -64,7 +64,7 @@
"@opentelemetry/semantic-conventions": "1.30.0",
"@postlight/parser": "2.2.3",
"@rss3/sdk": "0.0.25",
- "@scalar/hono-api-reference": "0.5.183",
+ "@scalar/hono-api-reference": "0.5.184",
"@sentry/node": "9.5.0",
"@tonyrl/rand-user-agent": "2.0.83",
"aes-js": "3.1.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4b70108b3f2af5..cfa2ad305dd517 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -59,8 +59,8 @@ importers:
specifier: 0.0.25
version: 0.0.25
'@scalar/hono-api-reference':
- specifier: 0.5.183
- version: 0.5.183([email protected])
+ specifier: 0.5.184
+ version: 0.5.184([email protected])
'@sentry/node':
specifier: 9.5.0
version: 9.5.0
@@ -2008,12 +2008,12 @@ packages:
'@rss3/[email protected]':
resolution: {integrity: sha512-jyXT4YTwefxxRZ0tt5xjbnw8e7zPg2OGdo/0xb+h/7qWnMNhLtWpc95DsYs/1C/I0rIyiDpZBhLI2DieQ9y+tw==}
- '@scalar/[email protected]':
- resolution: {integrity: sha512-LnszTA7JmdtmEX1qqhkIKTKFQiFstRYiDs0NrXdYtMk/WB55Bnoz0Lk8BWw1qC1NhMpP5It+PRYZke727Gxrbw==}
+ '@scalar/[email protected]':
+ resolution: {integrity: sha512-7qnZp8ykrXoKScFIZcwt638CuFFyj7G3SsgVfD5liNgb533K8/lhWqdmp1vK2u4BKKJ9GBAPKMlWZE/+yA8WTw==}
engines: {node: '>=18'}
- '@scalar/[email protected]':
- resolution: {integrity: sha512-rzWxFDjBW2VvMRAPqcwgkC+7ZMmBZZVIMFUejwjF+618jKvQ09ooVyBb9hUnW4KaUElUqx/iIFflLKf0A95iLA==}
+ '@scalar/[email protected]':
+ resolution: {integrity: sha512-vRSRwJkN1Xo5dW9KYQJlGpKZ+Nh9qH+x1sn0qf6/Lx8QLPyyEpNm1EEddKaIN6qd5wrtVjDN6adQhfAfcYGHzw==}
engines: {node: '>=18'}
peerDependencies:
hono: ^4.0.0
@@ -2022,8 +2022,8 @@ packages:
resolution: {integrity: sha512-HQQudOSQBU7ewzfnBW9LhDmBE2XOJgSfwrh5PlUB7zJup/kaRkBGNgV2wMjNz9Af/uztiU/xNrO179FysmUT+g==}
engines: {node: '>=18'}
- '@scalar/[email protected]':
- resolution: {integrity: sha512-oAMBWC5B0I8IViCuaV1ydoUAm7KJSwHZfCuLMea15tSKh0/wj9H1KQvDJF8gE/cUVwjQvj4q94GB22kBT4XGNQ==}
+ '@scalar/[email protected]':
+ resolution: {integrity: sha512-0J6o+yZzgZEvl3KhvLTAGiXXyrCeEPKvs9gUWQDf1Rb5NfFxF0lA10ougCQCwVJIguWNEzZfOUiSoAFzGy2EqQ==}
engines: {node: '>=18'}
'@sec-ant/[email protected]':
@@ -7773,18 +7773,18 @@ snapshots:
'@rss3/api-core': 0.0.25
'@rss3/api-utils': 0.0.25
- '@scalar/[email protected]':
+ '@scalar/[email protected]':
dependencies:
- '@scalar/types': 0.0.39
+ '@scalar/types': 0.0.40
- '@scalar/[email protected]([email protected])':
+ '@scalar/[email protected]([email protected])':
dependencies:
- '@scalar/core': 0.1.0
+ '@scalar/core': 0.1.1
hono: 4.7.4
'@scalar/[email protected]': {}
- '@scalar/[email protected]':
+ '@scalar/[email protected]':
dependencies:
'@scalar/openapi-types': 0.1.9
'@unhead/schema': 1.11.20
|
9461e2eb5c50bc47c3b69532f0d5140cd35fadf5
|
2020-06-07 20:27:24
|
hoilc
|
feat: add sspai activity pubDate (#4931)
| false
|
add sspai activity pubDate (#4931)
|
feat
|
diff --git a/lib/routes/sspai/activity.js b/lib/routes/sspai/activity.js
index ea6932749b4be3..fd11e303209146 100644
--- a/lib/routes/sspai/activity.js
+++ b/lib/routes/sspai/activity.js
@@ -75,6 +75,7 @@ module.exports = async (ctx) => {
title: item_title,
description: item_desc,
link: item_url,
+ pubDate: new Date(item.created_at * 1000),
};
}),
};
|
2c2913bd57a9c91d33d4884002eb261cd05227ea
|
2024-11-05 20:32:26
|
CaoMeiYouRen
|
fix(route): 修复 bilibili UP 主动态/用户关注动态 开启内嵌视频 参数错误的问题 (#17462)
| false
|
修复 bilibili UP 主动态/用户关注动态 开启内嵌视频 参数错误的问题 (#17462)
|
fix
|
diff --git a/lib/routes/bilibili/dynamic.ts b/lib/routes/bilibili/dynamic.ts
index cd1ffb353179f5..be3c3e8d797412 100644
--- a/lib/routes/bilibili/dynamic.ts
+++ b/lib/routes/bilibili/dynamic.ts
@@ -19,7 +19,7 @@ export const route: Route = {
| 键 | 含义 | 接受的值 | 默认值 |
| ---------- | --------------------------------- | -------------- | ------ |
| showEmoji | 显示或隐藏表情图片 | 0/1/true/false | false |
-| embed | 默认开启内嵌视频 | 任意值 | |
+| embed | 默认开启内嵌视频 | 0/1/true/false | true |
| useAvid | 视频链接使用 AV 号 (默认为 BV 号) | 0/1/true/false | false |
| directLink | 使用内容直链 | 0/1/true/false | false |
| hideGoods | 隐藏带货动态 | 0/1/true/false | false |
@@ -230,7 +230,7 @@ async function handler(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);
- const embed = !ctx.req.param('embed');
+ const embed = fallback(undefined, queryToBoolean(routeParams.embed), true);
const displayArticle = ctx.req.query('mode') === 'fulltext';
const useAvid = fallback(undefined, queryToBoolean(routeParams.useAvid), false);
const directLink = fallback(undefined, queryToBoolean(routeParams.directLink), false);
@@ -259,7 +259,12 @@ async function handler(ctx) {
const rssItems = await Promise.all(
items
- .filter((item) => !hideGoods || item.modules.module_dynamic?.additional?.type !== 'ADDITIONAL_TYPE_GOODS')
+ .filter((item) => {
+ if (hideGoods) {
+ return item.modules.module_dynamic?.additional?.type !== 'ADDITIONAL_TYPE_GOODS';
+ }
+ return true;
+ })
.map(async (item) => {
// const parsed = JSONbig.parse(item.card);
diff --git a/lib/routes/bilibili/followings-dynamic.ts b/lib/routes/bilibili/followings-dynamic.ts
index f1a22c56b5a37c..4b6e953e6b2914 100644
--- a/lib/routes/bilibili/followings-dynamic.ts
+++ b/lib/routes/bilibili/followings-dynamic.ts
@@ -18,7 +18,7 @@ export const route: Route = {
| 键 | 含义 | 接受的值 | 默认值 |
| ---------- | --------------------------------- | -------------- | ------ |
| showEmoji | 显示或隐藏表情图片 | 0/1/true/false | false |
-| embed | 默认开启内嵌视频 | 任意值 | |
+| embed | 默认开启内嵌视频 | 0/1/true/false | true |
| useAvid | 视频链接使用 AV 号 (默认为 BV 号) | 0/1/true/false | false |
| directLink | 使用内容直链 | 0/1/true/false | false |
| hideGoods | 隐藏带货动态 | 0/1/true/false | false |
@@ -55,7 +55,7 @@ async function handler(ctx) {
const routeParams = querystring.parse(ctx.req.param('routeParams'));
const showEmoji = fallback(undefined, queryToBoolean(routeParams.showEmoji), false);
- const embed = !ctx.req.param('embed');
+ const embed = fallback(undefined, queryToBoolean(routeParams.embed), true);
const displayArticle = fallback(undefined, queryToBoolean(routeParams.displayArticle), false);
const name = await cache.getUsernameFromUID(uid);
|
64bf182e55c4bf522b30efabb98d46151b5c8bb9
|
2024-06-21 15:03:25
|
dependabot[bot]
|
chore(deps-dev): bump @types/uuid from 9.0.8 to 10.0.0 (#15960)
| false
|
bump @types/uuid from 9.0.8 to 10.0.0 (#15960)
|
chore
|
diff --git a/package.json b/package.json
index eafe01a99ff51f..c53f393aa8c22f 100644
--- a/package.json
+++ b/package.json
@@ -154,7 +154,7 @@
"@types/tiny-async-pool": "2.0.3",
"@types/title": "3.4.3",
"@types/tough-cookie": "4.0.5",
- "@types/uuid": "9.0.8",
+ "@types/uuid": "10.0.0",
"@typescript-eslint/eslint-plugin": "7.13.1",
"@typescript-eslint/parser": "7.13.1",
"@vercel/nft": "0.27.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 692709ce87f640..16b40ab872eee0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -316,8 +316,8 @@ importers:
specifier: 4.0.5
version: 4.0.5
'@types/uuid':
- specifier: 9.0.8
- version: 9.0.8
+ specifier: 10.0.0
+ version: 10.0.0
'@typescript-eslint/eslint-plugin':
specifier: 7.13.1
version: 7.13.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
@@ -1974,8 +1974,8 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==}
- '@types/[email protected]':
- resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==}
'@types/[email protected]':
resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==}
@@ -8751,7 +8751,7 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]': {}
+ '@types/[email protected]': {}
'@types/[email protected]': {}
|
50f1946e75a67a0b0b06c3927ed7901195e9d572
|
2022-06-05 18:58:45
|
Ethan Shen
|
fix(route): 综艺秀 (#9898)
| false
|
综艺秀 (#9898)
|
fix
|
diff --git a/assets/radar-rules.js b/assets/radar-rules.js
index d5f5fa733603d9..2175df969cbbb3 100644
--- a/assets/radar-rules.js
+++ b/assets/radar-rules.js
@@ -1026,7 +1026,7 @@
mob: [{ title: '分区', docs: 'https://docs.rsshub.app/game.html#lv-fa-shi-ying-di', source: '/fine/:tag', target: '/lfsyd/tag/:tag' }],
},
'macwk.com': { _name: 'MacWk', '.': [{ title: '应用更新', docs: 'https://docs.rsshub.app/program-update.html#macwk', source: '/soft/:name', target: '/macwk/soft/:name' }] },
- 'zyshow.net': { www: [{ title: '', docs: 'https://docs.rsshub.app/game.html#lv-fa-shi-ying-di', source: '/:name/', target: '/zyshow/:name' }] },
+ // 'zyshow.net': { www: [{ title: '', docs: 'https://docs.rsshub.app/game.html#lv-fa-shi-ying-di', source: '/:name/', target: '/zyshow/:name' }] },
'foreverblog.cn': {
_name: 'foreverblog',
www: [
diff --git a/docs/multimedia.md b/docs/multimedia.md
index 3572651890f6a7..ecdbd1a3f3f592 100644
--- a/docs/multimedia.md
+++ b/docs/multimedia.md
@@ -1608,8 +1608,16 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
</Route>
-## 综艺秀([www.zyshow.net)](http://www.zyshow.net))
+## 综艺秀
### 综艺
-<Route author="pharaoh2012" example="/zyshow/chongchongchong" path="/zyshow/:name" :paramsDesc="['综艺 name,对应综艺的 URL 中找到']" radar="1" rssbud="1"/>
+<Route author="pharaoh2012 nczitzk" example="/zyshow/chongchongchong" path="/zyshow/:region?/:id" :paramsDesc="['地区,见下表,默认为空,即台湾', '综艺 id,综艺详情对应页 URL 中找到']" radar="1" rssbud="1">
+
+地区
+
+| 台湾 | 韩国 | 大陆 |
+| -- | -- | -- |
+| | kr | dl |
+
+</Route>
diff --git a/lib/radar-rules.js b/lib/radar-rules.js
index 570756883fe2a6..1e4b4d312b4a9f 100644
--- a/lib/radar-rules.js
+++ b/lib/radar-rules.js
@@ -2133,14 +2133,4 @@ module.exports = {
},
],
},
- 'zyshow.net': {
- www: [
- {
- title: '',
- docs: 'https://docs.rsshub.app/game.html#lv-fa-shi-ying-di',
- source: '/:name/',
- target: '/zyshow/:name',
- },
- ],
- },
};
diff --git a/lib/router.js b/lib/router.js
index 5249a0834f8745..a88e7ba7d8a14f 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -3930,7 +3930,7 @@ router.get('/macau-bolsas/:lang?', lazyloadRouteHandler('./routes/macau-bolsas/i
router.get('/potplayer/update/:language?', lazyloadRouteHandler('./routes/potplayer/update'));
// 综艺秀
-router.get('/zyshow/:name', lazyloadRouteHandler('./routes/zyshow'));
+// router.get('/zyshow/:name', lazyloadRouteHandler('./routes/zyshow'));
// 加美财经
router.get('/caus/:category?', lazyloadRouteHandler('./routes/caus'));
diff --git a/lib/routes/zyshow/index.js b/lib/routes/zyshow/index.js
deleted file mode 100644
index 7d884aaedac874..00000000000000
--- a/lib/routes/zyshow/index.js
+++ /dev/null
@@ -1,42 +0,0 @@
-const got = require('@/utils/got');
-const cheerio = require('cheerio');
-
-module.exports = async (ctx) => {
- ctx.params.name = ctx.params.name || 'chongchongchong';
-
- const rootUrl = `http://www.zyshow.net`;
- const currentUrl = `${rootUrl}/${ctx.params.name}/`;
- const response = await got({
- method: 'get',
- url: currentUrl,
- });
-
- const $ = cheerio.load(response.data);
- const list = $('#event_detail table tr')
- .slice(1, 30)
- .map((_, tr) => {
- tr = $(tr);
- const link = tr.find('td a');
- const tds = tr.find('td');
- const name = $(tds[0]).html();
- const zt = $(tds[1]).text();
- const lb = $(tds[2]).text();
- const des = `<table><tr><td>播出日期:</td><td><b>${name}</b></td></tr>
- <tr><td>综艺节目主题:</td><td><b>${zt}</b></td></tr>
- <tr><td>综艺节目来宾:</td><td><b>${lb}</b></td></tr>
- </table>`;
- return {
- title: link.text(),
- link: `${rootUrl}/${link.attr('href')}`,
- description: des,
- author: link.text(),
- };
- })
- .get();
-
- ctx.state.data = {
- title: $('title').text(),
- link: currentUrl,
- item: list,
- };
-};
diff --git a/lib/v2/zyshow/index.js b/lib/v2/zyshow/index.js
new file mode 100644
index 00000000000000..9b61004d7f2470
--- /dev/null
+++ b/lib/v2/zyshow/index.js
@@ -0,0 +1,46 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+module.exports = async (ctx) => {
+ const rootUrl = 'http://www.zyshow.net';
+ const currentUrl = `${rootUrl}${ctx.path.replace(/\/$/, '')}/`;
+
+ const response = await got({
+ method: 'get',
+ url: currentUrl,
+ });
+
+ const $ = cheerio.load(response.data);
+
+ const items = $('table')
+ .last()
+ .find('tr td a img.icon-play')
+ .toArray()
+ .map((item) => {
+ item = $(item).parentsUntil('tbody');
+
+ const a = item.find('a[title]').first();
+ const guests = item.find('td').eq(2).text();
+
+ return {
+ title: a.text(),
+ link: `${currentUrl}v/${a.attr('href').split('/v/').pop()}`,
+ pubDate: parseDate(a.text().match(/(\d{8})$/)[1], 'YYYYMMDD'),
+ description: art(path.join(__dirname, 'templates/description.art'), {
+ date: item.find('td').first().text(),
+ subject: item.find('td').eq(1).text(),
+ guests,
+ }),
+ category: guests.split(/,|;/),
+ };
+ });
+
+ ctx.state.data = {
+ title: `综艺秀 - ${$('h2').text()}`,
+ link: currentUrl,
+ item: items,
+ };
+};
diff --git a/lib/v2/zyshow/maintainer.js b/lib/v2/zyshow/maintainer.js
new file mode 100644
index 00000000000000..356e1bd7609a25
--- /dev/null
+++ b/lib/v2/zyshow/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/:region?/:id': ['nczitzk'],
+};
diff --git a/lib/v2/zyshow/radar.js b/lib/v2/zyshow/radar.js
new file mode 100644
index 00000000000000..cc43dab5487330
--- /dev/null
+++ b/lib/v2/zyshow/radar.js
@@ -0,0 +1,17 @@
+module.exports = {
+ 'zyshow.net': {
+ _name: '综艺秀',
+ '.': [
+ {
+ title: '综艺',
+ docs: 'https://docs.rsshub.app/multimedia.html#zong-yi-xiu-zong-yi',
+ source: ['/:region/:id', '/:id', '/'],
+ target: (params, url) =>
+ `/zyshow/${new URL(url)
+ .toString()
+ .split(/zyshow\.net/)
+ .pop()}`,
+ },
+ ],
+ },
+};
diff --git a/lib/v2/zyshow/router.js b/lib/v2/zyshow/router.js
new file mode 100644
index 00000000000000..28f05970b99c47
--- /dev/null
+++ b/lib/v2/zyshow/router.js
@@ -0,0 +1,3 @@
+module.exports = function (router) {
+ router.get(/([\w\d/-]+)?/, require('./index'));
+};
diff --git a/lib/v2/zyshow/templates/description.art b/lib/v2/zyshow/templates/description.art
new file mode 100644
index 00000000000000..3f330b2a4e1912
--- /dev/null
+++ b/lib/v2/zyshow/templates/description.art
@@ -0,0 +1,16 @@
+<table>
+ <tbody>
+ <tr>
+ <td>播出日期:</td>
+ <td><b><a href="{{ link }}">{{ date }}</a></b></td>
+ </tr>
+ <tr>
+ <td>节目主题:</td>
+ <td><b>{{ subject }}</b></td>
+ </tr>
+ <tr>
+ <td>节目来宾:</td>
+ <td><b>{{ guests }}</b></td>
+ </tr>
+ </tbody>
+</table>
\ No newline at end of file
|
41b31925be551888dfef4eaa1cdb97599ac13018
|
2020-10-03 05:00:37
|
Jonathan Goh
|
fix: solidot chain issue 导致抓取失败 (#5766)
| false
|
solidot chain issue 导致抓取失败 (#5766)
|
fix
|
diff --git a/lib/routes/solidot/_article.js b/lib/routes/solidot/_article.js
index 8d74e4ed6e9790..5b1088a6f6ff57 100644
--- a/lib/routes/solidot/_article.js
+++ b/lib/routes/solidot/_article.js
@@ -1,5 +1,7 @@
const got = require('@/utils/got'); // get web content
const cheerio = require('cheerio'); // html parser
+const fs = require('fs');
+const path = require('path');
const domain = 'https://www.solidot.org';
@@ -11,6 +13,10 @@ module.exports = async function get_article(url) {
method: 'get',
url: url,
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0',
+ https: {
+ certificateAuthority: [fs.readFileSync(path.resolve(__dirname, './wotrust.pem')), fs.readFileSync(path.resolve(__dirname, './sectigo.pem'))],
+ rejectUnauthorized: true,
+ },
});
const data = response.data;
const $ = cheerio.load(data);
diff --git a/lib/routes/solidot/main.js b/lib/routes/solidot/main.js
index 87432638cd5a1a..7f7535fcc590fc 100644
--- a/lib/routes/solidot/main.js
+++ b/lib/routes/solidot/main.js
@@ -5,6 +5,9 @@
const got = require('@/utils/got'); // get web content
const cheerio = require('cheerio'); // html parser
+const fs = require('fs');
+const path = require('path');
+
const get_article = require('./_article');
const base_url = 'https://$type$.solidot.org';
@@ -16,6 +19,10 @@ module.exports = async (ctx) => {
method: 'get',
url: list_url,
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0',
+ https: {
+ certificateAuthority: [fs.readFileSync(path.resolve(__dirname, './wotrust.pem')), fs.readFileSync(path.resolve(__dirname, './sectigo.pem'))],
+ rejectUnauthorized: true,
+ },
});
const data = response.data; // content is html format
const $ = cheerio.load(data);
diff --git a/lib/routes/solidot/sectigo.pem b/lib/routes/solidot/sectigo.pem
new file mode 100644
index 00000000000000..c40849bba846e6
--- /dev/null
+++ b/lib/routes/solidot/sectigo.pem
@@ -0,0 +1,122 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 4c:aa:f9:ca:db:63:6f:e0:1f:f7:4e:d8:5b:03:86:9d
+ Signature Algorithm: sha384WithRSAEncryption
+ Issuer: C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Certification Authority
+ Validity
+ Not Before: Jan 19 00:00:00 2010 GMT
+ Not After : Jan 18 23:59:59 2038 GMT
+ Subject: C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Certification Authority
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public-Key: (4096 bit)
+ Modulus:
+ 00:91:e8:54:92:d2:0a:56:b1:ac:0d:24:dd:c5:cf:
+ 44:67:74:99:2b:37:a3:7d:23:70:00:71:bc:53:df:
+ c4:fa:2a:12:8f:4b:7f:10:56:bd:9f:70:72:b7:61:
+ 7f:c9:4b:0f:17:a7:3d:e3:b0:04:61:ee:ff:11:97:
+ c7:f4:86:3e:0a:fa:3e:5c:f9:93:e6:34:7a:d9:14:
+ 6b:e7:9c:b3:85:a0:82:7a:76:af:71:90:d7:ec:fd:
+ 0d:fa:9c:6c:fa:df:b0:82:f4:14:7e:f9:be:c4:a6:
+ 2f:4f:7f:99:7f:b5:fc:67:43:72:bd:0c:00:d6:89:
+ eb:6b:2c:d3:ed:8f:98:1c:14:ab:7e:e5:e3:6e:fc:
+ d8:a8:e4:92:24:da:43:6b:62:b8:55:fd:ea:c1:bc:
+ 6c:b6:8b:f3:0e:8d:9a:e4:9b:6c:69:99:f8:78:48:
+ 30:45:d5:ad:e1:0d:3c:45:60:fc:32:96:51:27:bc:
+ 67:c3:ca:2e:b6:6b:ea:46:c7:c7:20:a0:b1:1f:65:
+ de:48:08:ba:a4:4e:a9:f2:83:46:37:84:eb:e8:cc:
+ 81:48:43:67:4e:72:2a:9b:5c:bd:4c:1b:28:8a:5c:
+ 22:7b:b4:ab:98:d9:ee:e0:51:83:c3:09:46:4e:6d:
+ 3e:99:fa:95:17:da:7c:33:57:41:3c:8d:51:ed:0b:
+ b6:5c:af:2c:63:1a:df:57:c8:3f:bc:e9:5d:c4:9b:
+ af:45:99:e2:a3:5a:24:b4:ba:a9:56:3d:cf:6f:aa:
+ ff:49:58:be:f0:a8:ff:f4:b8:ad:e9:37:fb:ba:b8:
+ f4:0b:3a:f9:e8:43:42:1e:89:d8:84:cb:13:f1:d9:
+ bb:e1:89:60:b8:8c:28:56:ac:14:1d:9c:0a:e7:71:
+ eb:cf:0e:dd:3d:a9:96:a1:48:bd:3c:f7:af:b5:0d:
+ 22:4c:c0:11:81:ec:56:3b:f6:d3:a2:e2:5b:b7:b2:
+ 04:22:52:95:80:93:69:e8:8e:4c:65:f1:91:03:2d:
+ 70:74:02:ea:8b:67:15:29:69:52:02:bb:d7:df:50:
+ 6a:55:46:bf:a0:a3:28:61:7f:70:d0:c3:a2:aa:2c:
+ 21:aa:47:ce:28:9c:06:45:76:bf:82:18:27:b4:d5:
+ ae:b4:cb:50:e6:6b:f4:4c:86:71:30:e9:a6:df:16:
+ 86:e0:d8:ff:40:dd:fb:d0:42:88:7f:a3:33:3a:2e:
+ 5c:1e:41:11:81:63:ce:18:71:6b:2b:ec:a6:8a:b7:
+ 31:5c:3a:6a:47:e0:c3:79:59:d6:20:1a:af:f2:6a:
+ 98:aa:72:bc:57:4a:d2:4b:9d:bb:10:fc:b0:4c:41:
+ e5:ed:1d:3d:5e:28:9d:9c:cc:bf:b3:51:da:a7:47:
+ e5:84:53
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4
+ X509v3 Key Usage: critical
+ Certificate Sign, CRL Sign
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha384WithRSAEncryption
+ 0a:f1:d5:46:84:b7:ae:51:bb:6c:b2:4d:41:14:00:93:4c:9c:
+ cb:e5:c0:54:cf:a0:25:8e:02:f9:fd:b0:a2:0d:f5:20:98:3c:
+ 13:2d:ac:56:a2:b0:d6:7e:11:92:e9:2e:ba:9e:2e:9a:72:b1:
+ bd:19:44:6c:61:35:a2:9a:b4:16:12:69:5a:8c:e1:d7:3e:a4:
+ 1a:e8:2f:03:f4:ae:61:1d:10:1b:2a:a4:8b:7a:c5:fe:05:a6:
+ e1:c0:d6:c8:fe:9e:ae:8f:2b:ba:3d:99:f8:d8:73:09:58:46:
+ 6e:a6:9c:f4:d7:27:d3:95:da:37:83:72:1c:d3:73:e0:a2:47:
+ 99:03:38:5d:d5:49:79:00:29:1c:c7:ec:9b:20:1c:07:24:69:
+ 57:78:b2:39:fc:3a:84:a0:b5:9c:7c:8d:bf:2e:93:62:27:b7:
+ 39:da:17:18:ae:bd:3c:09:68:ff:84:9b:3c:d5:d6:0b:03:e3:
+ 57:9e:14:f7:d1:eb:4f:c8:bd:87:23:b7:b6:49:43:79:85:5c:
+ ba:eb:92:0b:a1:c6:e8:68:a8:4c:16:b1:1a:99:0a:e8:53:2c:
+ 92:bb:a1:09:18:75:0c:65:a8:7b:cb:23:b7:1a:c2:28:85:c3:
+ 1b:ff:d0:2b:62:ef:a4:7b:09:91:98:67:8c:14:01:cd:68:06:
+ 6a:63:21:75:03:80:88:8a:6e:81:c6:85:f2:a9:a4:2d:e7:f4:
+ a5:24:10:47:83:ca:cd:f4:8d:79:58:b1:06:9b:e7:1a:2a:d9:
+ 9d:01:d7:94:7d:ed:03:4a:ca:f0:db:e8:a9:01:3e:f5:56:99:
+ c9:1e:8e:49:3d:bb:e5:09:b9:e0:4f:49:92:3d:16:82:40:cc:
+ cc:59:c6:e6:3a:ed:12:2e:69:3c:6c:95:b1:fd:aa:1d:7b:7f:
+ 86:be:1e:0e:32:46:fb:fb:13:8f:75:7f:4c:8b:4b:46:63:fe:
+ 00:34:40:70:c1:c3:b9:a1:dd:a6:70:e2:04:b3:41:bc:e9:80:
+ 91:ea:64:9c:7a:e1:22:03:a9:9c:6e:6f:0e:65:4f:6c:87:87:
+ 5e:f3:6e:a0:f9:75:a5:9b:40:e8:53:b2:27:9d:4a:b9:c0:77:
+ 21:8d:ff:87:f2:de:bc:8c:ef:17:df:b7:49:0b:d1:f2:6e:30:
+ 0b:1a:0e:4e:76:ed:11:fc:f5:e9:56:b2:7d:bf:c7:6d:0a:93:
+ 8c:a5:d0:c0:b6:1d:be:3a:4e:94:a2:d7:6e:6c:0b:c2:8a:7c:
+ fa:20:f3:c4:e4:e5:cd:0d:a8:cb:91:92:b1:7c:85:ec:b5:14:
+ 69:66:0e:82:e7:cd:ce:c8:2d:a6:51:7f:21:c1:35:53:85:06:
+ 4a:5d:9f:ad:bb:1b:5f:74
+-----BEGIN CERTIFICATE-----
+MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB
+hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
+A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV
+BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5
+MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT
+EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
+Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR
+6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X
+pz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC
+9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV
+/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf
+Zd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z
++pUX2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7w
+qP/0uK3pN/u6uPQLOvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZah
+SL0896+1DSJMwBGB7FY79tOi4lu3sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVIC
+u9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+CGCe01a60y1Dma/RMhnEw6abf
+Fobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5WdYgGq/yapiq
+crxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E
+FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB
+/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl
+wFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM
+4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV
+2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna
+FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ
+CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK
+boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke
+jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL
+S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb
+QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl
+0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB
+NVOFBkpdn627G190
+-----END CERTIFICATE-----
diff --git a/lib/routes/solidot/wotrust.pem b/lib/routes/solidot/wotrust.pem
new file mode 100644
index 00000000000000..aac206ee13caaa
--- /dev/null
+++ b/lib/routes/solidot/wotrust.pem
@@ -0,0 +1,125 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number:
+ 3c:10:4f:09:bd:9c:5e:e5:32:1f:44:c5:e9:9d:b3:04
+ Signature Algorithm: sha384WithRSAEncryption
+ Issuer: C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Certification Authority
+ Validity
+ Not Before: Feb 27 00:00:00 2019 GMT
+ Not After : Feb 26 23:59:59 2029 GMT
+ Subject: C = CN, ST = Guangdong, L = Shenzhen, O = WoTrus CA Limited, OU = Controlled by Sectigo exclusively for WoTrus CA Limited, CN = WoTrus DV Server CA
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public-Key: (2048 bit)
+ Modulus:
+ 00:bd:28:3d:c8:d9:9e:4e:7c:cc:38:df:86:3c:bf:
+ ac:f5:1a:af:ec:d7:2a:80:21:56:36:13:5d:19:60:
+ 7b:d4:23:72:eb:80:22:16:20:56:62:b8:60:d5:7c:
+ e2:fd:b2:b7:e6:45:87:d1:5e:05:65:69:86:10:49:
+ 83:73:fc:86:b2:63:ab:59:b3:ec:49:4e:62:64:f8:
+ c6:9c:91:2e:df:95:ae:b5:3e:d6:68:69:08:69:ab:
+ 68:66:57:29:bf:92:79:23:e9:cf:aa:42:aa:6d:53:
+ 17:bd:4b:44:8a:0d:6c:ac:8a:27:b3:4b:21:c3:bd:
+ 68:37:3c:a8:f1:77:5a:d9:fd:09:93:f1:09:6c:9d:
+ 5e:d2:2a:d2:c6:b9:99:10:18:d6:26:3a:53:2f:e1:
+ 69:20:74:e0:7d:4f:27:af:fa:bb:03:21:01:ac:46:
+ 08:a8:1b:b6:d2:0f:c0:eb:d9:46:54:9f:2a:8b:c0:
+ 7d:b1:60:13:fd:a7:36:49:f6:9b:02:45:3c:d9:4b:
+ 19:59:b3:d4:ef:8c:6e:05:be:e4:0c:60:86:bf:b6:
+ 75:3d:f3:47:4a:c9:31:5a:dc:79:4a:e6:db:df:46:
+ 12:8e:a2:43:56:c7:4e:cb:d5:10:10:a8:d3:54:80:
+ 4b:8f:1a:33:99:b6:e0:d8:2b:90:68:7f:1d:4c:74:
+ 62:b1
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Authority Key Identifier:
+ keyid:BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4
+
+ X509v3 Subject Key Identifier:
+ 0D:49:C9:0F:3E:B1:DF:32:03:B5:92:DB:25:A5:6D:74:EC:59:22:CB
+ X509v3 Key Usage: critical
+ Digital Signature, Certificate Sign, CRL Sign
+ X509v3 Basic Constraints: critical
+ CA:TRUE, pathlen:0
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication, TLS Web Client Authentication
+ X509v3 Certificate Policies:
+ Policy: 1.3.6.1.4.1.6449.1.2.2.22
+ Policy: 2.23.140.1.2.1
+
+ X509v3 CRL Distribution Points:
+
+ Full Name:
+ URI:http://crl.comodoca.com/COMODORSACertificationAuthority.crl
+
+ Authority Information Access:
+ CA Issuers - URI:http://crt.comodoca.com/COMODORSAAddTrustCA.crt
+ OCSP - URI:http://ocsp.comodoca.com
+
+ Signature Algorithm: sha384WithRSAEncryption
+ 88:9d:c8:b0:2e:aa:7f:42:97:1c:39:39:ea:42:f9:5a:97:eb:
+ ec:ab:fd:9b:b6:e1:4e:0f:c8:75:ef:1c:f6:32:c4:59:58:6a:
+ 25:4d:1e:fe:64:d9:3e:71:42:83:44:db:91:11:49:62:ac:1b:
+ 39:64:04:24:6d:b5:69:cd:4f:e3:21:87:df:8d:15:45:f7:90:
+ 15:76:9d:75:6c:a4:0e:3a:62:a4:ad:e9:4a:f3:34:7c:24:62:
+ ce:ea:33:7f:b9:43:1e:b1:dd:bf:7d:50:2a:fe:e9:48:ee:17:
+ 58:a8:7d:a8:2b:b7:8e:ee:29:45:2b:02:98:33:46:e0:85:b3:
+ 3a:0b:36:36:de:67:b3:14:ae:17:9c:1d:0f:69:d8:dd:35:7a:
+ 61:4b:47:1c:ff:08:67:89:9c:7f:b1:1b:7a:87:c0:b4:8f:45:
+ 42:f9:81:2a:0d:2e:75:6c:fe:e1:4f:d8:51:0e:14:49:5f:44:
+ 5e:81:67:32:a8:e8:bc:d3:75:8c:44:68:73:15:13:4b:23:17:
+ 7a:52:c6:9d:38:5a:c3:d9:2a:af:f3:43:c8:2a:99:02:a0:7e:
+ 6f:50:c3:53:b3:1d:aa:e5:f2:7c:5b:c7:cf:47:78:f8:70:7b:
+ 7b:69:88:d8:5d:14:16:8c:65:94:85:01:33:f3:cd:e2:3e:34:
+ 0c:10:40:c7:a5:b3:3e:f7:ee:46:b9:f3:7b:d3:a5:00:86:db:
+ be:78:9d:5a:b7:c8:f0:b8:05:67:69:ca:f3:4b:06:4b:35:4e:
+ 7f:8e:d7:44:be:1f:e1:2b:ea:2d:71:c3:a4:c4:d7:e9:09:80:
+ fd:9f:d0:7d:0a:14:23:9a:ed:cc:09:8e:5b:6e:31:e1:26:0e:
+ 6e:9a:c5:5c:5d:db:01:22:e6:26:27:ed:cf:c3:91:92:b4:f7:
+ 03:3e:33:2f:d6:2e:64:8f:8e:b6:e7:49:53:eb:96:be:70:8a:
+ f8:ef:e6:3c:60:0a:63:db:b6:50:90:ec:47:4d:80:b5:ce:38:
+ c2:04:87:23:1f:df:1f:e8:b6:b5:57:9f:75:44:4e:72:ac:1d:
+ c8:59:ac:11:2a:57:db:14:76:3e:f2:d9:96:f5:27:7b:5e:9b:
+ f8:6f:9b:c9:19:cb:3a:76:51:15:82:b6:38:51:45:1e:a8:42:
+ 8e:7a:0c:86:86:73:8c:5a:27:02:ea:0c:e2:66:04:1c:67:fc:
+ 13:94:18:29:5a:e4:db:e2:03:68:b9:44:d6:31:f7:04:5e:c1:
+ 7e:53:69:a0:a5:ca:35:39:fb:94:60:d4:6f:18:88:41:9c:39:
+ a7:5f:2e:be:65:8e:96:d4:7e:71:ef:17:2e:e7:c3:c7:3a:08:
+ c2:bf:cd:ff:6a:23:fa:fd
+-----BEGIN CERTIFICATE-----
+MIIGLzCCBBegAwIBAgIQPBBPCb2cXuUyH0TF6Z2zBDANBgkqhkiG9w0BAQwFADCB
+hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
+A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV
+BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTkwMjI3
+MDAwMDAwWhcNMjkwMjI2MjM1OTU5WjCBsDELMAkGA1UEBhMCQ04xEjAQBgNVBAgT
+CUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xGjAYBgNVBAoTEVdvVHJ1cyBD
+QSBMaW1pdGVkMUAwPgYDVQQLEzdDb250cm9sbGVkIGJ5IFNlY3RpZ28gZXhjbHVz
+aXZlbHkgZm9yIFdvVHJ1cyBDQSBMaW1pdGVkMRwwGgYDVQQDExNXb1RydXMgRFYg
+U2VydmVyIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvSg9yNme
+TnzMON+GPL+s9Rqv7NcqgCFWNhNdGWB71CNy64AiFiBWYrhg1Xzi/bK35kWH0V4F
+ZWmGEEmDc/yGsmOrWbPsSU5iZPjGnJEu35WutT7WaGkIaatoZlcpv5J5I+nPqkKq
+bVMXvUtEig1srIons0shw71oNzyo8Xda2f0Jk/EJbJ1e0irSxrmZEBjWJjpTL+Fp
+IHTgfU8nr/q7AyEBrEYIqBu20g/A69lGVJ8qi8B9sWAT/ac2SfabAkU82UsZWbPU
+74xuBb7kDGCGv7Z1PfNHSskxWtx5Subb30YSjqJDVsdOy9UQEKjTVIBLjxozmbbg
+2CuQaH8dTHRisQIDAQABo4IBbDCCAWgwHwYDVR0jBBgwFoAUu69+Aj36pvE8hI6t
+7jiY7NkyMtQwHQYDVR0OBBYEFA1JyQ8+sd8yA7WS2yWlbXTsWSLLMA4GA1UdDwEB
+/wQEAwIBhjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdJQQWMBQGCCsGAQUFBwMB
+BggrBgEFBQcDAjAiBgNVHSAEGzAZMA0GCysGAQQBsjEBAgIWMAgGBmeBDAECATBM
+BgNVHR8ERTBDMEGgP6A9hjtodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9S
+U0FDZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDBxBggrBgEFBQcBAQRlMGMwOwYI
+KwYBBQUHMAKGL2h0dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NPTU9ET1JTQUFkZFRy
+dXN0Q0EuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5jb21vZG9jYS5jb20w
+DQYJKoZIhvcNAQEMBQADggIBAIidyLAuqn9Clxw5OepC+VqX6+yr/Zu24U4PyHXv
+HPYyxFlYaiVNHv5k2T5xQoNE25ERSWKsGzlkBCRttWnNT+Mhh9+NFUX3kBV2nXVs
+pA46YqSt6UrzNHwkYs7qM3+5Qx6x3b99UCr+6UjuF1iofagrt47uKUUrApgzRuCF
+szoLNjbeZ7MUrhecHQ9p2N01emFLRxz/CGeJnH+xG3qHwLSPRUL5gSoNLnVs/uFP
+2FEOFElfRF6BZzKo6LzTdYxEaHMVE0sjF3pSxp04WsPZKq/zQ8gqmQKgfm9Qw1Oz
+Harl8nxbx89HePhwe3tpiNhdFBaMZZSFATPzzeI+NAwQQMelsz737ka583vTpQCG
+2754nVq3yPC4BWdpyvNLBks1Tn+O10S+H+Er6i1xw6TE1+kJgP2f0H0KFCOa7cwJ
+jltuMeEmDm6axVxd2wEi5iYn7c/DkZK09wM+My/WLmSPjrbnSVPrlr5wivjv5jxg
+CmPbtlCQ7EdNgLXOOMIEhyMf3x/otrVXn3VETnKsHchZrBEqV9sUdj7y2Zb1J3te
+m/hvm8kZyzp2URWCtjhRRR6oQo56DIaGc4xaJwLqDOJmBBxn/BOUGCla5NviA2i5
+RNYx9wRewX5TaaClyjU5+5Rg1G8YiEGcOadfLr5ljpbUfnHvFy7nw8c6CMK/zf9q
+I/r9
+-----END CERTIFICATE-----
|
6dc3b977402d782a81d315b08abe2138aa6c24f8
|
2023-11-10 20:29:58
|
Ethan Shen
|
feat(route): add 全球主机监控CloudFlareYes (#13739)
| false
|
add 全球主机监控CloudFlareYes (#13739)
|
feat
|
diff --git a/lib/v2/hostmonit/cloudflareyes.js b/lib/v2/hostmonit/cloudflareyes.js
new file mode 100644
index 00000000000000..913fb820ed0d71
--- /dev/null
+++ b/lib/v2/hostmonit/cloudflareyes.js
@@ -0,0 +1,91 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const timezone = require('@/utils/timezone');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+const lines = {
+ CM: '中国移动',
+ CU: '中国联通',
+ CT: '中国电信',
+};
+
+module.exports = async (ctx) => {
+ const { type = 'v4' } = ctx.params;
+ const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30;
+
+ const domain = 'hostmonit.com';
+ const title = `CloudFlareYes${type === 'v6' ? type.toUpperCase() : ''}`;
+
+ const rootUrl = `https://stock.${domain}`;
+ const rootApiUrl = `https://api.${domain}`;
+ const apiUrl = new URL('get_optimization_ip', rootApiUrl).href;
+ const currentUrl = new URL(title, rootUrl).href;
+
+ const key = 'iDetkOys';
+
+ const { data: response } = await got.post(apiUrl, {
+ json: {
+ key,
+ ...(type === 'v6'
+ ? {
+ type: 'v6',
+ }
+ : {}),
+ },
+ });
+
+ const items = response.info.slice(0, limit).map((item) => {
+ const ip = item.ip;
+ const latency = item.latency === undefined ? undefined : `${item.latency}ms`;
+ const line = item.line === undefined ? undefined : lines.hasOwnProperty(item.line) ? lines[item.line] : item.line;
+ const loss = item.loss === undefined ? undefined : `${item.loss}%`;
+ const node = item.node;
+ const speed = item.speed === undefined ? undefined : `${item.speed} KB/s`;
+ const pubDate = timezone(parseDate(item.time), +8);
+
+ return {
+ title: art(path.join(__dirname, 'templates/title.art'), {
+ line,
+ latency,
+ loss,
+ speed,
+ node,
+ ip,
+ }),
+ link: currentUrl,
+ description: art(path.join(__dirname, 'templates/description.art'), {
+ line,
+ node,
+ ip,
+ latency,
+ loss,
+ speed,
+ }),
+ author: node,
+ category: [line, latency, loss, node].filter((c) => c),
+ guid: `${domain}-${title}-${ip}#${pubDate.toISOString()}`,
+ pubDate,
+ };
+ });
+
+ const { data: currentResponse } = await got(currentUrl);
+
+ const $ = cheerio.load(currentResponse);
+
+ const icon = new URL($('link[rel="icon"]').prop('href'), rootUrl).href;
+
+ ctx.state.data = {
+ item: items,
+ title: $('title').text().replace(/- .*$/, `- ${title}`),
+ link: currentUrl,
+ description: $('meta[name="description"]').prop('content'),
+ language: $('html').prop('lang'),
+ icon,
+ logo: icon,
+ subtitle: title,
+ author: $('title').text().split(/\s-/)[0],
+ allowEmpty: true,
+ };
+};
diff --git a/lib/v2/hostmonit/maintainer.js b/lib/v2/hostmonit/maintainer.js
new file mode 100644
index 00000000000000..627b00ae895622
--- /dev/null
+++ b/lib/v2/hostmonit/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/cloudflareyes/:type?': ['nczitzk'],
+};
diff --git a/lib/v2/hostmonit/radar.js b/lib/v2/hostmonit/radar.js
new file mode 100644
index 00000000000000..5406c6aae96300
--- /dev/null
+++ b/lib/v2/hostmonit/radar.js
@@ -0,0 +1,17 @@
+module.exports = {
+ 'hostmonit.com': {
+ _name: '全球主机监控',
+ stock: [
+ {
+ title: 'CloudFlareYes',
+ docs: 'https://docs.rsshub.app/routes/other#quan-qiu-zhu-ji-jian-kong-cloudflareyes',
+ source: ['/:type'],
+ target: (params) => {
+ const type = params.type;
+
+ return `/hostmonit/${type}`;
+ },
+ },
+ ],
+ },
+};
diff --git a/lib/v2/hostmonit/router.js b/lib/v2/hostmonit/router.js
new file mode 100644
index 00000000000000..ad4b431a1e03ef
--- /dev/null
+++ b/lib/v2/hostmonit/router.js
@@ -0,0 +1,8 @@
+const redirectToV6 = (ctx) => ctx.redirect('/hostmonit/cloudflareyes/v6');
+
+module.exports = (router) => {
+ router.get('/cloudflareyes/:type?', require('./cloudflareyes'));
+ router.get('/cloudflareyesv6', (ctx) => redirectToV6(ctx));
+ router.get('/CloudFlareYes/:type?', require('./cloudflareyes'));
+ router.get('/CloudFlareYesv6', (ctx) => redirectToV6(ctx));
+};
diff --git a/lib/v2/hostmonit/templates/description.art b/lib/v2/hostmonit/templates/description.art
new file mode 100644
index 00000000000000..52eddc7dd6a616
--- /dev/null
+++ b/lib/v2/hostmonit/templates/description.art
@@ -0,0 +1,28 @@
+<table>
+ <tbody>
+ <tr>
+ <th>Line</th>
+ <td>{{ line }}</td>
+ </tr>
+ <tr>
+ <th>Latency</th>
+ <td>{{ latency }}</td>
+ </tr>
+ <tr>
+ <th>Loss</th>
+ <td>{{ loss }}</td>
+ </tr>
+ <tr>
+ <th>Speed</th>
+ <td>{{ speed }}</td>
+ </tr>
+ <tr>
+ <th>Node</th>
+ <td>{{ node }}</td>
+ </tr>
+ <tr>
+ <th>IP</th>
+ <td>{{ ip }}</td>
+ </tr>
+ </tbody>
+</table>
\ No newline at end of file
diff --git a/lib/v2/hostmonit/templates/title.art b/lib/v2/hostmonit/templates/title.art
new file mode 100644
index 00000000000000..6a4cefa67bcf96
--- /dev/null
+++ b/lib/v2/hostmonit/templates/title.art
@@ -0,0 +1 @@
+[{{ line }} | {{ latency }} | {{ loss }} | {{ speed }} | {{ node }}] {{ ip }}
\ No newline at end of file
diff --git a/website/docs/routes/other.mdx b/website/docs/routes/other.mdx
index 284480ec830777..41bd2266388d5c 100644
--- a/website/docs/routes/other.mdx
+++ b/website/docs/routes/other.mdx
@@ -1099,6 +1099,18 @@ Refer to [the list of supported currencies](https://wise.com/tools/exchange-rate
</Route>
+## 全球主机监控 {#quan-qiu-zhu-ji-jian-kong}
+
+### CloudFlareYes {#quan-qiu-zhu-ji-jian-kong-cloudflareyes}
+
+<Route author="nczitzk" example="/hostmonit/cloudflareyes" path="/hostmonit/cloudflareyes/:type?" paramsDesc={['类型,见下表,默认为 v4']} radar="1" rssbud="1">
+
+| v4 | v6 |
+| --- | --- |
+| | v6 |
+
+</Route>
+
## 热搜聚合 {#re-sou-ju-he}
### 关键词聚合追踪 {#re-sou-ju-he-guan-jian-ci-ju-he-zhui-zong}
|
8ec0902c0997ab8786cd68f69aa5c8e584845d16
|
2023-12-08 19:06:55
|
Tony
|
feat(route): routledge (#13993)
| false
|
routledge (#13993)
|
feat
|
diff --git a/lib/v2/routledge/book-series.js b/lib/v2/routledge/book-series.js
new file mode 100644
index 00000000000000..f876a10d784efa
--- /dev/null
+++ b/lib/v2/routledge/book-series.js
@@ -0,0 +1,78 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const { join } = require('path');
+
+module.exports = async (ctx) => {
+ const { bookName, bookId } = ctx.params;
+ const baseUrl = 'https://www.routledge.com';
+ const pageUrl = `${baseUrl}/${bookName}/book-series/${bookId}`;
+ const { data: response } = await got(pageUrl, {
+ headers: {
+ accept: 'text/html, */*; q=0.01',
+ },
+ searchParams: {
+ publishedFilter: 'alltitles',
+ pd: 'published,forthcoming',
+ pg: 1,
+ pp: 12,
+ so: 'pub',
+ view: 'list',
+ },
+ });
+ const $ = cheerio.load(response);
+
+ const list = $('.row.book')
+ .toArray()
+ .map((item) => {
+ item = $(item);
+ const title = item.find('h3 a');
+ const description = item.find('p.description');
+ const meta = item.find('p.description').prev().text().split('\n');
+ return {
+ title: title.text(),
+ link: title.attr('href'),
+ description: description.text(),
+ pubDate: parseDate(meta.pop().trim(), 'MMMM DD, YYYY'),
+ author: meta
+ .map((i) => i.trim())
+ .filter((i) => i)
+ .join(', '),
+ };
+ });
+
+ const items = await Promise.all(
+ list.map((item) =>
+ ctx.cache.tryGet(item.link, async () => {
+ const { data } = await got(item.link);
+ const $ = cheerio.load(data);
+ const isbn = $('meta[property="books:isbn"]').attr('content');
+ const { data: image } = await got('https://productimages.routledge.com', {
+ searchParams: {
+ isbn,
+ size: 'amazon',
+ ext: 'jpg',
+ },
+ });
+
+ const description = $('.sticky-div');
+ description.find('button.accordion-button').contents().unwrap();
+ description.find('.fa-shopping-cart').parent().parent().remove();
+
+ item.description = art(join(__dirname, 'templates/description.art'), {
+ image,
+ description: description.html(),
+ });
+ return item;
+ })
+ )
+ );
+
+ ctx.state.data = {
+ title: $('head title').text(),
+ description: $('head meta[name="description"]').attr('content'),
+ link: pageUrl,
+ item: items,
+ };
+};
diff --git a/lib/v2/routledge/maintainer.js b/lib/v2/routledge/maintainer.js
new file mode 100644
index 00000000000000..7c3f1201e895d5
--- /dev/null
+++ b/lib/v2/routledge/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/:bookName/book-series/:bookId': ['TonyRL'],
+};
diff --git a/lib/v2/routledge/radar.js b/lib/v2/routledge/radar.js
new file mode 100644
index 00000000000000..2eb39553b6df2e
--- /dev/null
+++ b/lib/v2/routledge/radar.js
@@ -0,0 +1,13 @@
+module.exports = {
+ 'routledge.com': {
+ _name: 'Routledge',
+ '.': [
+ {
+ title: 'Book Series',
+ docs: 'https://docs.rsshub.app/routes/journals#routledge',
+ source: ['/:bookName/book-series/:bookId'],
+ target: '/routledge/:bookName/book-series/:bookId',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/routledge/router.js b/lib/v2/routledge/router.js
new file mode 100644
index 00000000000000..51935b6e99be8a
--- /dev/null
+++ b/lib/v2/routledge/router.js
@@ -0,0 +1,3 @@
+module.exports = (router) => {
+ router.get('/:bookName/book-series/:bookId', require('./book-series'));
+};
diff --git a/lib/v2/routledge/templates/description.art b/lib/v2/routledge/templates/description.art
new file mode 100644
index 00000000000000..d7f9b4d48c9351
--- /dev/null
+++ b/lib/v2/routledge/templates/description.art
@@ -0,0 +1,7 @@
+{{ if image }}
+<img src="{{ image }}"><br>
+{{ /if }}
+
+{{ if description }}
+{{@ description }}
+{{ /if }}
diff --git a/website/docs/routes/journal.mdx b/website/docs/routes/journal.mdx
index 8ab97e3200c214..efcec0bdf25ac0 100644
--- a/website/docs/routes/journal.mdx
+++ b/website/docs/routes/journal.mdx
@@ -411,6 +411,12 @@ In `https://pubmed.ncbi.nlm.nih.gov/trending/?filter=simsearch1.fha&filter=pubt.
</Route>
+## Routledge {#routledge}
+
+### Book Series {#routledge-book-series}
+
+<Route author="TonyRL" example="/routledge/:bookName/book-series/:bookId" path="/routledge/A-Colour-Atlas/book-series/CRCACOLOATLA" paramsDesc={['Book name, can be found in URL', 'Book ID, can be found in URL']} radar="1" />
+
## Royal Society of Chemistry {#royal-society-of-chemistry}
### Journal {#royal-society-of-chemistry-journal}
|
f9ac1e2c723ee8cb31cf450b9f13fb9e60240b27
|
2024-01-16 14:34:30
|
Carson Yang
|
docs: Add deploy to Sealos (#14259)
| false
|
Add deploy to Sealos (#14259)
|
docs
|
diff --git a/website/docs/install/README.md b/website/docs/install/README.md
index 107f7b826c8235..f493dbb0eeb51f 100644
--- a/website/docs/install/README.md
+++ b/website/docs/install/README.md
@@ -22,6 +22,7 @@ Deploy for public access may require:
5. [Google App Engine](https://cloud.google.com/appengine/)
6. [Fly.io](https://fly.io/)
7. [Zeabur](https://zeabur.com)
+8. [Sealos](https://sealos.io)
## Docker Image
@@ -452,6 +453,12 @@ Heroku [no longer](https://blog.heroku.com/next-chapter) offers free product pla
3. Configure `automatic deploy` in Heroku app to follow the changes to your fork.
4. Install [Pull](https://github.com/apps/pull) app to keep your fork synchronized with RSSHub.
+## Deploy to Sealos(use Redis as cache)
+
+Automatic updates are included.
+
+[](https://template.cloud.sealos.io/deploy?templateName=rsshub)
+
## Deploy to Vercel (ZEIT Now)
### Instant deploy (without automatic update)
diff --git a/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md b/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md
index faddfc22330e29..2a29781ba92feb 100644
--- a/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md
+++ b/website/i18n/zh/docusaurus-plugin-content-docs/current/install/README.md
@@ -22,6 +22,7 @@ sidebar: auto
5. [Google App Engine](https://cloud.google.com/appengine/)
6. [Fly.io](https://fly.io/)
7. [Zeabur](https://zeabur.com)
+8. [Sealos](https://sealos.io)
## Docker 镜像
@@ -440,6 +441,12 @@ Heroku [不再](https://blog.heroku.com/next-chapter) 提供免费服务。
3. 检查 Heroku 设置,随代码库更新自动部署。
4. 安装 [Pull](https://github.com/apps/pull) 应用,定期将 RSSHub 改动自动同步至你的分叉。
+## 部署到 Sealos(包含 Redis 缓存)
+
+包含自动更新
+
+[](https://template.cloud.sealos.io/deploy?templateName=rsshub)
+
## 部署到 Vercel (ZEIT Now)
### 一键部署(无自动更新)
|
f4225856b54bf06cea1ced04481bc7c9d026702a
|
2025-02-18 20:24:56
|
cnk
|
feat(routes/hrbust): add 'cs' 'gzc' 'lib' routes, unified code style (#18393)
| false
|
add 'cs' 'gzc' 'lib' routes, unified code style (#18393)
|
feat
|
diff --git a/lib/routes/hrbust/cs.ts b/lib/routes/hrbust/cs.ts
new file mode 100644
index 00000000000000..940a232fdbd6f3
--- /dev/null
+++ b/lib/routes/hrbust/cs.ts
@@ -0,0 +1,100 @@
+import { Route, ViewType } from '@/types';
+import cache from '@/utils/cache';
+import { parseDate } from '@/utils/parse-date';
+import timezone from '@/utils/timezone';
+import { load } from 'cheerio';
+import { ofetch } from 'ofetch';
+
+export const route: Route = {
+ path: '/cs/:category?',
+ name: '计算机学院',
+ url: 'cs.hrbust.edu.cn',
+ maintainers: ['cscnk52'],
+ handler,
+ example: '/hrbust/cs',
+ parameters: { category: '栏目标识,默认为 3709(学院要闻)' },
+ description: `| 通知公告 | 学院要闻 | 常用下载 | 博士后流动站 | 学生指导 | 科研动态 | 科技成果 | 党建理论 | 党建学习 | 党建活动 | 党建风采 | 团学组织 | 学生党建 | 学生活动 | 心理健康 | 青春榜样 | 就业工作 | 校友风采 | 校庆专栏 | 专业介绍 | 本科生培养方案 | 硕士生培养方案 | 能力作风建设 | 博士生培养方案 | 省级实验教学示范中心 | 喜迎二十大系列活动 | 学习贯彻省十三次党代会精神 |
+|----------|----------|----------|--------------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------------|----------------|--------------|----------------|----------------------|--------------------|----------------------------|
+| 3708 | 3709 | 3710 | 3725 | 3729 | 3732 | 3733 | 3740 | 3741 | 3742 | 3743 | 3744 | 3745 | 3746 | 3747 | 3748 | 3751 | 3752 | 3753 | 3755 | 3756 | 3759 | nlzfjs | pyfa | sjsyjxsfzx | srxxgcddesdjs | xxgcssscddhjs |`,
+ categories: ['university'],
+ features: {
+ requireConfig: false,
+ requirePuppeteer: false,
+ antiCrawler: false,
+ supportBT: false,
+ supportPodcast: false,
+ supportScihub: false,
+ supportRadar: true,
+ },
+ radar: [
+ {
+ source: ['cs.hrbust.edu.cn/:category/list.htm'],
+ target: '/cs/:category',
+ },
+ {
+ source: ['cs.hrbust.edu.cn'],
+ target: '/cs',
+ },
+ ],
+ view: ViewType.Notifications,
+};
+
+async function handler(ctx) {
+ const rootUrl = 'https://cs.hrbust.edu.cn/';
+ const { category = 3709 } = ctx.req.param();
+ const columnUrl = `${rootUrl}${category}/list.htm`;
+ const response = await ofetch(columnUrl);
+ const $ = load(response);
+ const bigTitle = $('li.col_title').text();
+
+ const list = $('div.col_news_con li.news')
+ .toArray()
+ .map((item) => {
+ const element = $(item);
+ const link = new URL(element.find('a').attr('href'), rootUrl).href;
+ const pubDateText = element.find('span.news_meta').text().trim();
+ const pubDate = pubDateText ? timezone(parseDate(pubDateText), +8) : null;
+ return {
+ title: element.find('a').text().trim(),
+ pubDate,
+ link,
+ };
+ });
+
+ const items = await Promise.all(
+ list.map((item) =>
+ cache.tryGet(item.link, async () => {
+ if (!item.link.startsWith(rootUrl)) {
+ item.description = '本文需跳转,请点击原文链接后阅读';
+ return item;
+ }
+
+ const response = await ofetch(item.link);
+ const $ = load(response);
+ const content = $('div.wp_articlecontent');
+
+ content.find('[style]').removeAttr('style');
+ content.find('font').contents().unwrap();
+ content.html(content.html()?.replaceAll(' ', ''));
+ content.find('[align]').removeAttr('align');
+
+ const author = $('span.arti_publisher').text().replace('发布者:', '').trim();
+
+ return {
+ title: item.title,
+ link: item.link,
+ pubDate: item.pubDate,
+ description: content.html(),
+ author,
+ };
+ })
+ )
+ );
+
+ return {
+ title: `${bigTitle} - 哈尔滨理工大学计算机学院`,
+ link: columnUrl,
+ language: 'zh-CN',
+ item: items,
+ };
+}
diff --git a/lib/routes/hrbust/gzc.ts b/lib/routes/hrbust/gzc.ts
new file mode 100644
index 00000000000000..f76ef3c56caacc
--- /dev/null
+++ b/lib/routes/hrbust/gzc.ts
@@ -0,0 +1,97 @@
+import { Route, ViewType } from '@/types';
+import cache from '@/utils/cache';
+import { parseDate } from '@/utils/parse-date';
+import timezone from '@/utils/timezone';
+import { load } from 'cheerio';
+import { ofetch } from 'ofetch';
+
+export const route: Route = {
+ path: '/gzc/:category?',
+ name: '国有资产管理处',
+ url: 'gzc.hrbust.edu.cn',
+ maintainers: ['cscnk52'],
+ handler,
+ example: '/hrbust/gzc',
+ parameters: { category: '栏目标识,默认为 1305(热点新闻)' },
+ description: `| 政策规章 | 资料下载 | 处务公开 | 招标信息 | 岗位职责 | 管理办法 | 物资处理 | 工作动态 | 热点新闻 |
+|----------|----------|----------|----------|----------|----------|----------|----------|----------|
+| 1287 | 1288 | 1289 | 1291 | 1300 | 1301 | 1302 | 1304 | 1305 |`,
+ categories: ['university'],
+ features: {
+ requireConfig: false,
+ requirePuppeteer: false,
+ antiCrawler: false,
+ supportBT: false,
+ supportPodcast: false,
+ supportScihub: false,
+ supportRadar: true,
+ },
+ radar: [
+ {
+ source: ['gzc.hrbust.edu.cn/:category/list.htm'],
+ target: '/gzc/:category',
+ },
+ {
+ source: ['gzc.hrbust.edu.cn'],
+ target: '/gzc',
+ },
+ ],
+ view: ViewType.Notifications,
+};
+
+async function handler(ctx) {
+ const rootUrl = 'https://gzc.hrbust.edu.cn/';
+ const { category = 1305 } = ctx.req.param();
+ const columnUrl = `${rootUrl}${category}/list.htm`;
+ const response = await ofetch(columnUrl);
+ const $ = load(response);
+ const bigTitle = $('li.col-title').text();
+
+ const list = $('ul.wp_article_list li.list_item')
+ .toArray()
+ .map((item) => {
+ const element = $(item);
+ const link = new URL(element.find('a').attr('href'), rootUrl).href;
+ const pubDateText = element.find('span.Article_PublishDate').text().trim();
+ const pubDate = pubDateText ? timezone(parseDate(pubDateText), +8) : null;
+ return {
+ title: element.find('a').text().trim(),
+ pubDate,
+ link,
+ };
+ });
+
+ const items = await Promise.all(
+ list.map((item) =>
+ cache.tryGet(item.link, async () => {
+ if (!item.link.startsWith(rootUrl)) {
+ item.description = '本文需跳转,请点击原文链接后阅读';
+ return item;
+ }
+
+ const response = await ofetch(item.link);
+ const $ = load(response);
+ const content = $('div.wp_articlecontent');
+
+ content.find('[style]').removeAttr('style');
+ content.find('font').contents().unwrap();
+ content.html(content.html()?.replaceAll(' ', ''));
+ content.find('[align]').removeAttr('align');
+
+ return {
+ title: item.title,
+ link: item.link,
+ pubDate: item.pubDate,
+ description: content.html(),
+ };
+ })
+ )
+ );
+
+ return {
+ title: `${bigTitle} - 哈尔滨理工大学国有资产管理处`,
+ link: columnUrl,
+ language: 'zh-CN',
+ item: items,
+ };
+}
diff --git a/lib/routes/hrbust/jwzx.ts b/lib/routes/hrbust/jwzx.ts
index fecdd369c04472..37f8a57fa266b0 100644
--- a/lib/routes/hrbust/jwzx.ts
+++ b/lib/routes/hrbust/jwzx.ts
@@ -40,11 +40,10 @@ export const route: Route = {
};
async function handler(ctx) {
- const JWZXBASE = 'http://jwzx.hrbust.edu.cn/homepage/';
+ const rootUrl = 'http://jwzx.hrbust.edu.cn/homepage/';
const { type = 354, page = 12 } = ctx.req.param();
- const url = JWZXBASE + 'infoArticleList.do?columnId=' + type + '&pagingNumberPer=' + page;
-
- const response = await ofetch(url);
+ const columnUrl = rootUrl + 'infoArticleList.do?columnId=' + type + '&pagingNumberPer=' + page;
+ const response = await ofetch(columnUrl);
const $ = load(response);
const bigTitle = $('.columnTitle .wow span').text().trim();
@@ -53,7 +52,7 @@ async function handler(ctx) {
.toArray()
.map((item) => {
const element = $(item);
- const link = new URL(element.find('a').attr('href'), JWZXBASE).href;
+ const link = new URL(element.find('a').attr('href'), rootUrl).href;
const title = element.find('a').text().trim();
const pubDateText = element.find('span').text().trim();
const pubDate = timezone(parseDate(pubDateText), +8);
@@ -67,7 +66,7 @@ async function handler(ctx) {
const items = await Promise.all(
list.map((item) =>
cache.tryGet(item.link, async () => {
- if (!item.link.startsWith(JWZXBASE)) {
+ if (!item.link.startsWith(rootUrl)) {
item.description = '本文需跳转,请点击原文链接后阅读';
return item;
}
@@ -89,8 +88,9 @@ async function handler(ctx) {
);
return {
- title: `哈尔滨理工大学教务处 - ${bigTitle}`,
- link: JWZXBASE,
+ title: `${bigTitle} - 哈尔滨理工大学教务处`,
+ link: columnUrl,
+ language: 'zh-CN',
item: items,
};
}
diff --git a/lib/routes/hrbust/lib.ts b/lib/routes/hrbust/lib.ts
new file mode 100644
index 00000000000000..6a9aee91b8650f
--- /dev/null
+++ b/lib/routes/hrbust/lib.ts
@@ -0,0 +1,97 @@
+import { Route, ViewType } from '@/types';
+import cache from '@/utils/cache';
+import { parseDate } from '@/utils/parse-date';
+import timezone from '@/utils/timezone';
+import { load } from 'cheerio';
+import { ofetch } from 'ofetch';
+
+export const route: Route = {
+ path: '/lib/:category?',
+ name: '图书馆',
+ url: 'lib.hrbust.edu.cn',
+ maintainers: ['cscnk52'],
+ handler,
+ example: '/hrbust/lib',
+ parameters: { category: '栏目标识,默认为 3421(公告消息)' },
+ description: `| 公告消息 | 资源动态 | 参考中心 | 常用工具 | 外借服务 | 报告厅及研讨间服务 | 外文引进数据库 | 外文电子图书 | 外文试用数据库 | 中文引进数据库 | 中文电子图书 | 中文试用数据库 |
+|----------|----------|----------|----------|----------|--------------------|----------------|--------------|----------------|----------------|--------------|----------------|
+| 3421 | 3422 | ckzx | cygj | wjfw | ytjfw | yw | yw_3392 | yw_3395 | zw | zw_3391 | zw_3394 |`,
+ categories: ['university'],
+ features: {
+ requireConfig: false,
+ requirePuppeteer: false,
+ antiCrawler: false,
+ supportBT: false,
+ supportPodcast: false,
+ supportScihub: false,
+ supportRadar: true,
+ },
+ radar: [
+ {
+ source: ['lib.hrbust.edu.cn/:category/list.htm'],
+ target: '/lib/:category',
+ },
+ {
+ source: ['lib.hrbust.edu.cn'],
+ target: '/lib',
+ },
+ ],
+ view: ViewType.Notifications,
+};
+
+async function handler(ctx) {
+ const rootUrl = 'https://lib.hrbust.edu.cn/';
+ const { category = 3421 } = ctx.req.param();
+ const columnUrl = `${rootUrl}${category}/list.htm`;
+ const response = await ofetch(columnUrl);
+ const $ = load(response);
+ const bigTitle = $('span.Column_Anchor').text();
+
+ const list = $('ul.tu_b3 li:not([class])')
+ .toArray()
+ .map((item) => {
+ const element = $(item);
+ const link = new URL(element.find('a').attr('href'), rootUrl).href;
+ const pubDateText = element.find('span').text().trim();
+ const pubDate = pubDateText ? timezone(parseDate(pubDateText), +8) : null;
+ return {
+ title: element.find('a').text().trim(),
+ pubDate,
+ link,
+ };
+ });
+
+ const items = await Promise.all(
+ list.map((item) =>
+ cache.tryGet(item.link, async () => {
+ if (!item.link.startsWith(rootUrl)) {
+ item.description = '本文需跳转,请点击原文链接后阅读';
+ return item;
+ }
+
+ const response = await ofetch(item.link);
+ const $ = load(response);
+ const content = $('div.wp_articlecontent');
+
+ content.find('[style]').removeAttr('style');
+ content.find('font').contents().unwrap();
+ content.html(content.html()?.replaceAll(' ', ''));
+ content.find('[align]').removeAttr('align');
+
+ return {
+ title: item.title,
+ link: item.link,
+ pubDate: item.pubDate,
+ description: content.html(),
+ };
+ })
+ )
+ );
+
+ return {
+ title: `${bigTitle} - 哈尔滨理工大学图书馆`,
+ link: columnUrl,
+ language: 'zh-CN',
+ item: items,
+ };
+}
diff --git a/lib/routes/hrbust/news.ts b/lib/routes/hrbust/news.ts
index ced9b7dfacd987..8cc2d00ee63be4 100644
--- a/lib/routes/hrbust/news.ts
+++ b/lib/routes/hrbust/news.ts
@@ -1,9 +1,9 @@
import { Route, ViewType } from '@/types';
import cache from '@/utils/cache';
-import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
+import ofetch from '@/utils/ofetch';
export const route: Route = {
path: '/news/:category?',
@@ -41,12 +41,10 @@ export const route: Route = {
async function handler(ctx) {
const rootUrl = 'https://news.hrbust.edu.cn/';
-
const { category = 'lgyw' } = ctx.req.param();
-
- const response = await got(`${rootUrl}${category}.htm`);
-
- const $ = load(response.data);
+ const columnUrl = `${rootUrl}${category}.htm`;
+ const response = await ofetch(columnUrl);
+ const $ = load(response);
const bigTitle = $('title').text().split('-')[0].trim();
@@ -72,8 +70,8 @@ async function handler(ctx) {
return item;
}
- const detailResponse = await got(item.link);
- const content = load(detailResponse.data);
+ const detailResponse = await ofetch(item.link);
+ const content = load(detailResponse);
const dateText = content('p.xinxi span:contains("日期时间:")').text().replace('日期时间:', '').trim();
const pubTime = dateText ? timezone(parseDate(dateText), +8) : null;
@@ -98,8 +96,9 @@ async function handler(ctx) {
);
return {
- title: `哈尔滨理工大学新闻网 - ${bigTitle}`,
- link: `${rootUrl}${category}.htm`,
+ title: `${bigTitle} - 哈尔滨理工大学新闻网`,
+ link: columnUrl,
+ language: 'zh-CN',
item: items,
};
}
diff --git a/lib/routes/hrbust/nic.ts b/lib/routes/hrbust/nic.ts
index 043d9ea0531c81..f6d0e3bc50aaad 100644
--- a/lib/routes/hrbust/nic.ts
+++ b/lib/routes/hrbust/nic.ts
@@ -41,13 +41,9 @@ export const route: Route = {
async function handler(ctx) {
const rootUrl = 'https://nic.hrbust.edu.cn/';
-
const { category = 3988 } = ctx.req.param();
-
- const url = `${rootUrl}${category}/list.htm`;
-
- const response = await ofetch(url);
-
+ const columnUrl = `${rootUrl}${category}/list.htm`;
+ const response = await ofetch(columnUrl);
const $ = load(response);
const bigTitle = $('li.col_title').text();
@@ -93,8 +89,9 @@ async function handler(ctx) {
);
return {
- title: `哈尔滨理工大学网络信息中心 - ${bigTitle}`,
- link: rootUrl,
+ title: `${bigTitle} - 哈尔滨理工大学网络信息中心`,
+ link: columnUrl,
+ language: 'zh-CN',
item: items,
};
}
|
d0fbbeb31177579e9de2a8f6c9bd079023a6fb22
|
2024-11-07 14:39:25
|
dependabot[bot]
|
chore(deps): bump imapflow from 1.0.166 to 1.0.168 (#17490)
| false
|
bump imapflow from 1.0.166 to 1.0.168 (#17490)
|
chore
|
diff --git a/package.json b/package.json
index 5aa479888492b7..d9d17ec99c6f12 100644
--- a/package.json
+++ b/package.json
@@ -89,7 +89,7 @@
"http-cookie-agent": "6.0.6",
"https-proxy-agent": "7.0.5",
"iconv-lite": "0.6.3",
- "imapflow": "1.0.166",
+ "imapflow": "1.0.168",
"instagram-private-api": "1.46.1",
"ioredis": "5.4.1",
"ip-regex": "5.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 561ed95b445a83..0c8026b587c34c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -129,8 +129,8 @@ importers:
specifier: 0.6.3
version: 0.6.3
imapflow:
- specifier: 1.0.166
- version: 1.0.166
+ specifier: 1.0.168
+ version: 1.0.168
instagram-private-api:
specifier: 1.46.1
version: 1.46.1
@@ -3599,8 +3599,8 @@ packages:
engines: {node: '>=6.9.0'}
hasBin: true
- [email protected]:
- resolution: {integrity: sha512-UDgwiJqVIT9TvT0BP4iX4X9moq0QeBgluhVtlEmWOSZjgY7U1NO7biB/Bb97BVEl5tgl+SYb+RK2TsnSZjkaqw==}
+ [email protected]:
+ resolution: {integrity: sha512-vPK06gESqQHh5P8qo2r1nth7v3nDvxvCd1qUATRtLoLWDvUvdHNYSkSoXn7lctXWssjRx8lMJg6e+9Dj2t/JTw==}
[email protected]:
resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==}
@@ -9455,7 +9455,7 @@ snapshots:
[email protected]: {}
- [email protected]:
+ [email protected]:
dependencies:
encoding-japanese: 2.2.0
iconv-lite: 0.6.3
|
37574030e7610020e542497e1b8156f20a2e29a4
|
2023-08-28 17:32:12
|
Tony
|
chore: change `noroute` label name
| false
|
change `noroute` label name
|
chore
|
diff --git a/scripts/workflow/test-route/identify.js b/scripts/workflow/test-route/identify.js
index 97a419bb3f89d3..fb4d0fd48fff2a 100644
--- a/scripts/workflow/test-route/identify.js
+++ b/scripts/workflow/test-route/identify.js
@@ -90,7 +90,7 @@ module.exports = async ({ github, context, core }, body, number, sender) => {
if (res.length && res[0] === 'NOROUTE') {
core.info('PR stated no route, passing');
await removeLabel();
- await addLabels(['Auto: No Route Needed']);
+ await addLabels(['Auto: Route Test Skipped']);
return;
} else if (res.length && !res.some((e) => e.includes('/:'))) {
|
5a188a3c5c949dc66802529fcad0291d7ef34550
|
2024-12-02 20:15:32
|
dependabot[bot]
|
chore(deps-dev): bump eslint from 9.15.0 to 9.16.0 (#17770)
| false
|
bump eslint from 9.15.0 to 9.16.0 (#17770)
|
chore
|
diff --git a/package.json b/package.json
index 93ecf72b100488..710702cf143f3a 100644
--- a/package.json
+++ b/package.json
@@ -172,7 +172,7 @@
"@vercel/nft": "0.27.7",
"@vitest/coverage-v8": "2.0.5",
"discord-api-types": "0.37.110",
- "eslint": "9.15.0",
+ "eslint": "9.16.0",
"eslint-config-prettier": "9.1.0",
"eslint-nibble": "8.1.0",
"eslint-plugin-n": "17.14.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a0abab62fe3564..0aa8ffa35cb7a6 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -294,7 +294,7 @@ importers:
version: 3.1.0
'@stylistic/eslint-plugin':
specifier: 2.11.0
- version: 2.11.0([email protected])([email protected])
+ version: 2.11.0([email protected])([email protected])
'@types/aes-js':
specifier: 3.1.4
version: 3.1.4
@@ -363,10 +363,10 @@ importers:
version: 10.0.0
'@typescript-eslint/eslint-plugin':
specifier: 8.16.0
- version: 8.16.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
+ version: 8.16.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
'@typescript-eslint/parser':
specifier: 8.16.0
- version: 8.16.0([email protected])([email protected])
+ version: 8.16.0([email protected])([email protected])
'@vercel/nft':
specifier: 0.27.7
version: 0.27.7([email protected])
@@ -377,26 +377,26 @@ importers:
specifier: 0.37.110
version: 0.37.110
eslint:
- specifier: 9.15.0
- version: 9.15.0
+ specifier: 9.16.0
+ version: 9.16.0
eslint-config-prettier:
specifier: 9.1.0
- version: 9.1.0([email protected])
+ version: 9.1.0([email protected])
eslint-nibble:
specifier: 8.1.0
- version: 8.1.0([email protected])
+ version: 8.1.0([email protected])
eslint-plugin-n:
specifier: 17.14.0
- version: 17.14.0([email protected])
+ version: 17.14.0([email protected])
eslint-plugin-prettier:
specifier: 5.2.1
- version: 5.2.1(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])
+ version: 5.2.1(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])
eslint-plugin-unicorn:
specifier: 56.0.1
- version: 56.0.1([email protected])
+ version: 56.0.1([email protected])
eslint-plugin-yml:
specifier: 1.16.0
- version: 1.16.0([email protected])
+ version: 1.16.0([email protected])
fs-extra:
specifier: 11.2.0
version: 11.2.0
@@ -1343,10 +1343,6 @@ packages:
resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- '@eslint/[email protected]':
- resolution: {integrity: sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
-
'@eslint/[email protected]':
resolution: {integrity: sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@@ -3073,8 +3069,8 @@ packages:
deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.
hasBin: true
- [email protected]:
- resolution: {integrity: sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==}
+ [email protected]:
+ resolution: {integrity: sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
hasBin: true
peerDependencies:
@@ -6743,9 +6739,9 @@ snapshots:
eslint: 8.57.1
eslint-visitor-keys: 3.4.3
- '@eslint-community/[email protected]([email protected])':
+ '@eslint-community/[email protected]([email protected])':
dependencies:
- eslint: 9.15.0
+ eslint: 9.16.0
eslint-visitor-keys: 3.4.3
'@eslint-community/[email protected]': {}
@@ -6790,8 +6786,6 @@ snapshots:
'@eslint/[email protected]': {}
- '@eslint/[email protected]': {}
-
'@eslint/[email protected]': {}
'@eslint/[email protected]': {}
@@ -7292,10 +7286,10 @@ snapshots:
'@sindresorhus/[email protected]': {}
- '@stylistic/[email protected]([email protected])([email protected])':
+ '@stylistic/[email protected]([email protected])([email protected])':
dependencies:
- '@typescript-eslint/utils': 8.14.0([email protected])([email protected])
- eslint: 9.15.0
+ '@typescript-eslint/utils': 8.14.0([email protected])([email protected])
+ eslint: 9.16.0
eslint-visitor-keys: 4.2.0
espree: 10.3.0
estraverse: 5.3.0
@@ -7464,15 +7458,15 @@ snapshots:
'@types/node': 22.10.1
optional: true
- '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])':
+ '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])':
dependencies:
'@eslint-community/regexpp': 4.12.1
- '@typescript-eslint/parser': 8.16.0([email protected])([email protected])
+ '@typescript-eslint/parser': 8.16.0([email protected])([email protected])
'@typescript-eslint/scope-manager': 8.16.0
- '@typescript-eslint/type-utils': 8.16.0([email protected])([email protected])
- '@typescript-eslint/utils': 8.16.0([email protected])([email protected])
+ '@typescript-eslint/type-utils': 8.16.0([email protected])([email protected])
+ '@typescript-eslint/utils': 8.16.0([email protected])([email protected])
'@typescript-eslint/visitor-keys': 8.16.0
- eslint: 9.15.0
+ eslint: 9.16.0
graphemer: 1.4.0
ignore: 5.3.2
natural-compare: 1.4.0
@@ -7482,14 +7476,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@typescript-eslint/[email protected]([email protected])([email protected])':
+ '@typescript-eslint/[email protected]([email protected])([email protected])':
dependencies:
'@typescript-eslint/scope-manager': 8.16.0
'@typescript-eslint/types': 8.16.0
'@typescript-eslint/typescript-estree': 8.16.0([email protected])
'@typescript-eslint/visitor-keys': 8.16.0
debug: 4.3.7
- eslint: 9.15.0
+ eslint: 9.16.0
optionalDependencies:
typescript: 5.7.2
transitivePeerDependencies:
@@ -7505,12 +7499,12 @@ snapshots:
'@typescript-eslint/types': 8.16.0
'@typescript-eslint/visitor-keys': 8.16.0
- '@typescript-eslint/[email protected]([email protected])([email protected])':
+ '@typescript-eslint/[email protected]([email protected])([email protected])':
dependencies:
'@typescript-eslint/typescript-estree': 8.16.0([email protected])
- '@typescript-eslint/utils': 8.16.0([email protected])([email protected])
+ '@typescript-eslint/utils': 8.16.0([email protected])([email protected])
debug: 4.3.7
- eslint: 9.15.0
+ eslint: 9.16.0
ts-api-utils: 1.4.0([email protected])
optionalDependencies:
typescript: 5.7.2
@@ -7551,24 +7545,24 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@typescript-eslint/[email protected]([email protected])([email protected])':
+ '@typescript-eslint/[email protected]([email protected])([email protected])':
dependencies:
- '@eslint-community/eslint-utils': 4.4.1([email protected])
+ '@eslint-community/eslint-utils': 4.4.1([email protected])
'@typescript-eslint/scope-manager': 8.14.0
'@typescript-eslint/types': 8.14.0
'@typescript-eslint/typescript-estree': 8.14.0([email protected])
- eslint: 9.15.0
+ eslint: 9.16.0
transitivePeerDependencies:
- supports-color
- typescript
- '@typescript-eslint/[email protected]([email protected])([email protected])':
+ '@typescript-eslint/[email protected]([email protected])([email protected])':
dependencies:
- '@eslint-community/eslint-utils': 4.4.1([email protected])
+ '@eslint-community/eslint-utils': 4.4.1([email protected])
'@typescript-eslint/scope-manager': 8.16.0
'@typescript-eslint/types': 8.16.0
'@typescript-eslint/typescript-estree': 8.16.0([email protected])
- eslint: 9.15.0
+ eslint: 9.16.0
optionalDependencies:
typescript: 5.7.2
transitivePeerDependencies:
@@ -8553,23 +8547,23 @@ snapshots:
optionalDependencies:
source-map: 0.6.1
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
- eslint: 9.15.0
+ eslint: 9.16.0
semver: 7.6.3
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
- eslint: 9.15.0
+ eslint: 9.16.0
semver: 7.6.3
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
- eslint: 9.15.0
+ eslint: 9.16.0
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
- eslint: 9.15.0
+ eslint: 9.16.0
optionator: 0.9.4
[email protected]:
@@ -8580,54 +8574,54 @@ snapshots:
strip-ansi: 5.2.0
text-table: 0.2.0
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
'@ianvs/eslint-stats': 2.0.0
chalk: 4.1.2
- eslint: 9.15.0
- eslint-filtered-fix: 0.3.0([email protected])
+ eslint: 9.16.0
+ eslint-filtered-fix: 0.3.0([email protected])
eslint-formatter-friendly: 7.0.0
eslint-summary: 1.0.0
inquirer: 8.2.6
optionator: 0.9.4
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
- '@eslint-community/eslint-utils': 4.4.1([email protected])
+ '@eslint-community/eslint-utils': 4.4.1([email protected])
'@eslint-community/regexpp': 4.12.1
- eslint: 9.15.0
- eslint-compat-utils: 0.5.1([email protected])
+ eslint: 9.16.0
+ eslint-compat-utils: 0.5.1([email protected])
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
- '@eslint-community/eslint-utils': 4.4.1([email protected])
+ '@eslint-community/eslint-utils': 4.4.1([email protected])
enhanced-resolve: 5.17.1
- eslint: 9.15.0
- eslint-plugin-es-x: 7.8.0([email protected])
+ eslint: 9.16.0
+ eslint-plugin-es-x: 7.8.0([email protected])
get-tsconfig: 4.8.1
globals: 15.13.0
ignore: 5.3.2
minimatch: 9.0.5
semver: 7.6.3
- [email protected](@types/[email protected])([email protected]([email protected]))([email protected])([email protected]):
+ [email protected](@types/[email protected])([email protected]([email protected]))([email protected])([email protected]):
dependencies:
- eslint: 9.15.0
+ eslint: 9.16.0
prettier: 3.4.1
prettier-linter-helpers: 1.0.0
synckit: 0.9.2
optionalDependencies:
'@types/eslint': 9.6.1
- eslint-config-prettier: 9.1.0([email protected])
+ eslint-config-prettier: 9.1.0([email protected])
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
'@babel/helper-validator-identifier': 7.25.9
- '@eslint-community/eslint-utils': 4.4.1([email protected])
+ '@eslint-community/eslint-utils': 4.4.1([email protected])
ci-info: 4.0.0
clean-regexp: 1.0.0
core-js-compat: 3.39.0
- eslint: 9.15.0
+ eslint: 9.16.0
esquery: 1.6.0
globals: 15.13.0
indent-string: 4.0.0
@@ -8640,11 +8634,11 @@ snapshots:
semver: 7.6.3
strip-indent: 3.0.0
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
debug: 4.3.7
- eslint: 9.15.0
- eslint-compat-utils: 0.6.4([email protected])
+ eslint: 9.16.0
+ eslint-compat-utils: 0.6.4([email protected])
lodash: 4.17.21
natural-compare: 1.4.0
yaml-eslint-parser: 1.2.3
@@ -8682,7 +8676,7 @@ snapshots:
'@ungap/structured-clone': 1.2.0
ajv: 6.12.6
chalk: 4.1.2
- cross-spawn: 7.0.3
+ cross-spawn: 7.0.6
debug: 4.3.7
doctrine: 3.0.0
escape-string-regexp: 4.0.0
@@ -8713,14 +8707,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
- [email protected]:
+ [email protected]:
dependencies:
- '@eslint-community/eslint-utils': 4.4.1([email protected])
+ '@eslint-community/eslint-utils': 4.4.1([email protected])
'@eslint-community/regexpp': 4.12.1
'@eslint/config-array': 0.19.0
'@eslint/core': 0.9.0
'@eslint/eslintrc': 3.2.0
- '@eslint/js': 9.15.0
+ '@eslint/js': 9.16.0
'@eslint/plugin-kit': 0.2.3
'@humanfs/node': 0.16.6
'@humanwhocodes/module-importer': 1.0.1
@@ -8804,7 +8798,7 @@ snapshots:
[email protected]:
dependencies:
- cross-spawn: 7.0.3
+ cross-spawn: 7.0.6
get-stream: 8.0.1
human-signals: 5.0.0
is-stream: 3.0.0
@@ -8938,7 +8932,7 @@ snapshots:
[email protected]:
dependencies:
- cross-spawn: 7.0.3
+ cross-spawn: 7.0.6
signal-exit: 4.1.0
[email protected]: {}
|
dc434a6f2d3ccc2defe99387ac56b2f0197f8942
|
2024-11-05 21:05:36
|
dependabot[bot]
|
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#17455)
| false
|
bump @typescript-eslint/eslint-plugin (#17455)
|
chore
|
diff --git a/package.json b/package.json
index 145c44770479ee..6558356f5bdd2c 100644
--- a/package.json
+++ b/package.json
@@ -166,7 +166,7 @@
"@types/tiny-async-pool": "2.0.3",
"@types/title": "3.4.3",
"@types/uuid": "10.0.0",
- "@typescript-eslint/eslint-plugin": "8.12.2",
+ "@typescript-eslint/eslint-plugin": "8.13.0",
"@typescript-eslint/parser": "8.13.0",
"@vercel/nft": "0.27.5",
"@vitest/coverage-v8": "2.0.5",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index bd8010a6e3c2b0..60f1c0b3719ae2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -355,8 +355,8 @@ importers:
specifier: 10.0.0
version: 10.0.0
'@typescript-eslint/eslint-plugin':
- specifier: 8.12.2
- version: 8.12.2(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
+ specifier: 8.13.0
+ version: 8.13.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
'@typescript-eslint/parser':
specifier: 8.13.0
version: 8.13.0([email protected])([email protected])
@@ -1959,8 +1959,8 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==}
- '@typescript-eslint/[email protected]':
- resolution: {integrity: sha512-gQxbxM8mcxBwaEmWdtLCIGLfixBMHhQjBqR8sVWNTPpcj45WlYL2IObS/DNMLH1DBP0n8qz+aiiLTGfopPEebw==}
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-nQtBLiZYMUPkclSeC3id+x4uVd1SGtHuElTxL++SfP47jR0zfkZBJHc+gL4qPsgTuypz0k8Y2GheaDYn6Gy3rg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
'@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
@@ -1988,8 +1988,8 @@ packages:
resolution: {integrity: sha512-XsGWww0odcUT0gJoBZ1DeulY1+jkaHUciUq4jKNv4cpInbvvrtDoyBH9rE/n2V29wQJPk8iCH1wipra9BhmiMA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@typescript-eslint/[email protected]':
- resolution: {integrity: sha512-bwuU4TAogPI+1q/IJSKuD4shBLc/d2vGcRT588q+jzayQyjVK2X6v/fbR4InY2U2sgf8MEvVCqEWUzYzgBNcGQ==}
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-Rqnn6xXTR316fP4D2pohZenJnp+NwQ1mo7/JM+J1LWZENSLkJI8ID8QNtlvFeb0HnFSK94D6q0cnMX6SbE5/vA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '*'
@@ -2029,6 +2029,12 @@ packages:
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-A1EeYOND6Uv250nybnLZapeXpYMl8tkzYUxqmoKAWnI4sei3ihf2XdZVd+vVOmHGcp3t+P7yRrNsyyiXTvShFQ==}
+ engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+ peerDependencies:
+ eslint: ^8.57.0 || ^9.0.0
+
'@typescript-eslint/[email protected]':
resolution: {integrity: sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@@ -7491,14 +7497,14 @@ snapshots:
'@types/node': 22.8.7
optional: true
- '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])':
+ '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])':
dependencies:
'@eslint-community/regexpp': 4.12.1
'@typescript-eslint/parser': 8.13.0([email protected])([email protected])
- '@typescript-eslint/scope-manager': 8.12.2
- '@typescript-eslint/type-utils': 8.12.2([email protected])([email protected])
- '@typescript-eslint/utils': 8.12.2([email protected])([email protected])
- '@typescript-eslint/visitor-keys': 8.12.2
+ '@typescript-eslint/scope-manager': 8.13.0
+ '@typescript-eslint/type-utils': 8.13.0([email protected])([email protected])
+ '@typescript-eslint/utils': 8.13.0([email protected])([email protected])
+ '@typescript-eslint/visitor-keys': 8.13.0
eslint: 9.14.0
graphemer: 1.4.0
ignore: 5.3.2
@@ -7532,10 +7538,10 @@ snapshots:
'@typescript-eslint/types': 8.13.0
'@typescript-eslint/visitor-keys': 8.13.0
- '@typescript-eslint/[email protected]([email protected])([email protected])':
+ '@typescript-eslint/[email protected]([email protected])([email protected])':
dependencies:
- '@typescript-eslint/typescript-estree': 8.12.2([email protected])
- '@typescript-eslint/utils': 8.12.2([email protected])([email protected])
+ '@typescript-eslint/typescript-estree': 8.13.0([email protected])
+ '@typescript-eslint/utils': 8.13.0([email protected])([email protected])
debug: 4.3.7
ts-api-utils: 1.4.0([email protected])
optionalDependencies:
@@ -7589,6 +7595,17 @@ snapshots:
- supports-color
- typescript
+ '@typescript-eslint/[email protected]([email protected])([email protected])':
+ dependencies:
+ '@eslint-community/eslint-utils': 4.4.1([email protected])
+ '@typescript-eslint/scope-manager': 8.13.0
+ '@typescript-eslint/types': 8.13.0
+ '@typescript-eslint/typescript-estree': 8.13.0([email protected])
+ eslint: 9.14.0
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+
'@typescript-eslint/[email protected]':
dependencies:
'@typescript-eslint/types': 8.12.2
@@ -8879,7 +8896,7 @@ snapshots:
[email protected]:
dependencies:
- debug: 4.3.4
+ debug: 4.3.7
get-stream: 5.2.0
yauzl: 2.10.0
optionalDependencies:
@@ -10596,7 +10613,7 @@ snapshots:
[email protected]:
dependencies:
agent-base: 7.1.1
- debug: 4.3.4
+ debug: 4.3.7
http-proxy-agent: 7.0.2
https-proxy-agent: 7.0.5
lru-cache: 7.18.3
|
8066ff5f5a26adbbfc9e3e2e102a9fa1fc8f9853
|
2019-12-23 14:52:39
|
dependabot-preview[bot]
|
chore(deps-dev): bump eslint from 6.7.2 to 6.8.0 (#3611)
| false
|
bump eslint from 6.7.2 to 6.8.0 (#3611)
|
chore
|
diff --git a/package.json b/package.json
index 04c57145015b8a..798454172f8ac5 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
"@vuepress/plugin-pwa": "1.2.0",
"cross-env": "6.0.3",
"entities": "2.0.0",
- "eslint": "6.7.2",
+ "eslint": "6.8.0",
"eslint-config-prettier": "6.7.0",
"eslint-plugin-prettier": "3.1.2",
"jest": "24.9.0",
diff --git a/yarn.lock b/yarn.lock
index 3d2799a9015f5b..06f6243c1217ca 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4143,10 +4143,10 @@ eslint-visitor-keys@^1.1.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==
[email protected]:
- version "6.7.2"
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.7.2.tgz#c17707ca4ad7b2d8af986a33feba71e18a9fecd1"
- integrity sha512-qMlSWJaCSxDFr8fBPvJM9kJwbazrhNcBU3+DszDW1OlEwKBBRWsJc7NJFelvwQpanHCR14cOLD41x8Eqvo3Nng==
[email protected]:
+ version "6.8.0"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb"
+ integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==
dependencies:
"@babel/code-frame" "^7.0.0"
ajv "^6.10.0"
|
dee34c01304d99d171a047ebf327c262ff8d61b3
|
2022-02-13 03:03:04
|
zytomorrow
|
feat(route): add 德阳市政府公开信息 (#9074)
| false
|
add 德阳市政府公开信息 (#9074)
|
feat
|
diff --git a/docs/government.md b/docs/government.md
index 3aa08f8c78a5e9..48d6af5430d412 100644
--- a/docs/government.md
+++ b/docs/government.md
@@ -406,6 +406,12 @@ pageClass: routes
</Route>
+## 德阳市人民政府
+
+### 德阳市政府公开信息
+
+<Route author="zytomorrow" example="/gov/sichuan/deyang/govpulicinfo/德阳市市/市人社局" path="/gov/sichuan/deyang/govpulicinfo/:countyName/:institutionName?" :paramsDesc="['区县名。德阳市、绵竹市、广汉市、什邡市、中江县、罗江区、旌阳区、高新区', '单位名称。可直接输入网页显示单位名称']"/>
+
## 中国工业和信息化部
### 政策解读
diff --git a/lib/v2/gov/maintainer.js b/lib/v2/gov/maintainer.js
index 3c8b3f0b1132eb..7c09586eb091a7 100644
--- a/lib/v2/gov/maintainer.js
+++ b/lib/v2/gov/maintainer.js
@@ -6,4 +6,5 @@ module.exports = {
'/guangdong/tqyb/tfxtq': ['Fatpandac'],
'/guangdong/tqyb/sncsyjxh': ['Fatpandac'],
'/huizhou/zwgk/:category?': ['Fatpandac'],
+ '/sichuan/deyang/govpulicinfo/:countyName/:institutionName?': ['zytomorrow'],
};
diff --git a/lib/v2/gov/radar.js b/lib/v2/gov/radar.js
index 1ffc688132fceb..fd778aa54efb76 100644
--- a/lib/v2/gov/radar.js
+++ b/lib/v2/gov/radar.js
@@ -365,4 +365,15 @@ module.exports = {
},
],
},
+ 'deyang.gov.cn': {
+ _name: '德阳市人民政府',
+ '.': [
+ {
+ title: '德阳市政府公开信息',
+ docs: 'https://docs.rsshub.app/government.html#de-yang-shi-fu-ren-min-zheng-zheng-fu',
+ source: ['/*'],
+ target: '/sichuan/deyang/govpulicinfo/:countyName/:institutionName?',
+ },
+ ],
+ },
};
diff --git a/lib/v2/gov/router.js b/lib/v2/gov/router.js
index 7e6639c26726e2..892355701e7225 100644
--- a/lib/v2/gov/router.js
+++ b/lib/v2/gov/router.js
@@ -7,4 +7,5 @@ module.exports = function (router) {
router.get('/guangdong/tqyb/tfxtq', require('./guangdong/tqyb/tfxtq'));
router.get('/guangdong/tqyb/sncsyjxh', require('./guangdong/tqyb/sncsyjxh'));
router.get('/huizhou/zwgk/:category?', require('./huizhou/zwgk/index'));
+ router.get('/sichuan/deyang/govpulicinfo/:countyName/:institutionName?', require('./sichuan/deyang/govpulicinfo'));
};
diff --git a/lib/v2/gov/sichuan/deyang/govpulicinfo.js b/lib/v2/gov/sichuan/deyang/govpulicinfo.js
new file mode 100644
index 00000000000000..84db4fcf2c1a99
--- /dev/null
+++ b/lib/v2/gov/sichuan/deyang/govpulicinfo.js
@@ -0,0 +1,115 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+const rootUrl = 'http://xxgk.deyang.gov.cn/xxgkml2020';
+
+// 地区名称对照表
+const nameDict = {
+ 德阳市: 'dys',
+ 绵竹市: 'mzs',
+ 什邡市: 'sfs',
+ 旌阳区: 'jyq',
+ 罗江区: 'ljx',
+ 广汉市: 'ghs',
+ 中江县: 'zjx',
+ 高新区: 'gxq',
+};
+
+const getInstitutionId = async (ctx, county) => {
+ const url = `${rootUrl}/ptlj.jsp?regionName=${county}`;
+
+ return await ctx.cache.tryGet(`${county}InstitutionId`, async () => {
+ const response = await got.get(url);
+ const $ = cheerio.load(response.data);
+ const dataList = $('#details_content > div > div > div > div:nth-child(4) > ul > li > a');
+ const _tmp = {};
+ for (let i = 0; i < dataList.length; i++) {
+ _tmp[$(dataList[i]).html()] = parseInt($(dataList[i]).attr('href').split('deptId=')[1]);
+ }
+ return _tmp;
+ });
+};
+
+const getInfoUrlList = async (county, institutionId) => {
+ const url = `${rootUrl}/gklist_iframe.jsp?deptId=${institutionId}®ionName=${county}&pageSize=15`;
+ const response = await got.get(url);
+ const $ = cheerio.load(response.data);
+ const pageNum = parseInt($('#list_content > div > span:nth-child(3)').html().match(/\d*/g)[1]);
+ const pageUrlList = [];
+
+ // 此处建议限制最大pageNum,最大5页,单页15条
+ for (let i = 1; i <= Math.min(pageNum, 5); i++) {
+ pageUrlList.push(`${rootUrl}/gklist_iframe.jsp?deptId=${institutionId}®ionName=${county}&pageSize=15$pageIndex=${i}`);
+ }
+ const _tmpList = await Promise.all(
+ pageUrlList.map(async (url) => {
+ const response = await got.get(url);
+ const $ = cheerio.load(response.data);
+ const InfoList = $('#list_content > ul > li > a');
+ return InfoList.map((item) => `${rootUrl}/${$(InfoList[item]).attr('href')}`);
+ })
+ );
+ let infoUrlList = [];
+ for (let i = 0; i < _tmpList.length; i++) {
+ infoUrlList = infoUrlList.concat(_tmpList[i].toArray());
+ }
+ return infoUrlList;
+};
+
+const getInfoContent = async (ctx, url) => {
+ const infoId = url.split('id=')[1].split('&type')[0];
+ return await ctx.cache.tryGet(`govPublicInfo${infoId}`, async () => {
+ const response = await got.get(url);
+ const $ = cheerio.load(response.data);
+ const fileNodes = $('#symbol > div:nth-child(3) > div > a');
+ const fileList = [];
+ for (let i = 0; i < fileNodes.length; i++) {
+ fileList.push({
+ name: $(fileNodes[i]).text(),
+ url: `${rootUrl}/${$(fileNodes[i]).attr('href')}`,
+ });
+ }
+ const rawDate = $('#symbol > div:nth-child(1) > div:nth-child(3)').text().split('\n')[1].trim();
+ return {
+ title: $('#headline').text(),
+ id: infoId,
+ infoNum: $('#symbol > div:nth-child(1) > div:nth-child(2) > span').text().split('\n')[1].trim(),
+ pubDate: parseDate(rawDate),
+ date: rawDate,
+ keyWord: $('#symbol > div:nth-child(2) > div:nth-child(1)').text().slice(8),
+ source: $('#symbol > div:nth-child(2) > div:nth-child(3)').text().slice(5),
+ content: $('#details_content > div.content').html(),
+ file: fileList,
+ link: url,
+ };
+ });
+};
+
+module.exports = async (ctx) => {
+ const countyName = ctx.params.countyName;
+ const county = nameDict[countyName];
+ const institutionName = ctx.params.institutionName || '';
+ let institutionId = 0;
+ if (institutionName) {
+ const institutionDict = await getInstitutionId(ctx, county);
+ institutionId = institutionDict[institutionName];
+ }
+
+ const infoUrlList = await getInfoUrlList(county, institutionId);
+ const items = await Promise.all(infoUrlList.map(async (item) => await getInfoContent(ctx, item)));
+
+ ctx.state.data = {
+ title: `政府公开信息 - ${countyName} ${institutionName}`,
+ link: `${rootUrl}/gklist_iframe.jsp?deptId=${institutionId}®ionName=${county}`,
+ item: items.map((item) => ({
+ title: item.title,
+ description: art(path.resolve(__dirname, './templates/govPublicInfo.art'), { item }),
+ link: item.link,
+ guid: item.id,
+ pubDate: item.pubDate,
+ })),
+ };
+};
diff --git a/lib/v2/gov/sichuan/deyang/templates/govPublicInfo.art b/lib/v2/gov/sichuan/deyang/templates/govPublicInfo.art
new file mode 100644
index 00000000000000..e8b9284b6c7bad
--- /dev/null
+++ b/lib/v2/gov/sichuan/deyang/templates/govPublicInfo.art
@@ -0,0 +1,41 @@
+<table border="1" cellpadding="2" cellspacing="0" align="center">
+ <tbody>
+ <tr>
+ <td>索引号</td>
+ <td>{{item.id}}</td>
+ </tr>
+ <tr>
+ <td>文号</td>
+ <td>{{item.infoNum}}</td>
+ </tr>
+ <tr>
+ <td>发文日期</td>
+ <td>{{item.date}}</td>
+ </tr>
+ <tr>
+ <td>关键词</td>
+ <td>{{item.keyWord}}</td>
+ </tr>
+ <tr>
+ <td>信息来源</td>
+ <td>{{item.source}}</td>
+ </tr>
+ {{if item.file.length}}
+ <tr>
+ <td>附件</td>
+ <td>
+ {{each item.file}}
+ <a href="{{$value.url}}">{{$value.name}}</a><br>
+ {{/each}}
+ </td>
+ </tr>
+ {{/if}}
+ </tbody>
+</table>
+
+<div>
+ {{@ item.content}}
+</div>
+
+
+
|
d73a0382521e922fabf15a920edbd36e10a15fb8
|
2020-02-15 19:01:36
|
DIYgod
|
feat: limit t66y
| false
|
limit t66y
|
feat
|
diff --git a/lib/routes/t66y/index.js b/lib/routes/t66y/index.js
index af0605286ab06a..2e9095b8f08843 100644
--- a/lib/routes/t66y/index.js
+++ b/lib/routes/t66y/index.js
@@ -43,7 +43,7 @@ module.exports = async (ctx) => {
list = $('.tr2', list)
.not('.tr2.tac')
.nextAll()
- .slice(0, -1)
+ .slice(0, 25)
.get();
const parseContent = (htmlString) => {
|
7e94e4e306e0ff552cfa9d319a393fdeae0ef341
|
2025-03-03 16:53:57
|
dependabot[bot]
|
chore(deps-dev): bump prettier from 3.5.2 to 3.5.3 (#18499)
| false
|
bump prettier from 3.5.2 to 3.5.3 (#18499)
|
chore
|
diff --git a/package.json b/package.json
index dcffd9bc0647f4..ab42de42b3f17f 100644
--- a/package.json
+++ b/package.json
@@ -188,7 +188,7 @@
"mockdate": "3.0.5",
"msw": "2.4.3",
"node-network-devtools": "1.0.25",
- "prettier": "3.5.2",
+ "prettier": "3.5.3",
"remark-parse": "11.0.0",
"supertest": "7.0.0",
"typescript": "5.7.3",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e467cfdf93aae2..560ae4dec33fdf 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -392,7 +392,7 @@ importers:
version: 17.16.1([email protected])([email protected])
eslint-plugin-prettier:
specifier: 5.2.3
- version: 5.2.3(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])
+ version: 5.2.3(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])
eslint-plugin-unicorn:
specifier: 57.0.0
version: 57.0.0([email protected])
@@ -427,8 +427,8 @@ importers:
specifier: 1.0.25
version: 1.0.25([email protected])([email protected])([email protected])
prettier:
- specifier: 3.5.2
- version: 3.5.2
+ specifier: 3.5.3
+ version: 3.5.3
remark-parse:
specifier: 11.0.0
version: 11.0.0
@@ -5456,8 +5456,8 @@ packages:
resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==}
engines: {node: '>=6.0.0'}
- [email protected]:
- resolution: {integrity: sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg==}
+ [email protected]:
+ resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==}
engines: {node: '>=14'}
hasBin: true
@@ -10559,10 +10559,10 @@ snapshots:
- supports-color
- typescript
- [email protected](@types/[email protected])([email protected]([email protected]))([email protected])([email protected]):
+ [email protected](@types/[email protected])([email protected]([email protected]))([email protected])([email protected]):
dependencies:
eslint: 9.21.0
- prettier: 3.5.2
+ prettier: 3.5.3
prettier-linter-helpers: 1.0.0
synckit: 0.9.2
optionalDependencies:
@@ -12836,7 +12836,7 @@ snapshots:
dependencies:
fast-diff: 1.3.0
- [email protected]: {}
+ [email protected]: {}
[email protected]: {}
|
7175ab0fddfcfc892aac60d271bbcad1661d4063
|
2024-06-03 21:07:26
|
Franklin Yu
|
feat(route): add Bugzilla (#15798)
| false
|
add Bugzilla (#15798)
|
feat
|
diff --git a/lib/routes/bugzilla/bug.ts b/lib/routes/bugzilla/bug.ts
new file mode 100644
index 00000000000000..202ccb64802387
--- /dev/null
+++ b/lib/routes/bugzilla/bug.ts
@@ -0,0 +1,58 @@
+import { load } from 'cheerio';
+import { Context } from 'hono';
+import InvalidParameterError from '@/errors/types/invalid-parameter';
+import { Data, DataItem, Route } from '@/types';
+import ofetch from '@/utils/ofetch';
+import { parseDate } from '@/utils/parse-date';
+
+const INSTANCES = new Map([
+ ['apache', 'bz.apache.org/bugzilla'],
+ ['apache.ooo', 'bz.apache.org/ooo'], // Apache OpenOffice
+ ['apache.SpamAssassin', 'bz.apache.org/SpamAssassin'],
+ ['mozilla', 'bugzilla.mozilla.org'],
+ ['webkit', 'bugs.webkit.org'],
+]);
+
+async function handler(ctx: Context): Promise<Data> {
+ const { site, bugId } = ctx.req.param();
+ if (!INSTANCES.has(site)) {
+ throw new InvalidParameterError(`unknown site: ${site}`);
+ }
+ const link = `https://${INSTANCES.get(site)}/show_bug.cgi?id=${bugId}`;
+ const $ = load(await ofetch(`${link}&ctype=xml`));
+ const items = $('long_desc').map((index, rawItem) => {
+ const $ = load(rawItem, null, false);
+ return {
+ title: `comment #${$('commentid').text()}`,
+ link: `${link}#c${index}`,
+ description: $('thetext').text(),
+ pubDate: parseDate($('bug_when').text()),
+ author: $('who').attr('name'),
+ } as DataItem;
+ });
+ return { title: $('short_desc').text(), link, item: items.toArray() };
+}
+
+function markdownFrom(instances: Map<string, string>, separator: string = ', '): string {
+ return [...instances.entries()].map(([k, v]) => `[\`${k}\`](https://${v})`).join(separator);
+}
+
+export const route: Route = {
+ path: '/bug/:site/:bugId',
+ name: 'bugs',
+ maintainers: ['FranklinYu'],
+ handler,
+ example: '/bug/webkit/251528',
+ parameters: {
+ site: 'site identifier',
+ bugId: 'numeric identifier of the bug in the site',
+ },
+ description: `Supported site identifiers: ${markdownFrom(INSTANCES)}.`,
+ categories: ['programming'],
+
+ // Radar is infeasible, because it needs access to URL parameters.
+ zh: {
+ name: 'bugs',
+ description: `支持的站点标识符:${markdownFrom(INSTANCES, '、')}。`,
+ },
+};
diff --git a/lib/routes/bugzilla/namespace.ts b/lib/routes/bugzilla/namespace.ts
new file mode 100644
index 00000000000000..70ac839cb0f7d8
--- /dev/null
+++ b/lib/routes/bugzilla/namespace.ts
@@ -0,0 +1,11 @@
+import type { Namespace } from '@/types';
+
+export const namespace: Namespace = {
+ name: 'Bugzilla',
+ url: 'bugzilla.org',
+ description: 'Bugzilla instances hosted by organizations.',
+ zh: {
+ name: 'Bugzilla',
+ description: '各组织自建的Bugzilla实例。',
+ },
+};
|
ac0db083a164dc31dbbc3ea88b43de591afffef9
|
2020-06-16 03:40:13
|
dependabot-preview[bot]
|
chore(deps-dev): bump @vuepress/plugin-back-to-top from 1.5.1 to 1.5.2
| false
|
bump @vuepress/plugin-back-to-top from 1.5.1 to 1.5.2
|
chore
|
diff --git a/package.json b/package.json
index 4543ffa0c9bd60..e67269f646c80a 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,7 @@
"@types/cheerio": "0.22.18",
"@types/got": "9.6.11",
"@types/koa": "2.11.3",
- "@vuepress/plugin-back-to-top": "1.5.1",
+ "@vuepress/plugin-back-to-top": "1.5.2",
"@vuepress/plugin-google-analytics": "1.5.1",
"@vuepress/plugin-pwa": "1.5.1",
"cross-env": "7.0.2",
diff --git a/yarn.lock b/yarn.lock
index b31e1b41f7f5a2..0125d654938dd9 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1877,10 +1877,10 @@
dependencies:
lodash.debounce "^4.0.8"
-"@vuepress/[email protected]":
- version "1.5.1"
- resolved "https://registry.yarnpkg.com/@vuepress/plugin-back-to-top/-/plugin-back-to-top-1.5.1.tgz#bafd45267419ff54b46cbb2626500e4803ab1f13"
- integrity sha512-YP1h+oLhhjtUhoyg7418D+Nazdczqo36gevJwV1Zgtqs8PJ970aa8+UrSI5+uN/bRVRn0FUSsgRLF3jIM8wnwg==
+"@vuepress/[email protected]":
+ version "1.5.2"
+ resolved "https://registry.yarnpkg.com/@vuepress/plugin-back-to-top/-/plugin-back-to-top-1.5.2.tgz#d253be7f0b7c2b59ca8fabe10c2f517c96d83b0e"
+ integrity sha512-eLieTccUQ8XdIqQXWyp0bftfud9js1idHFFyxuhHWSYAco/vTp7wLz7JdFqr8GnFye9y88B1y34iLnbZLiBlmA==
dependencies:
lodash.debounce "^4.0.8"
|
9852d9d1dc992248dc943199bbbd3825c0566bbc
|
2024-10-19 10:20:52
|
pseudoyu
|
feat(route/fediverse): try official rss first to reduce requests
| false
|
try official rss first to reduce requests
|
feat
|
diff --git a/lib/routes/fediverse/timeline.ts b/lib/routes/fediverse/timeline.ts
index dc199a2d8c48f9..7fce06307e99b7 100644
--- a/lib/routes/fediverse/timeline.ts
+++ b/lib/routes/fediverse/timeline.ts
@@ -5,6 +5,7 @@ import { parseDate } from '@/utils/parse-date';
import ofetch from '@/utils/ofetch';
import { config } from '@/config';
import ConfigNotFoundError from '@/errors/types/config-not-found';
+import parser from '@/utils/rss-parser';
export const route: Route = {
path: '/timeline/:account',
@@ -21,7 +22,7 @@ export const route: Route = {
supportScihub: false,
},
name: 'Timeline',
- maintainers: ['DIYgod'],
+ maintainers: ['DIYgod', 'pseudoyu'],
handler,
};
@@ -51,12 +52,29 @@ async function handler(ctx) {
Accept: 'application/jrd+json',
},
});
-
const jsonLink = acc.links.find((link) => link.rel === 'self' && activityPubTypes.has(link.type))?.href;
const link = acc.links.find((link) => link.rel === 'http://webfinger.net/rel/profile-page')?.href;
+ const officialFeed = await parser.parseURL(`${link}.rss`);
+
+ if (officialFeed) {
+ return {
+ title: `${officialFeed.title} (Fediverse@${account})`,
+ description: officialFeed.description,
+ image: officialFeed.image?.url,
+ link: officialFeed.link,
+ item: officialFeed.items.map((item) => ({
+ title: item.title,
+ description: item.content,
+ link: item.link,
+ pubDate: item.pubDate ? parseDate(item.pubDate) : null,
+ guid: item.guid,
+ })),
+ };
+ }
const self = await ofetch(jsonLink, requestOptions);
+ // If RSS feed is not available, fallback to original method
const outbox = await ofetch(self.outbox, requestOptions);
const firstOutbox = await ofetch(outbox.first, requestOptions);
|
7d71b57036544e8fbfaffba2fdd729eb537f39bd
|
2023-11-24 04:17:16
|
dependabot[bot]
|
chore(deps-dev): bump @stylistic/eslint-plugin-js from 1.4.0 to 1.4.1 (#13876)
| false
|
bump @stylistic/eslint-plugin-js from 1.4.0 to 1.4.1 (#13876)
|
chore
|
diff --git a/package.json b/package.json
index c6d0aebb051a7c..f1c580b03627be 100644
--- a/package.json
+++ b/package.json
@@ -150,7 +150,7 @@
},
"devDependencies": {
"@microsoft/eslint-formatter-sarif": "3.0.0",
- "@stylistic/eslint-plugin-js": "1.4.0",
+ "@stylistic/eslint-plugin-js": "1.4.1",
"@types/aes-js": "3.1.4",
"@types/crypto-js": "4.2.1",
"@types/eslint": "8.44.7",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index abaf43ca619580..e6001de41fb372 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -203,8 +203,8 @@ devDependencies:
specifier: 3.0.0
version: 3.0.0
'@stylistic/eslint-plugin-js':
- specifier: 1.4.0
- version: 1.4.0
+ specifier: 1.4.1
+ version: 1.4.1([email protected])
'@types/aes-js':
specifier: 3.1.4
version: 3.1.4
@@ -1319,11 +1319,15 @@ packages:
'@sinonjs/commons': 3.0.0
dev: true
- /@stylistic/[email protected]:
- resolution: {integrity: sha512-cANyn4ECWu8kxPmBM4K/Q4WocD3JbA0POmGbA2lJ4tynPE8jGyKpfP8SZj6BIidXV0pkyqvxEfaKppB4D16UsA==}
+ /@stylistic/[email protected]([email protected]):
+ resolution: {integrity: sha512-WXHPEVw5PB7OML7cLwHJDEcCyLiP7vzKeBbSwmpHLK0oh0JYkoJfTg2hEdFuQT5rQxFy3KzCy9R1mZ0wgLjKrA==}
+ engines: {node: ^16.0.0 || >=18.0.0}
+ peerDependencies:
+ eslint: '>=8.40.0'
dependencies:
acorn: 8.11.2
escape-string-regexp: 4.0.0
+ eslint: 8.54.0
eslint-visitor-keys: 3.4.3
espree: 9.6.1
graphemer: 1.4.0
|
1da57d937bb77593a3fc3f9ce8392a28f869fa74
|
2020-01-14 11:57:52
|
Twinkle
|
feat: add ddrk.me (#3738)
| false
|
add ddrk.me (#3738)
|
feat
|
diff --git a/docs/multimedia.md b/docs/multimedia.md
index 251df185fe2bbb..8f736dc46039e3 100644
--- a/docs/multimedia.md
+++ b/docs/multimedia.md
@@ -420,3 +420,9 @@ pageClass: routes
### 影视
<Route author="DIYgod" example="/zimuzu/resource/37031" path="/zimuzu/resource/:id?" :paramsDesc="['影视 id,对应影视的 URL 中找到,为空时输出最近更新']" supportBT="1"/>
+
+## 低端影视
+
+### 影视剧集
+
+<Route author="saintwinkle" example="/ddrk/silicon-valley/6" path="/ddrk/:name/:season?" :paramsDesc="['影视名称,可以在 URL 中找到','季数,可以在 URL 中找到,剧集没有分季时不用填写,或是默认输出第一季的内容,']" />
diff --git a/lib/router.js b/lib/router.js
index e140d00e434f74..4905534d5811f1 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -2098,6 +2098,9 @@ router.get('/mlog-club/projects', require('./routes/mlog-club/projects'));
// Chrome 网上应用店
router.get('/chrome/webstore/extensions/:id', require('./routes/chrome/extensions'));
+// 低端影视
+router.get('/ddrk/:name/:season?', require('./routes/ddrk/index'));
+
// 公主链接日服公告
router.get('/pcr/news', require('./routes/pcr/news'));
diff --git a/lib/routes/ddrk/index.js b/lib/routes/ddrk/index.js
new file mode 100644
index 00000000000000..70a352a5cd1667
--- /dev/null
+++ b/lib/routes/ddrk/index.js
@@ -0,0 +1,32 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const name = ctx.params.name;
+ const season = ctx.params.season;
+
+ let link = `https://ddrk.me/${name}/`;
+
+ if (season) {
+ link += `${season}/`;
+ }
+
+ const response = await got(link);
+ const $ = cheerio.load(response.body);
+
+ const title = $('title').html();
+ const description = $('.abstract').html();
+ const tracks = JSON.parse($('.wp-playlist-script').html()).tracks.reverse();
+ const total = tracks.length;
+
+ ctx.state.data = {
+ title,
+ link,
+ description,
+ item: tracks.map(({ caption, description }, index) => ({
+ title: caption,
+ link: `${link}?ep=${total - index}`,
+ description,
+ })),
+ };
+};
|
6e244aaee87b746c46d9b328e00133ae84dea568
|
2023-12-30 21:39:54
|
欠陥電気
|
feat(route): id param for shmeea (#14145)
| false
|
id param for shmeea (#14145)
|
feat
|
diff --git a/lib/v2/shmeea/index.js b/lib/v2/shmeea/index.js
index 14067fd34ddfb9..6fc1c22f3956d9 100644
--- a/lib/v2/shmeea/index.js
+++ b/lib/v2/shmeea/index.js
@@ -1,44 +1,53 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
+const timezone = require('@/utils/timezone');
+const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
- const baseURL = 'http://www.shmeea.edu.cn';
- const rootUrl = baseURL + '/page/08000/index.html';
- const response = await got({
- method: 'get',
- url: rootUrl,
- });
+ const id = ctx.params.id ?? '08000';
+ const baseURL = 'https://www.shmeea.edu.cn';
+ const link = `${baseURL}/page/${id}/index.html`;
- const data = response.data;
+ const response = await got(link);
+ const $ = cheerio.load(response.data);
- const $ = cheerio.load(data);
+ const title = `上海市教育考试院-${$('#main .pageh4-tit').text().trim()}`;
- const list = $('#main .pageList li');
+ const list = $('#main .pageList li')
+ .toArray()
+ .map((item) => {
+ item = $(item);
+ return {
+ title: item.find('a').attr('title') || item.find('a').text(),
+ link: new URL(item.find('a').attr('href'), baseURL).href,
+ pubDate: parseDate(item.find('.listTime').text().trim(), 'YYYY-MM-DD'),
+ };
+ });
const items = await Promise.all(
- list.map(async (i, item) => {
- item = $(item);
- const link = baseURL + item.find('a').attr('href');
- const description = await ctx.cache.tryGet(link, async () => {
- const result = await got.get(link);
+ list.map((item) =>
+ ctx.cache.tryGet(item.link, async () => {
+ if (!item.link.endsWith('.html') || new URL(item.link).hostname !== new URL(baseURL).hostname) {
+ return item;
+ }
+ const result = await got(item.link);
const $ = cheerio.load(result.data);
- return $('#ivs_content').html();
- });
- return {
- title: item.find('a').text(),
- pubDate: new Date(item.find('.listTime').text()),
- link,
- description,
- };
- })
+ const description = $('#ivs_content').html();
+ const pbTimeText = $('#ivs_title .PBtime').text().trim();
+
+ item.description = description;
+ item.pubDate = pbTimeText ? timezone(parseDate(pbTimeText, 'YYYY-MM-DD HH:mm:ss'), +8) : item.pubDate;
+
+ return item;
+ })
+ )
);
ctx.state.data = {
- title: '上海市教育考试院',
- description: '消息速递',
- link: baseURL,
+ title,
+ link,
item: items,
};
};
diff --git a/lib/v2/shmeea/maintainer.js b/lib/v2/shmeea/maintainer.js
index 000328f1807d9f..091353e5315fbc 100644
--- a/lib/v2/shmeea/maintainer.js
+++ b/lib/v2/shmeea/maintainer.js
@@ -1,4 +1,4 @@
module.exports = {
- '/': ['jialinghui'],
+ '/:id?': ['jialinghui', 'Misaka13514'],
'/self-study': ['h2ws'],
};
diff --git a/lib/v2/shmeea/radar.js b/lib/v2/shmeea/radar.js
index 7f84a7b937ce1d..010c259f661e01 100644
--- a/lib/v2/shmeea/radar.js
+++ b/lib/v2/shmeea/radar.js
@@ -3,14 +3,17 @@ module.exports = {
_name: '上海市教育考试院',
www: [
{
- title: '消息速递',
- docs: 'https://docs.rsshub.app/routes/other#shang-hai-shi-jiao-yu-kao-shi-yuan',
- source: ['/'],
- target: '/shmeea',
+ title: '消息',
+ docs: 'https://docs.rsshub.app/routes/study#shang-hai-shi-jiao-yu-kao-shi-yuan',
+ source: ['/page/:id?/index.html'],
+ target: (params, url, document) => {
+ const li = document.querySelector('#main .pageList li');
+ return li ? '/shmeea/:id?' : '';
+ },
},
{
title: '自学考试通知公告',
- docs: 'https://docs.rsshub.app/routes/other#shang-hai-shi-jiao-yu-kao-shi-yuan',
+ docs: 'https://docs.rsshub.app/routes/study#shang-hai-shi-jiao-yu-kao-shi-yuan',
source: ['/page/04000/index.html', '/'],
target: '/shmeea/self-study',
},
diff --git a/lib/v2/shmeea/router.js b/lib/v2/shmeea/router.js
index b864ea159b3384..2493022da52e3d 100644
--- a/lib/v2/shmeea/router.js
+++ b/lib/v2/shmeea/router.js
@@ -1,4 +1,4 @@
module.exports = function (router) {
- router.get('/', require('./index'));
router.get('/self-study', require('./self-study'));
+ router.get('/:id?', require('./index'));
};
diff --git a/website/docs/routes/study.mdx b/website/docs/routes/study.mdx
index 79dc2ebd29bac0..587ae3e6827703 100644
--- a/website/docs/routes/study.mdx
+++ b/website/docs/routes/study.mdx
@@ -335,11 +335,19 @@
## 上海市教育考试院 {#shang-hai-shi-jiao-yu-kao-shi-yuan}
-### 消息速递 {#shang-hai-shi-jiao-yu-kao-shi-yuan-xiao-xi-su-di}
+官方网址:[https://www.shmeea.edu.cn](https://www.shmeea.edu.cn)
-官方网址:[http://www.shmeea.edu.cn](http://www.shmeea.edu.cn)
+### 消息 {#shang-hai-shi-jiao-yu-kao-shi-yuan-xiao-xi}
-<Route author="jialinghui" example="/shmeea" path="/shmeea" radar="1" />
+<Route author="jialinghui Misaka13514" example="/shmeea/08000" path="/shmeea/:id?" radar="1" paramsDesc={['页面 ID,可在 URL 中找到,默认为消息速递']}>
+ :::tip
+ 例如:消息速递的网址为 `https://www.shmeea.edu.cn/page/08000/index.html`,则页面 ID 为 `08000`。
+ :::
+
+ :::warning
+ 暂不支持大类分类和[院内动态](https://www.shmeea.edu.cn/page/19000/index.html)
+ :::
+</Route>
### 自学考试通知公告 {#shang-hai-shi-jiao-yu-kao-shi-yuan-zi-xue-kao-shi-tong-zhi-gong-gao}
|
b16c6322e95d5c65e7d437a3ddd9272cfc788742
|
2021-04-02 20:15:16
|
dependabot-preview[bot]
|
chore(deps): bump mailparser from 3.1.0 to 3.2.0
| false
|
bump mailparser from 3.1.0 to 3.2.0
|
chore
|
diff --git a/package.json b/package.json
index 1b592e96ea1909..b74a3efb52730c 100644
--- a/package.json
+++ b/package.json
@@ -99,7 +99,7 @@
"koa-mount": "4.0.0",
"lru-cache": "6.0.0",
"lz-string": "1.4.4",
- "mailparser": "3.1.0",
+ "mailparser": "3.2.0",
"markdown-it": "12.0.4",
"module-alias": "2.2.2",
"parse-torrent": "9.1.3",
diff --git a/yarn.lock b/yarn.lock
index f2ddfe459feb04..fb9193d5cd07df 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -8410,10 +8410,10 @@ magnet-uri@^6.0.0:
bep53-range "^1.0.0"
thirty-two "^1.0.2"
[email protected]:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/mailparser/-/mailparser-3.1.0.tgz#bd947b9936f09f6a0d8e66e8509c86d7d11179af"
- integrity sha512-XW8aZ649hdgIxWIiHVsgaX7hUwf3eD4KJvtYOonssDuJHQpFJSqKWvTO5XjclNBF5ARWPFDq5OzBPTYH2i57fg==
[email protected]:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/mailparser/-/mailparser-3.2.0.tgz#cb0c4794590ba491ba2c920669ed72e472e51531"
+ integrity sha512-UpAC45oeYjp4Aa/z7XuG+PpElI+pkHpuomGcSeL1zH8gEo7anqoFY0X58ZHf0CdQIpFzp2qCPa5h905VDVUUgQ==
dependencies:
encoding-japanese "1.0.30"
he "1.2.0"
@@ -8422,8 +8422,8 @@ [email protected]:
libmime "5.0.0"
linkify-it "3.0.2"
mailsplit "5.0.1"
- nodemailer "6.4.18"
- tlds "1.217.0"
+ nodemailer "6.5.0"
+ tlds "1.219.0"
[email protected]:
version "5.0.1"
@@ -9164,10 +9164,10 @@ nodejieba@^2.2.1:
nan "^2.14.0"
node-pre-gyp "^0.14.0"
[email protected]:
- version "6.4.18"
- resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-6.4.18.tgz#2788c85792844fc17befda019031609017f4b9a1"
- integrity sha512-ht9cXxQ+lTC+t00vkSIpKHIyM4aXIsQ1tcbQCn5IOnxYHi81W2XOaU66EQBFFpbtzLEBTC94gmkbD4mGZQzVpA==
[email protected]:
+ version "6.5.0"
+ resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-6.5.0.tgz#d12c28d8d48778918e25f1999d97910231b175d9"
+ integrity sha512-Tm4RPrrIZbnqDKAvX+/4M+zovEReiKlEXWDzG4iwtpL9X34MJY+D5LnQPH/+eghe8DLlAVshHAJZAZWBGhkguw==
[email protected]:
version "2.0.7"
@@ -12427,10 +12427,10 @@ tiny-emitter@^2.0.0:
resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423"
integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==
[email protected], tlds@^1.209.0:
- version "1.217.0"
- resolved "https://registry.yarnpkg.com/tlds/-/tlds-1.217.0.tgz#194df180ab5ed41b439745991d4a84a93887cb7d"
- integrity sha512-iRVizGqUFSBRwScghTSJyRkkEXqLAO17nFwlVcmsNHPDdpE+owH91wDUmZXZfJ4UdBYuVSm7kyAXZo0c4X7GFQ==
[email protected], tlds@^1.209.0:
+ version "1.219.0"
+ resolved "https://registry.yarnpkg.com/tlds/-/tlds-1.219.0.tgz#7e636062386a1f3c9184356de93d40842ffe91d9"
+ integrity sha512-o4g9c8kXCmTDwUnK/9HpTT9o/GNH85KCvs+S5SgUw5yILdECvMmTGzK7ngoWMp97P5tfYr8fZeF16YhgV/l90A==
[email protected]:
version "1.0.4"
|
ceaff4c420492487466d0cac2a9e45c62a626827
|
2021-11-27 14:38:50
|
Tony
|
fix(route): hkcnews duplicated articles (#8169)
| false
|
hkcnews duplicated articles (#8169)
|
fix
|
diff --git a/lib/routes/hkcnews/news.js b/lib/routes/hkcnews/news.js
index f66c77e025995f..476f4c52847443 100644
--- a/lib/routes/hkcnews/news.js
+++ b/lib/routes/hkcnews/news.js
@@ -30,7 +30,7 @@ module.exports = async (ctx) => {
return {
title: news.text(),
- link: `${rootUrl}/${news.attr('href')}`,
+ link: `${rootUrl}${news.attr('href')}`,
pubDate: new Date(date.length === 8 ? `${new Date().getFullYear().toString().slice(0, 2)}${date}` : date).toUTCString(),
};
});
@@ -45,6 +45,10 @@ module.exports = async (ctx) => {
const content = cheerio.load(detailResponse.data);
item.description = content('.article-content').html();
+ // substring 2 times
+ // from https://hkcnews.com/article/47878/loreal歐萊雅-薇婭-李佳琦-47884/薇婭、李佳琦幫loreal帶貨引價格爭議-loreal道歉
+ // to https://hkcnews.com/article/47878
+ item.guid = item.link.substring(0, item.link.lastIndexOf('/')).substring(0, item.link.substring(0, item.link.lastIndexOf('/')).lastIndexOf('/'));
return item;
})
|
2cd4f1438e6133e504326613dd3f7e0e330ff521
|
2024-05-13 18:44:25
|
dependabot[bot]
|
chore(deps): bump hono from 4.3.4 to 4.3.6 (#15573)
| false
|
bump hono from 4.3.4 to 4.3.6 (#15573)
|
chore
|
diff --git a/package.json b/package.json
index 0dbacb386d13fe..0739bbd4c0e0c9 100644
--- a/package.json
+++ b/package.json
@@ -75,7 +75,7 @@
"fanfou-sdk": "5.0.0",
"form-data": "4.0.0",
"googleapis": "137.1.0",
- "hono": "4.3.4",
+ "hono": "4.3.6",
"html-to-text": "9.0.5",
"https-proxy-agent": "7.0.4",
"iconv-lite": "0.6.3",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d365d68ff3dab4..f22848014857c8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -13,10 +13,10 @@ importers:
version: 1.11.1
'@hono/swagger-ui':
specifier: 0.2.2
- version: 0.2.2([email protected])
+ version: 0.2.2([email protected])
'@hono/zod-openapi':
specifier: 0.11.1
- version: 0.11.1([email protected])([email protected])
+ version: 0.11.1([email protected])([email protected])
'@notionhq/client':
specifier: 2.2.15
version: 2.2.15
@@ -84,8 +84,8 @@ importers:
specifier: 137.1.0
version: 137.1.0
hono:
- specifier: 4.3.4
- version: 4.3.4
+ specifier: 4.3.6
+ version: 4.3.6
html-to-text:
specifier: 9.0.5
version: 9.0.5
@@ -3144,8 +3144,8 @@ packages:
[email protected]:
resolution: {integrity: sha512-4FP6J0oI8jqb6gLLl9tSwVdosWJ/AKSGJ+HwYf6Ixe4MUcEkst4uWzpVQrNOCin0fzTRQbXV8ePheU8WiiDYBw==}
- [email protected]:
- resolution: {integrity: sha512-oh+PBwW8yElj3bUlY2dTXhuPt1MCZp6Nb04tejLwY+GXdphQH6uCpUP0dY5iLvFY5wM8fNHrMx1QeMKbhnzw9w==}
+ [email protected]:
+ resolution: {integrity: sha512-2IqXwrxWF4tG2AR7b5tMYn+KEnWK8UvdC/NUSbOKWj/Kj11OJqel58FxyiXLK5CcKLiL8aGtTe4lkBKXyaHMBQ==}
engines: {node: '>=16.0.0'}
[email protected]:
@@ -6367,20 +6367,20 @@ snapshots:
'@hono/[email protected]': {}
- '@hono/[email protected]([email protected])':
+ '@hono/[email protected]([email protected])':
dependencies:
- hono: 4.3.4
+ hono: 4.3.6
- '@hono/[email protected]([email protected])([email protected])':
+ '@hono/[email protected]([email protected])([email protected])':
dependencies:
'@asteasolutions/zod-to-openapi': 7.0.0([email protected])
- '@hono/zod-validator': 0.2.1([email protected])([email protected])
- hono: 4.3.4
+ '@hono/zod-validator': 0.2.1([email protected])([email protected])
+ hono: 4.3.6
zod: 3.23.8
- '@hono/[email protected]([email protected])([email protected])':
+ '@hono/[email protected]([email protected])([email protected])':
dependencies:
- hono: 4.3.4
+ hono: 4.3.6
zod: 3.23.8
'@humanwhocodes/[email protected]':
@@ -8587,7 +8587,7 @@ snapshots:
[email protected]: {}
- [email protected]: {}
+ [email protected]: {}
[email protected]: {}
|
41f5f0a414cd9221b1fa9e2e13e6e9b53a77fd52
|
2018-08-29 09:38:52
|
DIYgod
|
docs: adjust partion ranking
| false
|
adjust partion ranking
|
docs
|
diff --git a/README.md b/README.md
index dbb338e40d3f02..2bdbb6b4b31fd9 100644
--- a/README.md
+++ b/README.md
@@ -35,8 +35,8 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇
- UP 主投币视频
- UP 主粉丝
- UP 主关注用户
- - 分区视频(投稿时间排序)
- - 分区视频(视频热度排序)
+ - 分区视频
+ - 分区视频排行榜
- 视频评论
- link 公告
- 直播开播
diff --git a/docs/README.md b/docs/README.md
index 886452d9e6abf9..0be31763c21954 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -478,7 +478,7 @@ fid,收藏夹 ID,可在收藏夹的 URL 中找到,默认收藏夹建议使用
参数: uid,用户 id,可在 UP 主主页中找到
-### 分区视频(投稿时间排序) <Author uid="DIYgod"/>
+### 分区视频 <Author uid="DIYgod"/>
举例: [https://rsshub.app/bilibili/partion/33](https://rsshub.app/bilibili/partion/33)
@@ -486,18 +486,6 @@ fid,收藏夹 ID,可在收藏夹的 URL 中找到,默认收藏夹建议使用
参数: tid,分区 id
-### 分区视频(视频热度排序) <Author uid="lengthmin"/>
-
-举例: [https://rsshub.app/bilibili/partion/ranking/171/3](https://rsshub.app/bilibili/partion/ranking/171/3)
-
-路由: `/bilibili/partion/ranking/:tid/:days?`
-
-参数:
-
-tid,分区 id
-
-days, 可选, 缺省为 7, 指最近多少天内的热度排序
-
动画
| MAD·AMV | MMD·3D | 短片·手书·配音 | 综合 |
@@ -594,6 +582,18 @@ days, 可选, 缺省为 7, 指最近多少天内的热度排序
| ---- | ------ | ------ |
| 11 | 185 | 187 |
+### 分区视频排行榜 <Author uid="lengthmin"/>
+
+举例: [https://rsshub.app/bilibili/partion/ranking/171/3](https://rsshub.app/bilibili/partion/ranking/171/3)
+
+路由: `/bilibili/partion/ranking/:tid/:days?`
+
+参数:
+
+tid,分区 id,见上方表格
+
+days, 可选, 缺省为 7, 指最近多少天内的热度排序
+
### 视频评论 <Author uid="Qixingchen"/>
举例: [https://rsshub.app/bilibili/video/reply/21669336](https://rsshub.app/bilibili/video/reply/21669336)
|
3b32b49435055423c41671643187f84b07670b3a
|
2021-05-05 09:15:57
|
dependabot-preview[bot]
|
chore(deps): bump dotenv from 8.3.0 to 8.4.0
| false
|
bump dotenv from 8.3.0 to 8.4.0
|
chore
|
diff --git a/package.json b/package.json
index fb959ce46f0f5d..22e447401e5d76 100644
--- a/package.json
+++ b/package.json
@@ -76,7 +76,7 @@
"crypto-js": "4.0.0",
"currency-symbol-map": "4.0.4",
"dayjs": "1.10.3",
- "dotenv": "8.3.0",
+ "dotenv": "8.4.0",
"emailjs-imap-client": "3.1.0",
"entities": "2.1.0",
"etag": "1.8.1",
diff --git a/yarn.lock b/yarn.lock
index 8b8bab7e97fe2c..008ca4e02810f6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4720,10 +4720,10 @@ dot-prop@^5.2.0:
dependencies:
is-obj "^2.0.0"
[email protected]:
- version "8.3.0"
- resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.3.0.tgz#0f165f76e77769278d95e634838eed97a27ce5c2"
- integrity sha512-1Rzx4VAJIy9LPqtNO21bBdP8A6WAXcTlnLKt92o/vZ8MezXcjjzb1b39Ls0BWSIcW9ijkFtUmjOGrwHiqdb3Cw==
[email protected]:
+ version "8.4.0"
+ resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.4.0.tgz#08576a9d5dc63b4fc58df087015c768eb102e0f3"
+ integrity sha512-l+pIWjvRva0AhnLerv9VvpscgXa72iPW1qKlCgA7COzJA414vGQ/PMcOuNfR1CmQbK208WWYeVwQUa8yfuqH8Q==
dotenv@^6.2.0:
version "6.2.0"
|
5db837d6dc027a245eee9a5f0b2385f489a3ef3c
|
2022-06-21 07:11:16
|
NeverBehave
|
feat(core): anti-hotlink experimental parameters (#9997)
| false
|
anti-hotlink experimental parameters (#9997)
|
feat
|
diff --git a/docs/en/faq.md b/docs/en/faq.md
index 071825e4c3eb70..5766435ee3f84f 100644
--- a/docs/en/faq.md
+++ b/docs/en/faq.md
@@ -8,9 +8,13 @@
**A:** [rsshub.app](https://rsshub.app) is the demo instance provided, running the latest build of RSSHub from master branch, the cache is set 120 minutes and it's free to use. However, if you see an badge <Badge text="strict anti-crawler policy" vertical="middle" type="warn"/> for route, this means popular websites such as Facebook etc. may pose a request quota on individual IP address, which means it can get unreliable from time to time for the demo instance. You are encouraged to [host your own RSSHub instance](/en/install/) to get a better usability.
-**Q: Why are images not loading in some RSSHub routes?**
+**Q: Why are images/videos not loading in some RSSHub routes?**
-**A:** RSSHub fetches and respects the original image URLs from original sites, `referrerpolicy="no-referrer"` attribute is added to all images to solve the issues caused by cross-domain requests. Third party RSS service providers such as Feedly and Inoreader, strip this attribute off which leads to cross-domain requests being blocked.
+**A:** RSSHub fetches and respects the original image/video URLs from original sites, in which some are behind anti-hotlink filters. `referrerpolicy="no-referrer"` attribute is added to all images to solve the issues caused by cross-domain requests. Third party RSS service providers such as Feedly and Inoreader, strip this attribute off, resulting in cross-domain requests being blocked. Meanwhile, the attribute is not available for videos yet, resulting in most RSS readers unable to pass the anti-hotlink check. Here are some workarounds:
+
+1. Migrate to RSS readers that do not send Referer,such as [Inoreader for Web](https://www.inoreader.com/) with a [user script disabling Referer](https://greasyfork.org/en/scripts/376884), [RSS to Telegram Bot](https://github.com/Rongronggg9/RSS-to-Telegram-Bot), etc. If your RSS reader can bypass the anti-hotlink check successfully and play embedded videos, it's an RSS reader that do not send Referer. Please consider adding it to the documentation to help more people.
+2. Set up a reverse proxy, refer to [Parameters->Multimedia processing](/en/parameter.html#multimedia-processing) for more details.
+3. Navigate back to the original site.
**Q: The website I want is not supported QAQ**
diff --git a/docs/en/install/README.md b/docs/en/install/README.md
index 59f9d8677f0944..1cc75336faee0a 100644
--- a/docs/en/install/README.md
+++ b/docs/en/install/README.md
@@ -523,7 +523,13 @@ See the relation between access key/code and white/blacklisting.
### Image Processing
-`HOTLINK_TEMPLATE`: replace image URL in the description to avoid anti-hotlink protection, leave it blank to disable this function. Usage reference [#2769](https://github.com/DIYgod/RSSHub/issues/2769). You may use any property listed in [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties), format of JS template literal. e.g. `${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`
+::: warning Deprecation warning
+
+The options below are deprecated, preserved only for backward compatibility, please refer to [Parameters->Multimedia processing](/en/parameter.html#multimedia-processing) for more details.
+
+:::
+
+`HOTLINK_TEMPLATE`: replace image URL in the description to avoid anti-hotlink protection, leave it blank to disable this function. Usage reference [#2769](https://github.com/DIYgod/RSSHub/issues/2769). You may use any property listed in [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties) (suffixing with `_ue` results in URL encoding), format of JS template literal. e.g. `${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`, `https://images.weserv.nl?url=${href_ue}`
`HOTLINK_INCLUDE_PATHS`: limit the routes to be processed, only matched routes will be processed. Set multiple values with comma `,` as delimiter. If not set, all routes will be processed
@@ -539,6 +545,16 @@ It is also valid to contain route parameters, e.g. `/weibo/user/2612249974`.
:::
+### Features
+
+::: tip Experimental features
+
+Configs in this sections are in beta stage, and are turn off by default. Please read corresponded description and turn on if necessary.
+
+:::
+
+`ALLOW_USER_HOTLINK_TEMPLATE`: [Parameters->Multimedia processing](/en/parameter.html#multimedia-processing)
+
### Other Application Configurations
`DISALLOW_ROBOT`: prevent indexing by search engine, default to enable, set false or 0 to disable
diff --git a/docs/en/parameter.md b/docs/en/parameter.md
index 6cedcbd2832e44..edccba05888fd5 100644
--- a/docs/en/parameter.md
+++ b/docs/en/parameter.md
@@ -88,6 +88,22 @@ E.g. <https://rsshub.app/pnas/latest?scihub=1>
E.g. <https://rsshub.app/dcard/posts/popular?opencc=t2s>
+## Multimedia processing
+
+::: warning 注意
+
+This is an experimental API
+
+The following operation allows user to inject codes, which is harmful in web environment. However, RSS feed reader usually limits these functions. While normally routes won't need these functions, please set `ALLOW_USER_HOTLINK_TEMPLATE` to `true` if you understand how these parameters works.
+
+:::
+
+- `image_hotlink_template`: replace image URL in the description to avoid anti-hotlink protection, leave it blank to disable this function. Usage reference [#2769](https://github.com/DIYgod/RSSHub/issues/2769). You may use any property listed in [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties) (suffixing with `_ue` results in URL encoding), format of JS template literal. e.g. `${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`, `https://images.weserv.nl?url=${href_ue}`
+- `multimedia_hotlink_template`: the same as `image_hotlink_template` but apply to audio and video. Note: the service must follow redirects, allow reverse-proxy for audio and video, and must drop the `Referer` header when reverse-proxying. [Here is an easy-to-deploy project that fits these requirements](https://github.com/Rongronggg9/rsstt-img-relay). The project accepts simple URL concatenation, e.g. `https://example.com/${href}`, in which `example.com` should be replaced with the domain name of the service you've deployed
+- `wrap_multimedia_in_iframe`: wrap audio and video in `<iframe>` to prevent the reader from sending `Referer` header. This workaround is only compatible with a few readers, such as RSS Guard and Akregator, which may not support the previous method. You can try this method in such a case
+
+There are more details in the [FAQ](/en/faq.html).
+
## Output Formats
RSSHub conforms to RSS 2.0 and Atom Standard, simply append `.rss` `.atom` to the end of the feed address to obtain the feed in corresponding format. The default output format is RSS 2.0.
@@ -98,3 +114,21 @@ For example:
- RSS 2.0 - [https://rsshub.app/dribbble/popular.rss](https://rsshub.app/dribbble/popular.rss)
- Atom - [https://rsshub.app/dribbble/popular.atom](https://rsshub.app/dribbble/popular.atom)
- Apply filters or URL query [https://rsshub.app/dribbble/popular.atom?filterout=Blue|Yellow|Black](https://rsshub.app/dribbble/popular.atom?filterout=Blue|Yellow|Black)
+
+### Debug
+
+If the RSSHub instance is running with `debugInfo=true` enabled, suffixing a route with `.debug.json` will result in the value of `ctx.state.json` being returned.
+
+This feature aims to facilitate debugging or developing customized features. A route developer has the freedom to determine whether to adopt it or not, without any format requirement.
+
+For example:
+
+- `/furstar/characters/cn.debug.json`
+
+## Brief introduction
+
+Set the parameter `brief` to generate a brief pure-text introduction with a limited number of characters ( ≥ `100`).
+
+For example:
+
+- Brief introduction with 100 characters: `?brief=100`
diff --git a/docs/faq.md b/docs/faq.md
index 2a3752fc292722..83873e05eda26f 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -18,12 +18,10 @@
**Q: 为什么 RSSHub 里的图片 / 视频加载不出来?**
-**A:** RSSHub 里的图片 / 视频地址都是源站地址,部分有防盗链,所以 RSSHub 给图片加了 `referrerpolicy="no-referrer"` 属性来防止跨域问题,但部分 RSS 服务会自作主张去掉这个属性,如 Feedly、Inoreader,在它们的网页端图片会触发跨域加载不出来。部分网站则要求 Referrer 来防止盗链,这种情况可以通过设置图片反代进行处理。详情请查看文档`部署->图片处理`部分
+**A:** RSSHub 里的图片 / 视频地址都是源站地址,部分有防盗链,所以 RSSHub 给图片加了 `referrerpolicy="no-referrer"` 属性来防止跨域问题,但部分 RSS 服务会自作主张去掉这个属性,如 Feedly、Inoreader,在它们的网页端图片会触发跨域加载不出来。同时,视频目前没有类似的属性,因此大部分阅读器都无法通过防盗链检查。下面是一些解决方案:
-视频目前没有类似的属性,下面是一些解决方案:
-
-1. 使用不发送 Referer 的阅读器,如 [Inoreader 网页版](https://www.inoreader.com/)配合[禁用 referer 的 user script](https://greasyfork.org/zh-CN/scripts/376884-%E6%98%BE%E7%A4%BA%E9%98%B2%E7%9B%97%E9%93%BE%E5%9B%BE%E7%89%87-for-inoreader)、[RSS to Telegram Bot](https://github.com/Rongronggg9/RSS-to-Telegram-Bot) 等。如果你的阅读器能够在不启用上述两个变通解决方案时成功播放内嵌视频,那么它就是不发送 Referer 的,请考虑添加到文档里帮助更多的人。
-2. 部分路由支持生成关闭内嵌视频,直接输出视频地址,或者其他可以尝试绕开相关限制的的订阅,可尝试使用。具体说明请查看相关路由(举例:`社交媒体->抖音`)
+1. 使用不发送 Referer 的阅读器,如 [Inoreader 网页版](https://www.inoreader.com/)配合[禁用 Referer 的 user script](https://greasyfork.org/zh-CN/scripts/376884)、[RSS to Telegram Bot](https://github.com/Rongronggg9/RSS-to-Telegram-Bot) 等。如果你的阅读器能够绕过防盗链成功播放内嵌视频,那么它就是不发送 Referer 的,请考虑添加到文档里帮助更多的人。
+2. 设置反代,参考 [通用参数 -> 多媒体处理](/parameter.html#duo-mei-ti-chu-li)。
3. 回到原网站查看相关资源。
**Q: 没有我想订阅的网站怎么办嘤嘤嘤 QAQ**
diff --git a/docs/install/README.md b/docs/install/README.md
index fe96989a296a13..92f11441ac87c7 100644
--- a/docs/install/README.md
+++ b/docs/install/README.md
@@ -529,7 +529,13 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行
### 图片处理
-`HOTLINK_TEMPLATE`: 用于处理描述中图片的 URL,绕过防盗链等限制,留空不生效。用法参考 [#2769](https://github.com/DIYgod/RSSHub/issues/2769)。可以使用 [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties) 的所有属性,格式为 JS 变量模板。例子:`${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`
+::: info 新配置方式
+
+我们正在试验新的,更灵活的配置方式。如果有需要,请转到 [通用参数 -> 多媒体处理](/parameter.html#duo-mei-ti-chu-li) 了解更多。
+
+:::
+
+`HOTLINK_TEMPLATE`: 用于处理描述中图片的 URL,绕过防盗链等限制,留空不生效。用法参考 [#2769](https://github.com/DIYgod/RSSHub/issues/2769)。可以使用 [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties) 的所有属性(加上后缀 `_ue` 则会对其进行 URL 编码),格式为 JS 变量模板。例子:`${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`, `https://images.weserv.nl?url=${href_ue}`
`HOTLINK_INCLUDE_PATHS`: 限制需要处理的路由,只有匹配成功的路由会被处理,设置多项时用英文逗号 `,` 隔开。若不设置,则所有路由都将被处理
@@ -545,6 +551,16 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行
:::
+### 功能特性
+
+::: tip 测试特性
+
+这个板块控制的是一些新特性的选项,默认他们都是关闭的。如果有需要请阅读对应说明后按需开启
+
+:::
+
+`ALLOW_USER_HOTLINK_TEMPLATE`: [通用参数 -> 多媒体处理](/parameter.html#duo-mei-ti-chu-li)特性控制
+
### 其他应用配置
`DISALLOW_ROBOT`: 阻止搜索引擎收录,默认开启,设置 false 或 0 关闭
diff --git a/docs/new-media.md b/docs/new-media.md
index db5f345db6ffa2..1082d20e4ce718 100644
--- a/docs/new-media.md
+++ b/docs/new-media.md
@@ -3371,6 +3371,12 @@ column 为 third 时可选的 category:
## 网易新闻
+::: warning 注意
+
+若视频因防盗链而无法播放,请参考 [通用参数 -> 多媒体处理](/parameter.html#duo-mei-ti-chu-li) 配置 `multimedia_hotlink_template` **或** `wrap_multimedia_in_iframe`。
+
+:::
+
### 今日关注
<Route author="nczitzk" example="/netease/today" path="/netease/today/:need_content?" :paramsDesc="['需要获取全文,填写 true/yes 表示需要,默认需要']">
diff --git a/docs/parameter.md b/docs/parameter.md
index 7f7f2cbc8cebdb..d9bb1c0ff32e25 100644
--- a/docs/parameter.md
+++ b/docs/parameter.md
@@ -89,6 +89,22 @@ Telegram 即时预览模式需要在官网制作页面处理模板,请前往[
举例: <https://rsshub.app/dcard/posts/popular?opencc=t2s>
+## 多媒体处理
+
+::: warning 注意
+
+这是个测试中的 API
+
+下方操作允许任意用户注入链接模版到最终输出结果,针对于 Web 环境来说这是有害的(XSS)。但是 RSS 阅读器内通常是有限制的环境,通常不会带来副作用,一般路由通常不会需要这些功能。如果需要开启,请将 `ALLOW_USER_HOTLINK_TEMPLATE` 环境变量设置为 `true`
+
+:::
+
+- `image_hotlink_template`: 用于处理描述中图片的 URL,绕过防盗链等限制,留空不生效。用法参考 [#2769](https://github.com/DIYgod/RSSHub/issues/2769)。可以使用 [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties) 的所有属性(加上后缀 `_ue` 则会对其进行 URL 编码),格式为 JS 变量模板。例子:`${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`, `https://images.weserv.nl?url=${href_ue}`
+- `multimedia_hotlink_template`: 用法同 `image_hotlink_template`,但应用于音频和视频。注意:该服务必须跟随跳转、允许反代音频和视频,且必须在反代时丢弃 `Referer` 请求头。[这里有一个符合要求的易于自行搭建的项目](https://github.com/Rongronggg9/rsstt-img-relay/blob/main/README_zh-CN.md),该项目接受直接拼接 URL,即 `https://example.com/${href}`,其中 `example.com` 应替换为自行搭建的服务的域名
+- `wrap_multimedia_in_iframe`: 将音频和视频包裹在 `<iframe>` 中,以阻止阅读器发送 `Referer` 请求头。支持该变通解决方案的阅读器较少,且可能造成显示错误。有些阅读器,如 RSS Guard、Akregator,可能不支持前一种方法,则可尝试此方法。设置为`1`生效
+
+[FAQ](/faq.html) 中有更多信息。
+
## 输出格式
RSSHub 同时支持 RSS 2.0 和 Atom 输出格式,在路由末尾添加 `.rss` 或 `.atom` 即可请求对应输出格式,缺省为 RSS 2.0
diff --git a/docs/social-media.md b/docs/social-media.md
index 02bbbeb2c1971f..b62b654e1c4065 100644
--- a/docs/social-media.md
+++ b/docs/social-media.md
@@ -855,23 +855,17 @@ YouTube 官方亦有提供频道 RSS,形如 <https://www.youtube.com/feeds/vid
反爬严格,需要启用 puppeteer。\
抖音的视频 CDN 会验证 Referer,意味着许多阅读器都无法直接播放内嵌视频,以下是一些变通解决方案:
-1. 填写 `relay`,开启视频反代 (推荐,适合大部分阅读器)。如该服务接受直接拼接 URL,则可直接填入路径,如 `https://example.com/` ;如该服务仅接受 URL 作为参数传入,则确保该参数置于末尾,如 `https://example.com/?url=` 。注意:该服务必须跟随跳转、允许反代视频,且必须在反代时丢弃 Referer 请求头。[这里有一个符合要求的易于自行搭建的项目](https://github.com/Rongronggg9/rsstt-img-relay),该项目接受直接拼接 URL。
-2. 启用 iframe 变通解决方案,禁止阅读器发送 Referer。支持该变通解决方案的阅读器较少,且可能造成显示错误。有些阅读器,如 RSS Guard、Akregator,可能不支持前一种方法,则可尝试此方法。
-3. 使用不发送 Referer 的阅读器,如 [Inoreader 网页版](https://www.inoreader.com/)配合[禁用 referer 的 user script](https://greasyfork.org/zh-CN/scripts/376884-%E6%98%BE%E7%A4%BA%E9%98%B2%E7%9B%97%E9%93%BE%E5%9B%BE%E7%89%87-for-inoreader)、[RSS to Telegram Bot](https://github.com/Rongronggg9/RSS-to-Telegram-Bot) 等。如果你的阅读器能够在不启用上述两个变通解决方案时成功播放内嵌视频,那么它就是不发送 Referer 的,请考虑添加到文档里帮助更多的人。
-4. 关闭内嵌视频 (`embed=0`),手动点击 `视频直链` 超链接,一般情况下均可成功播放视频。若仍然出现 HTTP 403,请复制 URL 以后到浏览器打开。
-5. 点击原文链接打开抖音网页版的视频详情页播放视频。
-
-上述外部链接与 RSSHub 无关。
+1. 启用内嵌视频 (`embed=1`), 参考 [通用参数 -> 多媒体处理](/parameter.html#duo-mei-ti-chu-li) 配置 `multimedia_hotlink_template` **或** `wrap_multimedia_in_iframe`。
+2. 关闭内嵌视频 (`embed=0`),手动点击 `视频直链` 超链接,一般情况下均可成功播放视频。若仍然出现 HTTP 403,请复制 URL 以后到浏览器打开。
+3. 点击原文链接打开抖音网页版的视频详情页播放视频。
:::
额外参数
-| 键 | 含义 | 值 | 默认值 |
-| -------- | ----------------------------------- | ---------------------- | ------- |
-| `embed` | 是否启用内嵌视频 | `0`/`1`/`true`/`false` | `false` |
-| `iframe` | 是否启用 iframe 变通解决方案,仅在内嵌视频开启时有效,详见下文 | `0`/`1`/`true`/`false` | `false` |
-| `relay` | 视频反代服务的 URL,仅在内嵌视频开启时有效,详见下文 | | |
+| 键 | 含义 | 值 | 默认值 |
+| ------- | -------- | ---------------------- | ------- |
+| `embed` | 是否启用内嵌视频 | `0`/`1`/`true`/`false` | `false` |
### 博主
diff --git a/lib/config.js b/lib/config.js
index 5fedd0063dd576..f5f27a024bb20b 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -91,6 +91,9 @@ const calculateValue = () => {
includePaths: envs.HOTLINK_INCLUDE_PATHS && envs.HOTLINK_INCLUDE_PATHS.split(','),
excludePaths: envs.HOTLINK_EXCLUDE_PATHS && envs.HOTLINK_EXCLUDE_PATHS.split(','),
},
+ feature: {
+ allow_user_hotlink_template: envs.ALLOW_USER_HOTLINK_TEMPLATE === 'true',
+ },
suffix: envs.SUFFIX,
titleLengthLimit: parseInt(envs.TITLE_LENGTH_LIMIT) || 150,
diff --git a/lib/middleware/anti-hotlink.js b/lib/middleware/anti-hotlink.js
index 098396a06d9219..53f0ac72040b82 100644
--- a/lib/middleware/anti-hotlink.js
+++ b/lib/middleware/anti-hotlink.js
@@ -1,6 +1,12 @@
const config = require('@/config').value;
const cheerio = require('cheerio');
const logger = require('@/utils/logger');
+const path = require('path');
+const { art } = require('@/utils/render');
+
+const templateRegex = /\$\{([^{}]+)}/g;
+const allowedUrlProperties = ['hash', 'host', 'hostname', 'href', 'origin', 'password', 'pathname', 'port', 'protocol', 'search', 'searchParams', 'username'];
+const IframeWrapperTemplate = path.join(__dirname, 'templates/iframe.art');
// match path or sub-path
const matchPath = (path, paths) => {
@@ -19,9 +25,16 @@ const filterPath = (path) => {
return !(include && !matchPath(path, include)) && !(exclude && matchPath(path, exclude));
};
-const interpolate = (str, obj) => str.replace(/\${([^}]+)}/g, (_, prop) => obj[prop]);
-// I don't want to keep another regex and
-// URL will be the standard way to parse URL
+const interpolate = (str, obj) =>
+ str.replace(templateRegex, (_, prop) => {
+ let needEncode = false;
+ if (prop.endsWith('_ue')) {
+ // url encode
+ prop = prop.slice(0, -3);
+ needEncode = true;
+ }
+ return needEncode ? encodeURIComponent(obj[prop]) : obj[prop];
+ });
const parseUrl = (str) => {
let url;
try {
@@ -32,48 +45,101 @@ const parseUrl = (str) => {
return url;
};
-const replaceUrls = (body, template) => {
- // const $ = cheerio.load(body, { decodeEntities: false, xmlMode: true });
- // `<br><img><hr><video><source>abc</video>` => `<br><img><hr><video><source>abc</source></video></hr></img></br>`
- // so awful...
- // "In HTML, using a closing tag on an empty element is usually invalid."
- // https://developer.mozilla.org/en-US/docs/Glossary/Empty_element
- // I guess it is just a workaround to drop `<html><head></head><body>`, so this is what we exactly need:
- const $ = cheerio.load(body, null, false);
- $('img').each(function () {
- const old_src = $(this).attr('src');
- const url = parseUrl(old_src);
- if (url) {
- const new_src = interpolate(template, url);
- $(this).attr('src', new_src);
+const replaceUrls = ($, selector, template, attribute = 'src') => {
+ $(selector).each(function () {
+ const old_src = $(this).attr(attribute);
+ if (old_src) {
+ const url = parseUrl(old_src);
+ if (url) {
+ // We are now accepting user input and giving faith that reader will do the
+ // right thing, default this config would be turn off.
+ // if admins know the risk of their site might be used for hosting for hijacking
+ // content, e.g. they could set corresponded config to true to turn that feature on
+ $(this).attr(attribute, interpolate(template, url));
+ }
}
});
+};
+
+const wrapWithIframe = ($, selector) => {
+ $(selector).each((_, elem) => {
+ elem = $(elem);
+ elem.replaceWith(art(IframeWrapperTemplate, { content: elem.toString() }));
+ });
+};
- return $.root().html();
+const process = (html, image_hotlink_template, multimedia_hotlink_template, wrap_multimedia_in_iframe) => {
+ const $ = cheerio.load(html, undefined, false);
+ if (image_hotlink_template) {
+ replaceUrls($, 'img, picture > source', image_hotlink_template);
+ replaceUrls($, 'video[poster]', image_hotlink_template, 'poster');
+ }
+ if (multimedia_hotlink_template) {
+ replaceUrls($, 'video, video > source, audio, audio > source', multimedia_hotlink_template);
+ if (!image_hotlink_template) {
+ replaceUrls($, 'video[poster]', multimedia_hotlink_template, 'poster');
+ }
+ }
+ if (wrap_multimedia_in_iframe) {
+ wrapWithIframe($, 'video, audio');
+ }
+ return $.html();
+};
+
+const validateTemplate = (template) => {
+ if (!template) {
+ return;
+ }
+ [...template.matchAll(templateRegex)].forEach((match) => {
+ const prop = match[1].endsWith('_ue') ? match[1].slice(0, -3) : match[1];
+ if (!allowedUrlProperties.includes(prop)) {
+ throw new Error(`Invalid URL property: ${prop}`);
+ }
+ });
};
module.exports = async (ctx, next) => {
await next();
- const template = config.hotlink.template;
+ let image_hotlink_template = undefined;
+ let multimedia_hotlink_template = undefined;
+ const shouldWrapInIframe = ctx.query.wrap_multimedia_in_iframe === '1';
- if (!template || !filterPath(ctx.request.path)) {
+ // Read params if enabled
+ if (config.feature.allow_user_hotlink_template) {
+ multimedia_hotlink_template = ctx.query.multimedia_hotlink_template;
+ image_hotlink_template = ctx.query.image_hotlink_template;
+ }
+
+ // Force config hotlink template on conflict
+ if (config.hotlink.template) {
+ if (!filterPath(ctx.request.path)) {
+ image_hotlink_template = undefined;
+ } else {
+ image_hotlink_template = config.hotlink.template;
+ }
+ }
+
+ if (!image_hotlink_template && !multimedia_hotlink_template && !shouldWrapInIframe) {
return;
}
+ validateTemplate(image_hotlink_template);
+ validateTemplate(multimedia_hotlink_template);
+
// Assume that only description include image link
// and here we will only check them in description.
// Use Cheerio to load the description as html and filter all
// image link
if (ctx.state.data) {
if (ctx.state.data.description) {
- ctx.state.data.description = replaceUrls(ctx.state.data.description, template);
+ ctx.state.data.description = process(ctx.state.data.description, image_hotlink_template, multimedia_hotlink_template, shouldWrapInIframe);
}
ctx.state.data.item &&
ctx.state.data.item.forEach((item) => {
if (item.description) {
- item.description = replaceUrls(item.description, template);
+ item.description = process(item.description, image_hotlink_template, multimedia_hotlink_template, shouldWrapInIframe);
}
});
}
diff --git a/lib/middleware/parameter.js b/lib/middleware/parameter.js
index d35dc65147c254..ce3cbeb246436d 100644
--- a/lib/middleware/parameter.js
+++ b/lib/middleware/parameter.js
@@ -11,7 +11,11 @@ const resolveRelativeLink = ($, elem, attr, baseUrl) => {
if (baseUrl) {
try {
- $elem.attr(attr, new URL($elem.attr(attr), baseUrl).href);
+ const oldAttr = $elem.attr(attr);
+ if (oldAttr) {
+ // e.g. <video><source src="https://example.com"></video> should leave <video> unchanged
+ $elem.attr(attr, new URL(oldAttr, baseUrl).href);
+ }
} catch (e) {
// no-empty
}
@@ -124,6 +128,9 @@ module.exports = async (ctx, next) => {
$('img, video, audio, source, iframe, embed, track').each((_, elem) => {
resolveRelativeLink($, elem, 'src', baseUrl);
});
+ $('video[poster]').each((_, elem) => {
+ resolveRelativeLink($, elem, 'poster', baseUrl);
+ });
$('img, iframe').each((_, elem) => {
$(elem).attr('referrerpolicy', 'no-referrer');
});
@@ -280,6 +287,8 @@ module.exports = async (ctx, next) => {
throw Error(`Invalid parameter <code>brief=${ctx.query.brief}</code>. Please check the doc https://docs.rsshub.app/parameter.html#shu-chu-jian-xun`);
}
}
+
+ // some parameters are processed in `anti-hotlink.js`
}
}
};
diff --git a/lib/middleware/templates/iframe.art b/lib/middleware/templates/iframe.art
new file mode 100644
index 00000000000000..7529b5bcc897ec
--- /dev/null
+++ b/lib/middleware/templates/iframe.art
@@ -0,0 +1,14 @@
+<iframe referrerpolicy="no-referrer" width=100% height=150vh frameborder=0 marginheight=0 marginwidth=0
+style="border:0; margin:0; padding:0; width:100%; height:150vh;"
+srcdoc="
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta name="referrer" content="no-referrer">
+ </head>
+ <body>
+ {{ content }}
+ </body>
+</html>
+">
+</iframe>
diff --git a/lib/v2/test/index.js b/lib/v2/test/index.js
index 5535264a0bf212..196ef1fe347e36 100644
--- a/lib/v2/test/index.js
+++ b/lib/v2/test/index.js
@@ -103,7 +103,7 @@ module.exports = async (ctx) => {
title: `Multimedia Title`,
description: `<img src="/DIYgod/RSSHub.jpg">
<video src="/DIYgod/RSSHub.mp4"></video>
-<video>
+<video poster="/DIYgod/RSSHub.jpg">
<source src="/DIYgod/RSSHub.mp4" type="video/mp4">
<source src="/DIYgod/RSSHub.webm" type="video/webm">
</video>
diff --git a/test/middleware/anti-hotlink.js b/test/middleware/anti-hotlink.js
index 6b0b9d8b3bf881..3447c47d4562bc 100644
--- a/test/middleware/anti-hotlink.js
+++ b/test/middleware/anti-hotlink.js
@@ -1,24 +1,32 @@
const supertest = require('supertest');
jest.mock('request-promise-native');
const Parser = require('rss-parser');
+const querystring = require('query-string');
const parser = new Parser();
+jest.setTimeout(50000);
let server;
afterAll(() => {
delete process.env.HOTLINK_TEMPLATE;
delete process.env.HOTLINK_INCLUDE_PATHS;
delete process.env.HOTLINK_EXCLUDE_PATHS;
+ delete process.env.ALLOW_USER_HOTLINK_TEMPLATE;
});
afterEach(() => {
delete process.env.HOTLINK_TEMPLATE;
delete process.env.HOTLINK_INCLUDE_PATHS;
delete process.env.HOTLINK_EXCLUDE_PATHS;
- jest.resetModules();
+ delete process.env.ALLOW_USER_HOTLINK_TEMPLATE;
server.close();
+ jest.resetModules();
});
-const origin1 = `<a href="https://mock.com/DIYgod/RSSHub"></a>
+const expects = {
+ complicated: {
+ origin: {
+ items: [
+ `<a href="https://mock.com/DIYgod/RSSHub"></a>
<img src="https://mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">
<a href="http://mock.com/DIYgod/RSSHub"></a>
@@ -27,9 +35,15 @@ const origin1 = `<a href="https://mock.com/DIYgod/RSSHub"></a>
<img data-mock="/DIYgod/RSSHub.png" src="https://mock.com/DIYgod/RSSHub.png" referrerpolicy="no-referrer">
<img mock="/DIYgod/RSSHub.gif" src="https://mock.com/DIYgod/RSSHub.gif" referrerpolicy="no-referrer">
<img src="http://mock.com/DIYgod/DIYgod/RSSHub" referrerpolicy="no-referrer">
-<img src="https://mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">`;
-
-const processed1 = `<a href="https://mock.com/DIYgod/RSSHub"></a>
+<img src="https://mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">`,
+ `<a href="https://mock.com/DIYgod/RSSHub"></a>
+<img src="https://mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">`,
+ ],
+ desc: '<img src="http://mock.com/DIYgod/DIYgod/RSSHub"> - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)',
+ },
+ processed: {
+ items: [
+ `<a href="https://mock.com/DIYgod/RSSHub"></a>
<img src="https://i3.wp.com/mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">
<a href="http://mock.com/DIYgod/RSSHub"></a>
@@ -38,104 +52,268 @@ const processed1 = `<a href="https://mock.com/DIYgod/RSSHub"></a>
<img data-mock="/DIYgod/RSSHub.png" src="https://i3.wp.com/mock.com/DIYgod/RSSHub.png" referrerpolicy="no-referrer">
<img mock="/DIYgod/RSSHub.gif" src="https://i3.wp.com/mock.com/DIYgod/RSSHub.gif" referrerpolicy="no-referrer">
<img src="https://i3.wp.com/mock.com/DIYgod/DIYgod/RSSHub" referrerpolicy="no-referrer">
-<img src="https://i3.wp.com/mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">`;
+<img src="https://i3.wp.com/mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">`,
+ `<a href="https://mock.com/DIYgod/RSSHub"></a>
+<img src="https://i3.wp.com/mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">`,
+ ],
+ desc: '<img src="https://i3.wp.com/mock.com/DIYgod/DIYgod/RSSHub"> - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)',
+ },
+ urlencoded: {
+ items: [
+ `<a href="https://mock.com/DIYgod/RSSHub"></a>
+<img src="https://images.weserv.nl?url=https%3A%2F%2Fmock.com%2FDIYgod%2FRSSHub.jpg" referrerpolicy="no-referrer">
-const origin2 = `<a href="https://mock.com/DIYgod/RSSHub"></a>
-<img src="https://mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">`;
+<a href="http://mock.com/DIYgod/RSSHub"></a>
+<img src="https://images.weserv.nl?url=https%3A%2F%2Fmock.com%2FDIYgod%2FRSSHub.jpg" data-src="/DIYgod/RSSHub0.jpg" referrerpolicy="no-referrer">
+<img data-src="/DIYgod/RSSHub.jpg" src="https://images.weserv.nl?url=https%3A%2F%2Fmock.com%2FDIYgod%2FRSSHub.jpg" referrerpolicy="no-referrer">
+<img data-mock="/DIYgod/RSSHub.png" src="https://images.weserv.nl?url=https%3A%2F%2Fmock.com%2FDIYgod%2FRSSHub.png" referrerpolicy="no-referrer">
+<img mock="/DIYgod/RSSHub.gif" src="https://images.weserv.nl?url=https%3A%2F%2Fmock.com%2FDIYgod%2FRSSHub.gif" referrerpolicy="no-referrer">
+<img src="https://images.weserv.nl?url=http%3A%2F%2Fmock.com%2FDIYgod%2FDIYgod%2FRSSHub" referrerpolicy="no-referrer">
+<img src="https://images.weserv.nl?url=https%3A%2F%2Fmock.com%2FDIYgod%2FRSSHub.jpg" referrerpolicy="no-referrer">`,
+ `<a href="https://mock.com/DIYgod/RSSHub"></a>
+<img src="https://images.weserv.nl?url=https%3A%2F%2Fmock.com%2FDIYgod%2FRSSHub.jpg" referrerpolicy="no-referrer">`,
+ ],
+ desc: '<img src="https://images.weserv.nl?url=http%3A%2F%2Fmock.com%2FDIYgod%2FDIYgod%2FRSSHub"> - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)',
+ },
+ },
+ multimedia: {
+ origin: {
+ items: [
+ `<img src="https://mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">
+<video src="https://mock.com/DIYgod/RSSHub.mp4"></video>
+<video poster="https://mock.com/DIYgod/RSSHub.jpg">
+<source src="https://mock.com/DIYgod/RSSHub.mp4" type="video/mp4">
+<source src="https://mock.com/DIYgod/RSSHub.webm" type="video/webm">
+</video>
+<audio src="https://mock.com/DIYgod/RSSHub.mp3"></audio>
+<iframe src="https://mock.com/DIYgod/RSSHub.html" referrerpolicy="no-referrer"></iframe>`,
+ ],
+ desc: '<video src="http://mock.com/DIYgod/DIYgod/RSSHub"></video> - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)',
+ },
+ relayed: {
+ items: [
+ `<img src="https://i3.wp.com/mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">
+<video src="https://i3.wp.com/mock.com/DIYgod/RSSHub.mp4"></video>
+<video poster="https://i3.wp.com/mock.com/DIYgod/RSSHub.jpg">
+<source src="https://i3.wp.com/mock.com/DIYgod/RSSHub.mp4" type="video/mp4">
+<source src="https://i3.wp.com/mock.com/DIYgod/RSSHub.webm" type="video/webm">
+</video>
+<audio src="https://i3.wp.com/mock.com/DIYgod/RSSHub.mp3"></audio>
+<iframe src="https://mock.com/DIYgod/RSSHub.html" referrerpolicy="no-referrer"></iframe>`,
+ ],
+ desc: '<video src="https://i3.wp.com/mock.com/DIYgod/DIYgod/RSSHub"></video> - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)',
+ },
+ partlyRelayed: {
+ items: [
+ `<img src="https://mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">
+<video src="https://i3.wp.com/mock.com/DIYgod/RSSHub.mp4"></video>
+<video poster="https://i3.wp.com/mock.com/DIYgod/RSSHub.jpg">
+<source src="https://i3.wp.com/mock.com/DIYgod/RSSHub.mp4" type="video/mp4">
+<source src="https://i3.wp.com/mock.com/DIYgod/RSSHub.webm" type="video/webm">
+</video>
+<audio src="https://i3.wp.com/mock.com/DIYgod/RSSHub.mp3"></audio>
+<iframe src="https://mock.com/DIYgod/RSSHub.html" referrerpolicy="no-referrer"></iframe>`,
+ ],
+ desc: '<video src="https://i3.wp.com/mock.com/DIYgod/DIYgod/RSSHub"></video> - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)',
+ },
+ wrappedInIframe: {
+ items: [
+ `<img src="https://mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">
+<iframe referrerpolicy="no-referrer" width="100%" height="150vh" frameborder="0" marginheight="0" marginwidth="0" style="border:0; margin:0; padding:0; width:100%; height:150vh;" srcdoc="
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta name="referrer" content="no-referrer">
+ </head>
+ <body>
+ <video src="https://mock.com/DIYgod/RSSHub.mp4"></video>
+ </body>
+</html>
+">
+</iframe>
-const processed2 = `<a href="https://mock.com/DIYgod/RSSHub"></a>
-<img src="https://i3.wp.com/mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">`;
+<iframe referrerpolicy="no-referrer" width="100%" height="150vh" frameborder="0" marginheight="0" marginwidth="0" style="border:0; margin:0; padding:0; width:100%; height:150vh;" srcdoc="
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta name="referrer" content="no-referrer">
+ </head>
+ <body>
+ <video poster="https://mock.com/DIYgod/RSSHub.jpg">
+<source src="https://mock.com/DIYgod/RSSHub.mp4" type="video/mp4">
+<source src="https://mock.com/DIYgod/RSSHub.webm" type="video/webm">
+</video>
+ </body>
+</html>
+">
+</iframe>
-const oriRouteDesc = '<img src="http://mock.com/DIYgod/DIYgod/RSSHub"> - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)';
+<iframe referrerpolicy="no-referrer" width="100%" height="150vh" frameborder="0" marginheight="0" marginwidth="0" style="border:0; margin:0; padding:0; width:100%; height:150vh;" srcdoc="
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta name="referrer" content="no-referrer">
+ </head>
+ <body>
+ <audio src="https://mock.com/DIYgod/RSSHub.mp3"></audio>
+ </body>
+</html>
+">
+</iframe>
-const proRouteDesc = '<img src="https://i3.wp.com/mock.com/DIYgod/DIYgod/RSSHub"> - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)';
+<iframe src="https://mock.com/DIYgod/RSSHub.html" referrerpolicy="no-referrer"></iframe>`,
+ ],
+ desc: `<iframe referrerpolicy="no-referrer" width="100%" height="150vh" frameborder="0" marginheight="0" marginwidth="0" style="border:0; margin:0; padding:0; width:100%; height:150vh;" srcdoc="
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta name="referrer" content="no-referrer">
+ </head>
+ <body>
+ <video src="http://mock.com/DIYgod/DIYgod/RSSHub"></video>
+ </body>
+</html>
+">
+</iframe>
+ - Made with love by RSSHub(https://github.com/DIYgod/RSSHub)`,
+ },
+ },
+};
-const testAntiHotlink = async (expect1, expect2, expectRouteDesc) => {
+const testAntiHotlink = async (path, expectObj, query) => {
server = require('../../lib/index');
const request = supertest(server);
- const response = await request.get('/test/complicated');
+ let queryStr;
+ if (query) {
+ queryStr = typeof query === 'string' ? query : querystring.stringify(query);
+ }
+ path = path + (queryStr ? `?${queryStr}` : '');
+
+ const response = await request.get(path);
const parsed = await parser.parseString(response.text);
- expect(parsed.items[0].content).toBe(expect1);
- expect(parsed.items[1].content).toBe(expect2);
- expect(parsed.description).toBe(expectRouteDesc);
+ expect({
+ items: parsed.items.slice(0, expectObj.items.length).map((i) => i.content),
+ desc: parsed.description,
+ }).toStrictEqual(expectObj);
+
return parsed;
};
-const expectOrigin = async () => await testAntiHotlink(origin1, origin2, oriRouteDesc);
-
-const expectProcessed = async () => await testAntiHotlink(processed1, processed2, proRouteDesc);
+const expectImgOrigin = async (query) => await testAntiHotlink('/test/complicated', expects.complicated.origin, query);
+const expectImgProcessed = async (query) => await testAntiHotlink('/test/complicated', expects.complicated.processed, query);
+const expectImgUrlencoded = async (query) => await testAntiHotlink('/test/complicated', expects.complicated.urlencoded, query);
+const expectMultimediaOrigin = async (query) => await testAntiHotlink('/test/multimedia', expects.multimedia.origin, query);
+const expectMultimediaRelayed = async (query) => await testAntiHotlink('/test/multimedia', expects.multimedia.relayed, query);
+const expectMultimediaPartlyRelayed = async (query) => await testAntiHotlink('/test/multimedia', expects.multimedia.partlyRelayed, query);
+const expectMultimediaWrappedInIframe = async (query) => await testAntiHotlink('/test/multimedia', expects.multimedia.wrappedInIframe, query);
describe('anti-hotlink', () => {
- // First-time require is really, really slow.
- // If someone merely runs this test unit instead of the whole suite and this stage does not exist,
- // the next one will sometimes time out, so we need to firstly require it once.
- it('server-require', () => {
- server = require('../../lib/index');
+ it('template-legacy', async () => {
+ process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
+ await expectImgProcessed();
});
- it('template', async () => {
+ it('template-experimental', async () => {
process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
- await expectProcessed();
+ process.env.ALLOW_USER_HOTLINK_TEMPLATE = 'true';
+ await expectImgProcessed();
+ await expectMultimediaRelayed({ multimedia_hotlink_template: process.env.HOTLINK_TEMPLATE });
});
it('url', async () => {
process.env.HOTLINK_TEMPLATE = '${protocol}//${host}${pathname}';
- await expectOrigin();
+ await expectImgOrigin();
+ await expectMultimediaOrigin({ multimedia_hotlink_template: process.env.HOTLINK_TEMPLATE });
+ });
+
+ it('url-encoded', async () => {
+ process.env.HOTLINK_TEMPLATE = 'https://images.weserv.nl?url=${href_ue}';
+ await expectImgUrlencoded();
+ });
+
+ it('template-priority-legacy', async () => {
+ process.env.HOTLINK_TEMPLATE = '${protocol}//${host}${pathname}';
+ await expectImgOrigin();
+ });
+
+ it('template-priority-experimental', async () => {
+ process.env.ALLOW_USER_HOTLINK_TEMPLATE = 'true';
+ await expectImgOrigin();
+ await expectImgProcessed({ image_hotlink_template: 'https://i3.wp.com/${host}${pathname}' });
});
it('no-template', async () => {
process.env.HOTLINK_TEMPLATE = '';
- await expectOrigin();
+ await expectImgOrigin();
+ await expectMultimediaOrigin();
+ });
+
+ it('multimedia-template-experimental', async () => {
+ process.env.ALLOW_USER_HOTLINK_TEMPLATE = 'true';
+ await expectMultimediaOrigin({ multimedia_hotlink_template: '${protocol}//${host}${pathname}' });
+ await expectMultimediaPartlyRelayed({ multimedia_hotlink_template: 'https://i3.wp.com/${host}${pathname}' });
+ });
+
+ it('multimedia-wrapped-in-iframe-experimental', async () => {
+ await expectMultimediaWrappedInIframe({ wrap_multimedia_in_iframe: '1' });
});
it('include-paths-partial-matched', async () => {
process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
process.env.HOTLINK_INCLUDE_PATHS = '/test';
- await expectProcessed();
+ await expectImgProcessed();
});
it('include-paths-fully-matched', async () => {
process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
process.env.HOTLINK_INCLUDE_PATHS = '/test/complicated';
- await expectProcessed();
+ await expectImgProcessed();
});
it('include-paths-unmatched', async () => {
process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
process.env.HOTLINK_INCLUDE_PATHS = '/t';
- await expectOrigin();
+ await expectImgOrigin();
});
it('exclude-paths-partial-matched', async () => {
process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
process.env.HOTLINK_EXCLUDE_PATHS = '/test';
- await expectOrigin();
+ await expectImgOrigin();
});
it('exclude-paths-fully-matched', async () => {
process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
process.env.HOTLINK_EXCLUDE_PATHS = '/test/complicated';
- await expectOrigin();
+ await expectImgOrigin();
});
it('exclude-paths-unmatched', async () => {
process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
process.env.HOTLINK_EXCLUDE_PATHS = '/t';
- await expectProcessed();
+ await expectImgProcessed();
});
it('include-exclude-paths-mixed-filtered-out', async () => {
process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
process.env.HOTLINK_INCLUDE_PATHS = '/test';
process.env.HOTLINK_EXCLUDE_PATHS = '/test/complicated';
- await expectOrigin();
+ await expectImgOrigin();
});
it('include-exclude-paths-mixed-unfiltered-out', async () => {
process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${host}${pathname}';
process.env.HOTLINK_INCLUDE_PATHS = '/test';
process.env.HOTLINK_EXCLUDE_PATHS = '/test/c';
- await expectProcessed();
+ await expectImgProcessed();
+ });
+
+ it('invalid-property', async () => {
+ process.env.HOTLINK_TEMPLATE = 'https://i3.wp.com/${createObjectURL}';
+ server = require('../../lib/index');
+ const request = supertest(server);
+ const response = await request.get('/test/complicated');
+ expect(response.text).toContain('Error: Invalid URL property: createObjectURL');
});
});
diff --git a/test/middleware/parameter.js b/test/middleware/parameter.js
index e8afb7df201113..bed06521568fae 100644
--- a/test/middleware/parameter.js
+++ b/test/middleware/parameter.js
@@ -287,7 +287,7 @@ describe('multimedia_description', () => {
const parsed = await parser.parseString(response.text);
expect(parsed.items[0].content).toBe(`<img src="https://mock.com/DIYgod/RSSHub.jpg" referrerpolicy="no-referrer">
<video src="https://mock.com/DIYgod/RSSHub.mp4"></video>
-<video src="https://mock.com/DIYgod/undefined">
+<video poster="https://mock.com/DIYgod/RSSHub.jpg">
<source src="https://mock.com/DIYgod/RSSHub.mp4" type="video/mp4">
<source src="https://mock.com/DIYgod/RSSHub.webm" type="video/webm">
</video>
|
311cd9a15d171873c4f038305f873e6a7dc907ac
|
2021-08-12 11:50:08
|
Aidi Stan
|
feat(route): add 生物探索 (#7897)
| false
|
add 生物探索 (#7897)
|
feat
|
diff --git a/docs/en/new-media.md b/docs/en/new-media.md
index c72e3908b8c611..2697921f520d0c 100644
--- a/docs/en/new-media.md
+++ b/docs/en/new-media.md
@@ -59,6 +59,18 @@ Compared to the official one, the RSS feed generated by RSSHub not only has more
</RouteEn>
+## biodiscover.com
+
+### Channel
+
+<Route author="aidistan" example="/biodiscover" path="/biodiscover/:channel?" :paramsDesc="['channel, see below, `home` by default']">
+
+| Home | Research | Industry | Financing | Politics | Celebrity | Company | Product | Activity |
+| ---- | -------- | -------- | --------- | -------- | --------- | ------- | ------- | -------- |
+| home | research | industry | financing | politics | celebrity | company | product | activity |
+
+</Route>
+
## BOF
### Home
diff --git a/docs/new-media.md b/docs/new-media.md
index 17b6aafbd59fba..69c10eb932fc0a 100644
--- a/docs/new-media.md
+++ b/docs/new-media.md
@@ -1938,6 +1938,18 @@ column 为 third 时可选的 category:
<Route author="nczitzk" example="/bioon/latest" path="/bioon/latest"/>
+## 生物探索
+
+### 频道
+
+<Route author="aidistan" example="/biodiscover" path="/biodiscover/:channel?" :paramsDesc="['频道,见下表,默认为首页']">
+
+| 首页 | 研究 | 产业 | 融资 | 时政 | 人物 | 公司 | 新品 | 活动 |
+| ---- | -------- | -------- | --------- | -------- | --------- | ------- | ------- | -------- |
+| home | research | industry | financing | politics | celebrity | company | product | activity |
+
+</Route>
+
## 世界卫生组织 WHO
### 媒体中心
diff --git a/lib/router.js b/lib/router.js
index 5f5be0d2fd8be4..b2bbf81bb7dc79 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -4158,4 +4158,7 @@ router.get('/tanchinese/:category?', require('./routes/tanchinese'));
// Harvard
router.get('/harvard/health/blog', require('./routes/universities/harvard/health/blog'));
+// 生物探索
+router.get('/biodiscover/:channel?', require('./routes/biodiscover'));
+
module.exports = router;
diff --git a/lib/routes/biodiscover/index.js b/lib/routes/biodiscover/index.js
new file mode 100644
index 00000000000000..ca89a49ab0bed1
--- /dev/null
+++ b/lib/routes/biodiscover/index.js
@@ -0,0 +1,44 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseRelativeDate } = require('@/utils/parse-date');
+const timezone = require('@/utils/timezone');
+
+module.exports = async (ctx) => {
+ const channel = ctx.params.channel || 'home';
+ const listUrl = 'http://www.biodiscover.com' + (channel === 'home' ? '/' : '/news/' + channel);
+ const response = await got({ url: listUrl });
+ const $ = cheerio.load(response.data);
+
+ const listTitle = $('.list-title').text().trim();
+ const itemUrls = $('.news_list li h2 a')
+ .map((_, item) => 'http://www.biodiscover.com' + $(item).attr('href'))
+ .toArray();
+
+ ctx.state.data = {
+ title: '生物探索' + (listTitle ? ` - ${listTitle}` : ''),
+ link: listUrl,
+ description: $('meta[name=description]').attr('content'),
+ item: await Promise.all(
+ itemUrls.map(
+ async (itemUrl) =>
+ await ctx.cache.tryGet(itemUrl, async () => {
+ const detailResponse = await got({ url: itemUrl });
+ const $ = cheerio.load(detailResponse.data);
+
+ const dateStr = $('.from').children().last().text().replace('·', '').trim();
+
+ return {
+ title: $('.article_title').text(),
+ author: $('.from').children().first().text().trim(),
+ category: $('.article .share .tag a')
+ .map((_, a) => $(a).text().trim())
+ .toArray(),
+ description: $('.article .main_info').html(),
+ pubDate: timezone(parseRelativeDate(dateStr) || new Date(dateStr), +8),
+ link: itemUrl,
+ };
+ })
+ )
+ ),
+ };
+};
|
6b02cc338add65d1f88dcfa6fbc5fc22f675793d
|
2018-10-26 08:34:14
|
DIYgod
|
docs: fix link
| false
|
fix link
|
docs
|
diff --git a/docs/README.md b/docs/README.md
index d7e9516860576b..277a2e520a2cd8 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -87,7 +87,7 @@ Telegram 即时预览模式需要在官网制作页面处理模板,请前往[
- tgiv: 模板 hash,可从模板制作页面分享出来的链接末尾获取(`&rhash=`后面跟着的字符串)
-举例: <https://rsshub.app//novel/biquge/94_94525?tgiv=bd3c42818a7f7e>
+举例: <https://rsshub.app/novel/biquge/94_94525?tgiv=bd3c42818a7f7e>
### 输出格式
|
2acdeb47a9eb4626304f34caa54551b5aeda4e11
|
2022-09-13 03:01:57
|
dependabot[bot]
|
chore(deps-dev): bump jest from 29.0.2 to 29.0.3 (#10775)
| false
|
bump jest from 29.0.2 to 29.0.3 (#10775)
|
chore
|
diff --git a/package.json b/package.json
index 5c23724d279353..b006e743665d35 100644
--- a/package.json
+++ b/package.json
@@ -54,7 +54,7 @@
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-yml": "1.2.0",
"fs-extra": "10.1.0",
- "jest": "29.0.2",
+ "jest": "29.0.3",
"meilisearch": "0.27.0",
"mockdate": "3.0.5",
"nock": "13.2.9",
diff --git a/yarn.lock b/yarn.lock
index dcdd519f91d58a..61c95aa690068a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1080,28 +1080,28 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98"
integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==
-"@jest/console@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.2.tgz#3a02dccad4dd37c25fd30013df67ec50998402ce"
- integrity sha512-Fv02ijyhF4D/Wb3DvZO3iBJQz5DnzpJEIDBDbvje8Em099N889tNMUnBw7SalmSuOI+NflNG40RA1iK71kImPw==
+"@jest/console@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.3.tgz#a222ab87e399317a89db88a58eaec289519e807a"
+ integrity sha512-cGg0r+klVHSYnfE977S9wmpuQ9L+iYuYgL+5bPXiUlUynLLYunRxswEmhBzvrSKGof5AKiHuTTmUKAqRcDY9dg==
dependencies:
- "@jest/types" "^29.0.2"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
chalk "^4.0.0"
- jest-message-util "^29.0.2"
- jest-util "^29.0.2"
+ jest-message-util "^29.0.3"
+ jest-util "^29.0.3"
slash "^3.0.0"
-"@jest/core@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.2.tgz#7bf47ff6cd882678c47fbdea562bdf1ff03b6d33"
- integrity sha512-imP5M6cdpHEOkmcuFYZuM5cTG1DAF7ZlVNCq1+F7kbqme2Jcl+Kh4M78hihM76DJHNkurbv4UVOnejGxBKEmww==
- dependencies:
- "@jest/console" "^29.0.2"
- "@jest/reporters" "^29.0.2"
- "@jest/test-result" "^29.0.2"
- "@jest/transform" "^29.0.2"
- "@jest/types" "^29.0.2"
+"@jest/core@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.3.tgz#ba22a9cbd0c7ba36e04292e2093c547bf53ec1fd"
+ integrity sha512-1d0hLbOrM1qQE3eP3DtakeMbKTcXiXP3afWxqz103xPyddS2NhnNghS7MaXx1dcDt4/6p4nlhmeILo2ofgi8cQ==
+ dependencies:
+ "@jest/console" "^29.0.3"
+ "@jest/reporters" "^29.0.3"
+ "@jest/test-result" "^29.0.3"
+ "@jest/transform" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
ansi-escapes "^4.2.1"
chalk "^4.0.0"
@@ -1109,80 +1109,80 @@
exit "^0.1.2"
graceful-fs "^4.2.9"
jest-changed-files "^29.0.0"
- jest-config "^29.0.2"
- jest-haste-map "^29.0.2"
- jest-message-util "^29.0.2"
+ jest-config "^29.0.3"
+ jest-haste-map "^29.0.3"
+ jest-message-util "^29.0.3"
jest-regex-util "^29.0.0"
- jest-resolve "^29.0.2"
- jest-resolve-dependencies "^29.0.2"
- jest-runner "^29.0.2"
- jest-runtime "^29.0.2"
- jest-snapshot "^29.0.2"
- jest-util "^29.0.2"
- jest-validate "^29.0.2"
- jest-watcher "^29.0.2"
+ jest-resolve "^29.0.3"
+ jest-resolve-dependencies "^29.0.3"
+ jest-runner "^29.0.3"
+ jest-runtime "^29.0.3"
+ jest-snapshot "^29.0.3"
+ jest-util "^29.0.3"
+ jest-validate "^29.0.3"
+ jest-watcher "^29.0.3"
micromatch "^4.0.4"
- pretty-format "^29.0.2"
+ pretty-format "^29.0.3"
slash "^3.0.0"
strip-ansi "^6.0.0"
-"@jest/environment@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.2.tgz#9e4b6d4c9bce5bfced6f63945d8c8e571394f572"
- integrity sha512-Yf+EYaLOrVCgts/aTS5nGznU4prZUPa5k9S63Yct8YSOKj2jkdS17hHSUKhk5jxDFMyCy1PXknypDw7vfgc/mA==
+"@jest/environment@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.3.tgz#7745ec30a954e828e8cc6df6a13280d3b51d8f35"
+ integrity sha512-iKl272NKxYNQNqXMQandAIwjhQaGw5uJfGXduu8dS9llHi8jV2ChWrtOAVPnMbaaoDhnI3wgUGNDvZgHeEJQCA==
dependencies:
- "@jest/fake-timers" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/fake-timers" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
- jest-mock "^29.0.2"
+ jest-mock "^29.0.3"
-"@jest/expect-utils@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.2.tgz#00dfcb9e6fe99160c326ba39f7734b984543dea8"
- integrity sha512-+wcQF9khXKvAEi8VwROnCWWmHfsJYCZAs5dmuMlJBKk57S6ZN2/FQMIlo01F29fJyT8kV/xblE7g3vkIdTLOjw==
+"@jest/expect-utils@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.3.tgz#f5bb86f5565bf2dacfca31ccbd887684936045b2"
+ integrity sha512-i1xUkau7K/63MpdwiRqaxgZOjxYs4f0WMTGJnYwUKubsNRZSeQbLorS7+I4uXVF9KQ5r61BUPAUMZ7Lf66l64Q==
dependencies:
jest-get-type "^29.0.0"
-"@jest/expect@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.2.tgz#641d151e1062ceb976c5ad1c23eba3bb1e188896"
- integrity sha512-y/3geZ92p2/zovBm/F+ZjXUJ3thvT9IRzD6igqaWskFE2aR0idD+N/p5Lj/ZautEox/9RwEc6nqergebeh72uQ==
+"@jest/expect@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.3.tgz#9dc7c46354eeb7a348d73881fba6402f5fdb2c30"
+ integrity sha512-6W7K+fsI23FQ01H/BWccPyDZFrnU9QlzDcKOjrNVU5L8yUORFAJJIpmyxWPW70+X624KUNqzZwPThPMX28aXEQ==
dependencies:
- expect "^29.0.2"
- jest-snapshot "^29.0.2"
+ expect "^29.0.3"
+ jest-snapshot "^29.0.3"
-"@jest/fake-timers@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.2.tgz#6f15f4d8eb1089d445e3f73473ddc434faa2f798"
- integrity sha512-2JhQeWU28fvmM5r33lxg6BxxkTKaVXs6KMaJ6eXSM8ml/MaWkt2BvbIO8G9KWAJFMdBXWbn+2h9OK1/s5urKZA==
+"@jest/fake-timers@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.3.tgz#ad5432639b715d45a86a75c47fd75019bc36b22c"
+ integrity sha512-tmbUIo03x0TdtcZCESQ0oQSakPCpo7+s6+9mU19dd71MptkP4zCwoeZqna23//pgbhtT1Wq02VmA9Z9cNtvtCQ==
dependencies:
- "@jest/types" "^29.0.2"
+ "@jest/types" "^29.0.3"
"@sinonjs/fake-timers" "^9.1.2"
"@types/node" "*"
- jest-message-util "^29.0.2"
- jest-mock "^29.0.2"
- jest-util "^29.0.2"
+ jest-message-util "^29.0.3"
+ jest-mock "^29.0.3"
+ jest-util "^29.0.3"
-"@jest/globals@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.2.tgz#605d3389ad0c6bfe17ad3e1359b5bc39aefd8b65"
- integrity sha512-4hcooSNJCVXuTu07/VJwCWW6HTnjLtQdqlcGisK6JST7z2ixa8emw4SkYsOk7j36WRc2ZUEydlUePnOIOTCNXg==
+"@jest/globals@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.3.tgz#681950c430fdc13ff9aa89b2d8d572ac0e4a1bf5"
+ integrity sha512-YqGHT65rFY2siPIHHFjuCGUsbzRjdqkwbat+Of6DmYRg5shIXXrLdZoVE/+TJ9O1dsKsFmYhU58JvIbZRU1Z9w==
dependencies:
- "@jest/environment" "^29.0.2"
- "@jest/expect" "^29.0.2"
- "@jest/types" "^29.0.2"
- jest-mock "^29.0.2"
+ "@jest/environment" "^29.0.3"
+ "@jest/expect" "^29.0.3"
+ "@jest/types" "^29.0.3"
+ jest-mock "^29.0.3"
-"@jest/reporters@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.2.tgz#5f927646b6f01029525c05ac108324eac7d7ad5c"
- integrity sha512-Kr41qejRQHHkCgWHC9YwSe7D5xivqP4XML+PvgwsnRFaykKdNflDUb4+xLXySOU+O/bPkVdFpGzUpVNSJChCrw==
+"@jest/reporters@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.3.tgz#735f110e08b44b38729d8dbbb74063bdf5aba8a5"
+ integrity sha512-3+QU3d4aiyOWfmk1obDerie4XNCaD5Xo1IlKNde2yGEi02WQD+ZQD0i5Hgqm1e73sMV7kw6pMlCnprtEwEVwxw==
dependencies:
"@bcoe/v8-coverage" "^0.2.3"
- "@jest/console" "^29.0.2"
- "@jest/test-result" "^29.0.2"
- "@jest/transform" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/console" "^29.0.3"
+ "@jest/test-result" "^29.0.3"
+ "@jest/transform" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@jridgewell/trace-mapping" "^0.3.15"
"@types/node" "*"
chalk "^4.0.0"
@@ -1195,9 +1195,9 @@
istanbul-lib-report "^3.0.0"
istanbul-lib-source-maps "^4.0.0"
istanbul-reports "^3.1.3"
- jest-message-util "^29.0.2"
- jest-util "^29.0.2"
- jest-worker "^29.0.2"
+ jest-message-util "^29.0.3"
+ jest-util "^29.0.3"
+ jest-worker "^29.0.3"
slash "^3.0.0"
string-length "^4.0.1"
strip-ansi "^6.0.0"
@@ -1220,51 +1220,51 @@
callsites "^3.0.0"
graceful-fs "^4.2.9"
-"@jest/test-result@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.2.tgz#dde4922e6234dd311c85ddf1ec2b7f600a90295d"
- integrity sha512-b5rDc0lLL6Kx73LyCx6370k9uZ8o5UKdCpMS6Za3ke7H9y8PtAU305y6TeghpBmf2In8p/qqi3GpftgzijSsNw==
+"@jest/test-result@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.3.tgz#b03d8ef4c58be84cd5d5d3b24d4b4c8cabbf2746"
+ integrity sha512-vViVnQjCgTmbhDKEonKJPtcFe9G/CJO4/Np4XwYJah+lF2oI7KKeRp8t1dFvv44wN2NdbDb/qC6pi++Vpp0Dlg==
dependencies:
- "@jest/console" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/console" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@types/istanbul-lib-coverage" "^2.0.0"
collect-v8-coverage "^1.0.0"
-"@jest/test-sequencer@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.2.tgz#ae9b2d2c1694c7aa1a407713100e14dbfa79293e"
- integrity sha512-fsyZqHBlXNMv5ZqjQwCuYa2pskXCO0DVxh5aaVCuAtwzHuYEGrhordyEncBLQNuCGQSYgElrEEmS+7wwFnnMKw==
+"@jest/test-sequencer@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.0.3.tgz#0681061ad21fb8e293b49c4fdf7e631ca79240ba"
+ integrity sha512-Hf4+xYSWZdxTNnhDykr8JBs0yBN/nxOXyUQWfotBUqqy0LF9vzcFB0jm/EDNZCx587znLWTIgxcokW7WeZMobQ==
dependencies:
- "@jest/test-result" "^29.0.2"
+ "@jest/test-result" "^29.0.3"
graceful-fs "^4.2.9"
- jest-haste-map "^29.0.2"
+ jest-haste-map "^29.0.3"
slash "^3.0.0"
-"@jest/transform@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.2.tgz#eef90ebd939b68bf2c2508d9e914377871869146"
- integrity sha512-lajVQx2AnsR+Pa17q2zR7eikz2PkPs1+g/qPbZkqQATeS/s6eT55H+yHcsLfuI/0YQ/4VSBepSu3bOX+44q0aA==
+"@jest/transform@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.3.tgz#9eb1fed2072a0354f190569807d1250572fb0970"
+ integrity sha512-C5ihFTRYaGDbi/xbRQRdbo5ddGtI4VSpmL6AIcZxdhwLbXMa7PcXxxqyI91vGOFHnn5aVM3WYnYKCHEqmLVGzg==
dependencies:
"@babel/core" "^7.11.6"
- "@jest/types" "^29.0.2"
+ "@jest/types" "^29.0.3"
"@jridgewell/trace-mapping" "^0.3.15"
babel-plugin-istanbul "^6.1.1"
chalk "^4.0.0"
convert-source-map "^1.4.0"
fast-json-stable-stringify "^2.1.0"
graceful-fs "^4.2.9"
- jest-haste-map "^29.0.2"
+ jest-haste-map "^29.0.3"
jest-regex-util "^29.0.0"
- jest-util "^29.0.2"
+ jest-util "^29.0.3"
micromatch "^4.0.4"
pirates "^4.0.4"
slash "^3.0.0"
write-file-atomic "^4.0.1"
-"@jest/types@^29.0.2":
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.2.tgz#5a5391fa7f7f41bf4b201d6d2da30e874f95b6c1"
- integrity sha512-5WNMesBLmlkt1+fVkoCjHa0X3i3q8zc4QLTDkdHgCa2gyPZc7rdlZBWgVLqwS1860ZW5xJuCDwAzqbGaXIr/ew==
+"@jest/types@^29.0.3":
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.3.tgz#0be78fdddb1a35aeb2041074e55b860561c8ef63"
+ integrity sha512-coBJmOQvurXjN1Hh5PzF7cmsod0zLIOXpP8KD161mqNlroMhLcwpODiEzi7ZsRl5Z/AIuxpeNm8DCl43F4kz8A==
dependencies:
"@jest/schemas" "^29.0.0"
"@types/istanbul-lib-coverage" "^2.0.0"
@@ -3049,12 +3049,12 @@ babel-extract-comments@^1.0.0:
dependencies:
babylon "^6.18.0"
-babel-jest@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.2.tgz#7efde496c07607949e9be499bf277aa1543ded95"
- integrity sha512-yTu4/WSi/HzarjQtrJSwV+/0maoNt+iP0DmpvFJdv9yY+5BuNle8TbheHzzcSWj5gIHfuhpbLYHWRDYhWKyeKQ==
+babel-jest@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.3.tgz#64e156a47a77588db6a669a88dedff27ed6e260f"
+ integrity sha512-ApPyHSOhS/sVzwUOQIWJmdvDhBsMG01HX9z7ogtkp1TToHGGUWFlnXJUIzCgKPSfiYLn3ibipCYzsKSURHEwLg==
dependencies:
- "@jest/transform" "^29.0.2"
+ "@jest/transform" "^29.0.3"
"@types/babel__core" "^7.1.14"
babel-plugin-istanbul "^6.1.1"
babel-preset-jest "^29.0.2"
@@ -5971,16 +5971,16 @@ expand-brackets@^2.1.4:
snapdragon "^0.8.1"
to-regex "^3.0.1"
-expect@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.2.tgz#22c7132400f60444b427211f1d6bb604a9ab2420"
- integrity sha512-JeJlAiLKn4aApT4pzUXBVxl3NaZidWIOdg//smaIlP9ZMBDkHZGFd9ubphUZP9pUyDEo7bC6M0IIZR51o75qQw==
+expect@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.3.tgz#6be65ddb945202f143c4e07c083f4f39f3bd326f"
+ integrity sha512-t8l5DTws3212VbmPL+tBFXhjRHLmctHB0oQbL8eUc6S7NzZtYUhycrFO9mkxA0ZUC6FAWdNi7JchJSkODtcu1Q==
dependencies:
- "@jest/expect-utils" "^29.0.2"
+ "@jest/expect-utils" "^29.0.3"
jest-get-type "^29.0.0"
- jest-matcher-utils "^29.0.2"
- jest-message-util "^29.0.2"
- jest-util "^29.0.2"
+ jest-matcher-utils "^29.0.3"
+ jest-message-util "^29.0.3"
+ jest-util "^29.0.3"
express@^4.17.1:
version "4.18.1"
@@ -8240,86 +8240,86 @@ jest-changed-files@^29.0.0:
execa "^5.0.0"
p-limit "^3.1.0"
-jest-circus@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.2.tgz#7dda94888a8d47edb58e85a8e5f688f9da6657a3"
- integrity sha512-YTPEsoE1P1X0bcyDQi3QIkpt2Wl9om9k2DQRuLFdS5x8VvAKSdYAVJufgvudhnKgM8WHvvAzhBE+1DRQB8x1CQ==
+jest-circus@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.0.3.tgz#90faebc90295291cfc636b27dbd82e3bfb9e7a48"
+ integrity sha512-QeGzagC6Hw5pP+df1+aoF8+FBSgkPmraC1UdkeunWh0jmrp7wC0Hr6umdUAOELBQmxtKAOMNC3KAdjmCds92Zg==
dependencies:
- "@jest/environment" "^29.0.2"
- "@jest/expect" "^29.0.2"
- "@jest/test-result" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/environment" "^29.0.3"
+ "@jest/expect" "^29.0.3"
+ "@jest/test-result" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
chalk "^4.0.0"
co "^4.6.0"
dedent "^0.7.0"
is-generator-fn "^2.0.0"
- jest-each "^29.0.2"
- jest-matcher-utils "^29.0.2"
- jest-message-util "^29.0.2"
- jest-runtime "^29.0.2"
- jest-snapshot "^29.0.2"
- jest-util "^29.0.2"
+ jest-each "^29.0.3"
+ jest-matcher-utils "^29.0.3"
+ jest-message-util "^29.0.3"
+ jest-runtime "^29.0.3"
+ jest-snapshot "^29.0.3"
+ jest-util "^29.0.3"
p-limit "^3.1.0"
- pretty-format "^29.0.2"
+ pretty-format "^29.0.3"
slash "^3.0.0"
stack-utils "^2.0.3"
-jest-cli@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.2.tgz#adf341ee3a4fd6ad1f23e3c0eb4e466847407021"
- integrity sha512-tlf8b+4KcUbBGr25cywIi3+rbZ4+G+SiG8SvY552m9sRZbXPafdmQRyeVE/C/R8K+TiBAMrTIUmV2SlStRJ40g==
+jest-cli@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.3.tgz#fd8f0ef363a7a3d9c53ef62e0651f18eeffa77b9"
+ integrity sha512-aUy9Gd/Kut1z80eBzG10jAn6BgS3BoBbXyv+uXEqBJ8wnnuZ5RpNfARoskSrTIy1GY4a8f32YGuCMwibtkl9CQ==
dependencies:
- "@jest/core" "^29.0.2"
- "@jest/test-result" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/core" "^29.0.3"
+ "@jest/test-result" "^29.0.3"
+ "@jest/types" "^29.0.3"
chalk "^4.0.0"
exit "^0.1.2"
graceful-fs "^4.2.9"
import-local "^3.0.2"
- jest-config "^29.0.2"
- jest-util "^29.0.2"
- jest-validate "^29.0.2"
+ jest-config "^29.0.3"
+ jest-util "^29.0.3"
+ jest-validate "^29.0.3"
prompts "^2.0.1"
yargs "^17.3.1"
-jest-config@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.2.tgz#0ce168e1f74ca46c27285a7182ecb06c2d8ce7d9"
- integrity sha512-RU4gzeUNZAFktYVzDGimDxeYoaiTnH100jkYYZgldqFamaZukF0IqmFx8+QrzVeEWccYg10EEJT3ox1Dq5b74w==
+jest-config@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.0.3.tgz#c2e52a8f5adbd18de79f99532d8332a19e232f13"
+ integrity sha512-U5qkc82HHVYe3fNu2CRXLN4g761Na26rWKf7CjM8LlZB3In1jadEkZdMwsE37rd9RSPV0NfYaCjHdk/gu3v+Ew==
dependencies:
"@babel/core" "^7.11.6"
- "@jest/test-sequencer" "^29.0.2"
- "@jest/types" "^29.0.2"
- babel-jest "^29.0.2"
+ "@jest/test-sequencer" "^29.0.3"
+ "@jest/types" "^29.0.3"
+ babel-jest "^29.0.3"
chalk "^4.0.0"
ci-info "^3.2.0"
deepmerge "^4.2.2"
glob "^7.1.3"
graceful-fs "^4.2.9"
- jest-circus "^29.0.2"
- jest-environment-node "^29.0.2"
+ jest-circus "^29.0.3"
+ jest-environment-node "^29.0.3"
jest-get-type "^29.0.0"
jest-regex-util "^29.0.0"
- jest-resolve "^29.0.2"
- jest-runner "^29.0.2"
- jest-util "^29.0.2"
- jest-validate "^29.0.2"
+ jest-resolve "^29.0.3"
+ jest-runner "^29.0.3"
+ jest-util "^29.0.3"
+ jest-validate "^29.0.3"
micromatch "^4.0.4"
parse-json "^5.2.0"
- pretty-format "^29.0.2"
+ pretty-format "^29.0.3"
slash "^3.0.0"
strip-json-comments "^3.1.1"
-jest-diff@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.2.tgz#1a99419efda66f9ee72f91e580e774df95de5ddc"
- integrity sha512-b9l9970sa1rMXH1owp2Woprmy42qIwwll/htsw4Gf7+WuSp5bZxNhkKHDuCGKL+HoHn1KhcC+tNEeAPYBkD2Jg==
+jest-diff@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.3.tgz#41cc02409ad1458ae1bf7684129a3da2856341ac"
+ integrity sha512-+X/AIF5G/vX9fWK+Db9bi9BQas7M9oBME7egU7psbn4jlszLFCu0dW63UgeE6cs/GANq4fLaT+8sGHQQ0eCUfg==
dependencies:
chalk "^4.0.0"
diff-sequences "^29.0.0"
jest-get-type "^29.0.0"
- pretty-format "^29.0.2"
+ pretty-format "^29.0.3"
jest-docblock@^29.0.0:
version "29.0.0"
@@ -8328,92 +8328,92 @@ jest-docblock@^29.0.0:
dependencies:
detect-newline "^3.0.0"
-jest-each@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.2.tgz#f98375a79a37761137e11d458502dfe1f00ba5b0"
- integrity sha512-+sA9YjrJl35iCg0W0VCrgCVj+wGhDrrKQ+YAqJ/DHBC4gcDFAeePtRRhpJnX9gvOZ63G7gt52pwp2PesuSEx0Q==
+jest-each@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.0.3.tgz#7ef3157580b15a609d7ef663dd4fc9b07f4e1299"
+ integrity sha512-wILhZfESURHHBNvPMJ0lZlYZrvOQJxAo3wNHi+ycr90V7M+uGR9Gh4+4a/BmaZF0XTyZsk4OiYEf3GJN7Ltqzg==
dependencies:
- "@jest/types" "^29.0.2"
+ "@jest/types" "^29.0.3"
chalk "^4.0.0"
jest-get-type "^29.0.0"
- jest-util "^29.0.2"
- pretty-format "^29.0.2"
+ jest-util "^29.0.3"
+ pretty-format "^29.0.3"
-jest-environment-node@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.2.tgz#8196268c9f740f1d2e7ecccf212b4c1c5b0167e4"
- integrity sha512-4Fv8GXVCToRlMzDO94gvA8iOzKxQ7rhAbs8L+j8GPyTxGuUiYkV+63LecGeVdVhsL2KXih1sKnoqmH6tp89J7Q==
+jest-environment-node@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.0.3.tgz#293804b1e0fa5f0e354dacbe510655caa478a3b2"
+ integrity sha512-cdZqRCnmIlTXC+9vtvmfiY/40Cj6s2T0czXuq1whvQdmpzAnj4sbqVYuZ4zFHk766xTTJ+Ij3uUqkk8KCfXoyg==
dependencies:
- "@jest/environment" "^29.0.2"
- "@jest/fake-timers" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/environment" "^29.0.3"
+ "@jest/fake-timers" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
- jest-mock "^29.0.2"
- jest-util "^29.0.2"
+ jest-mock "^29.0.3"
+ jest-util "^29.0.3"
jest-get-type@^29.0.0:
version "29.0.0"
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80"
integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw==
-jest-haste-map@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.2.tgz#cac403a595e6e43982c9776b5c4dae63e38b22c5"
- integrity sha512-SOorh2ysQ0fe8gsF4gaUDhoMIWAvi2hXOkwThEO48qT3JqA8GLAUieQcIvdSEd6M0scRDe1PVmKc5tXR3Z0U0A==
+jest-haste-map@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.3.tgz#d7f3f7180f558d760eacc5184aac5a67f20ef939"
+ integrity sha512-uMqR99+GuBHo0RjRhOE4iA6LmsxEwRdgiIAQgMU/wdT2XebsLDz5obIwLZm/Psj+GwSEQhw9AfAVKGYbh2G55A==
dependencies:
- "@jest/types" "^29.0.2"
+ "@jest/types" "^29.0.3"
"@types/graceful-fs" "^4.1.3"
"@types/node" "*"
anymatch "^3.0.3"
fb-watchman "^2.0.0"
graceful-fs "^4.2.9"
jest-regex-util "^29.0.0"
- jest-util "^29.0.2"
- jest-worker "^29.0.2"
+ jest-util "^29.0.3"
+ jest-worker "^29.0.3"
micromatch "^4.0.4"
walker "^1.0.8"
optionalDependencies:
fsevents "^2.3.2"
-jest-leak-detector@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.2.tgz#f88fd08e352b5fad3d33e48ecab39e97077ed8a8"
- integrity sha512-5f0493qDeAxjUldkBSQg5D1cLadRgZVyWpTQvfJeQwQUpHQInE21AyVHVv64M7P2Ue8Z5EZ4BAcoDS/dSPPgMw==
+jest-leak-detector@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.0.3.tgz#e85cf3391106a7a250850b6766b508bfe9c7bc6f"
+ integrity sha512-YfW/G63dAuiuQ3QmQlh8hnqLDe25WFY3eQhuc/Ev1AGmkw5zREblTh7TCSKLoheyggu6G9gxO2hY8p9o6xbaRQ==
dependencies:
jest-get-type "^29.0.0"
- pretty-format "^29.0.2"
+ pretty-format "^29.0.3"
-jest-matcher-utils@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.2.tgz#0ffdcaec340a9810caee6c73ff90fb029b446e10"
- integrity sha512-s62YkHFBfAx0JLA2QX1BlnCRFwHRobwAv2KP1+YhjzF6ZCbCVrf1sG8UJyn62ZUsDaQKpoo86XMTjkUyO5aWmQ==
+jest-matcher-utils@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.3.tgz#b8305fd3f9e27cdbc210b21fc7dbba92d4e54560"
+ integrity sha512-RsR1+cZ6p1hDV4GSCQTg+9qjeotQCgkaleIKLK7dm+U4V/H2bWedU3RAtLm8+mANzZ7eDV33dMar4pejd7047w==
dependencies:
chalk "^4.0.0"
- jest-diff "^29.0.2"
+ jest-diff "^29.0.3"
jest-get-type "^29.0.0"
- pretty-format "^29.0.2"
+ pretty-format "^29.0.3"
-jest-message-util@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.2.tgz#b2781dfb6a2d1c63830d9684c5148ae3155c6154"
- integrity sha512-kcJAgms3ckJV0wUoLsAM40xAhY+pb9FVSZwicjFU9PFkaTNmqh9xd99/CzKse48wPM1ANUQKmp03/DpkY+lGrA==
+jest-message-util@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.3.tgz#f0254e1ffad21890c78355726202cc91d0a40ea8"
+ integrity sha512-7T8JiUTtDfppojosORAflABfLsLKMLkBHSWkjNQrjIltGoDzNGn7wEPOSfjqYAGTYME65esQzMJxGDjuLBKdOg==
dependencies:
"@babel/code-frame" "^7.12.13"
- "@jest/types" "^29.0.2"
+ "@jest/types" "^29.0.3"
"@types/stack-utils" "^2.0.0"
chalk "^4.0.0"
graceful-fs "^4.2.9"
micromatch "^4.0.4"
- pretty-format "^29.0.2"
+ pretty-format "^29.0.3"
slash "^3.0.0"
stack-utils "^2.0.3"
-jest-mock@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.2.tgz#d7810966a6338aca6a440c3cd9f19276477840ad"
- integrity sha512-giWXOIT23UCxHCN2VUfUJ0Q7SmiqQwfSFXlCaIhW5anITpNQ+3vuLPQdKt5wkuwM37GrbFyHIClce8AAK9ft9g==
+jest-mock@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.3.tgz#4f0093f6a9cb2ffdb9c44a07a3912f0c098c8de9"
+ integrity sha512-ort9pYowltbcrCVR43wdlqfAiFJXBx8l4uJDsD8U72LgBcetvEp+Qxj1W9ZYgMRoeAo+ov5cnAGF2B6+Oth+ww==
dependencies:
- "@jest/types" "^29.0.2"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
jest-pnp-resolver@^1.2.2:
@@ -8426,88 +8426,88 @@ jest-regex-util@^29.0.0:
resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de"
integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug==
-jest-resolve-dependencies@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.2.tgz#2d30199ed0059ff97712f4fa6320c590bfcd2061"
- integrity sha512-fSAu6eIG7wtGdnPJUkVVdILGzYAP9Dj/4+zvC8BrGe8msaUMJ9JeygU0Hf9+Uor6/icbuuzQn5See1uajLnAqg==
+jest-resolve-dependencies@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.3.tgz#f23a54295efc6374b86b198cf8efed5606d6b762"
+ integrity sha512-KzuBnXqNvbuCdoJpv8EanbIGObk7vUBNt/PwQPPx2aMhlv/jaXpUJsqWYRpP/0a50faMBY7WFFP8S3/CCzwfDw==
dependencies:
jest-regex-util "^29.0.0"
- jest-snapshot "^29.0.2"
+ jest-snapshot "^29.0.3"
-jest-resolve@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.2.tgz#dd097e1c8020fbed4a8c1e1889ccb56022288697"
- integrity sha512-V3uLjSA+EHxLtjIDKTBXnY71hyx+8lusCqPXvqzkFO1uCGvVpjBfuOyp+KOLBNSuY61kM2jhepiMwt4eiJS+Vw==
+jest-resolve@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.0.3.tgz#329a3431e3b9eb6629a2cd483e9bed95b26827b9"
+ integrity sha512-toVkia85Y/BPAjJasTC9zIPY6MmVXQPtrCk8SmiheC4MwVFE/CMFlOtMN6jrwPMC6TtNh8+sTMllasFeu1wMPg==
dependencies:
chalk "^4.0.0"
graceful-fs "^4.2.9"
- jest-haste-map "^29.0.2"
+ jest-haste-map "^29.0.3"
jest-pnp-resolver "^1.2.2"
- jest-util "^29.0.2"
- jest-validate "^29.0.2"
+ jest-util "^29.0.3"
+ jest-validate "^29.0.3"
resolve "^1.20.0"
resolve.exports "^1.1.0"
slash "^3.0.0"
-jest-runner@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.2.tgz#64e4e6c88f74387307687b73a4688f93369d8d99"
- integrity sha512-+D82iPZejI8t+SfduOO1deahC/QgLFf8aJBO++Znz3l2ETtOMdM7K4ATsGWzCFnTGio5yHaRifg1Su5Ybza5Nw==
- dependencies:
- "@jest/console" "^29.0.2"
- "@jest/environment" "^29.0.2"
- "@jest/test-result" "^29.0.2"
- "@jest/transform" "^29.0.2"
- "@jest/types" "^29.0.2"
+jest-runner@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.0.3.tgz#2e47fe1e8777aea9b8970f37e8f83630b508fb87"
+ integrity sha512-Usu6VlTOZlCZoNuh3b2Tv/yzDpKqtiNAetG9t3kJuHfUyVMNW7ipCCJOUojzKkjPoaN7Bl1f7Buu6PE0sGpQxw==
+ dependencies:
+ "@jest/console" "^29.0.3"
+ "@jest/environment" "^29.0.3"
+ "@jest/test-result" "^29.0.3"
+ "@jest/transform" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
chalk "^4.0.0"
emittery "^0.10.2"
graceful-fs "^4.2.9"
jest-docblock "^29.0.0"
- jest-environment-node "^29.0.2"
- jest-haste-map "^29.0.2"
- jest-leak-detector "^29.0.2"
- jest-message-util "^29.0.2"
- jest-resolve "^29.0.2"
- jest-runtime "^29.0.2"
- jest-util "^29.0.2"
- jest-watcher "^29.0.2"
- jest-worker "^29.0.2"
+ jest-environment-node "^29.0.3"
+ jest-haste-map "^29.0.3"
+ jest-leak-detector "^29.0.3"
+ jest-message-util "^29.0.3"
+ jest-resolve "^29.0.3"
+ jest-runtime "^29.0.3"
+ jest-util "^29.0.3"
+ jest-watcher "^29.0.3"
+ jest-worker "^29.0.3"
p-limit "^3.1.0"
source-map-support "0.5.13"
-jest-runtime@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.2.tgz#dc3de788b8d75af346ae163d59c585027a9d809c"
- integrity sha512-DO6F81LX4okOgjJLkLySv10E5YcV5NHUbY1ZqAUtofxdQE+q4hjH0P2gNsY8x3z3sqgw7O/+919SU4r18Fcuig==
+jest-runtime@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.0.3.tgz#5a823ec5902257519556a4e5a71a868e8fd788aa"
+ integrity sha512-12gZXRQ7ozEeEHKTY45a+YLqzNDR/x4c//X6AqwKwKJPpWM8FY4vwn4VQJOcLRS3Nd1fWwgP7LU4SoynhuUMHQ==
dependencies:
- "@jest/environment" "^29.0.2"
- "@jest/fake-timers" "^29.0.2"
- "@jest/globals" "^29.0.2"
+ "@jest/environment" "^29.0.3"
+ "@jest/fake-timers" "^29.0.3"
+ "@jest/globals" "^29.0.3"
"@jest/source-map" "^29.0.0"
- "@jest/test-result" "^29.0.2"
- "@jest/transform" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/test-result" "^29.0.3"
+ "@jest/transform" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
chalk "^4.0.0"
cjs-module-lexer "^1.0.0"
collect-v8-coverage "^1.0.0"
glob "^7.1.3"
graceful-fs "^4.2.9"
- jest-haste-map "^29.0.2"
- jest-message-util "^29.0.2"
- jest-mock "^29.0.2"
+ jest-haste-map "^29.0.3"
+ jest-message-util "^29.0.3"
+ jest-mock "^29.0.3"
jest-regex-util "^29.0.0"
- jest-resolve "^29.0.2"
- jest-snapshot "^29.0.2"
- jest-util "^29.0.2"
+ jest-resolve "^29.0.3"
+ jest-snapshot "^29.0.3"
+ jest-util "^29.0.3"
slash "^3.0.0"
strip-bom "^4.0.0"
-jest-snapshot@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.2.tgz#5017d54db8369f01900d11e179513fa5839fb5ac"
- integrity sha512-26C4PzGKaX5gkoKg8UzYGVy2HPVcTaROSkf0gwnHu3lGeTB7bAIJBovvVPZoiJ20IximJELQs/r8WSDRCuGX2A==
+jest-snapshot@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.0.3.tgz#0a024706986a915a6eefae74d7343069d2fc8eef"
+ integrity sha512-52q6JChm04U3deq+mkQ7R/7uy7YyfVIrebMi6ZkBoDJ85yEjm/sJwdr1P0LOIEHmpyLlXrxy3QP0Zf5J2kj0ew==
dependencies:
"@babel/core" "^7.11.6"
"@babel/generator" "^7.7.2"
@@ -8515,81 +8515,81 @@ jest-snapshot@^29.0.2:
"@babel/plugin-syntax-typescript" "^7.7.2"
"@babel/traverse" "^7.7.2"
"@babel/types" "^7.3.3"
- "@jest/expect-utils" "^29.0.2"
- "@jest/transform" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/expect-utils" "^29.0.3"
+ "@jest/transform" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@types/babel__traverse" "^7.0.6"
"@types/prettier" "^2.1.5"
babel-preset-current-node-syntax "^1.0.0"
chalk "^4.0.0"
- expect "^29.0.2"
+ expect "^29.0.3"
graceful-fs "^4.2.9"
- jest-diff "^29.0.2"
+ jest-diff "^29.0.3"
jest-get-type "^29.0.0"
- jest-haste-map "^29.0.2"
- jest-matcher-utils "^29.0.2"
- jest-message-util "^29.0.2"
- jest-util "^29.0.2"
+ jest-haste-map "^29.0.3"
+ jest-matcher-utils "^29.0.3"
+ jest-message-util "^29.0.3"
+ jest-util "^29.0.3"
natural-compare "^1.4.0"
- pretty-format "^29.0.2"
+ pretty-format "^29.0.3"
semver "^7.3.5"
-jest-util@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.2.tgz#c75c5cab7f3b410782f9570a60c5558b5dfb6e3a"
- integrity sha512-ozk8ruEEEACxqpz0hN9UOgtPZS0aN+NffwQduR5dVlhN+eN47vxurtvgZkYZYMpYrsmlAEx1XabkB3BnN0GfKQ==
+jest-util@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.3.tgz#06d1d77f9a1bea380f121897d78695902959fbc0"
+ integrity sha512-Q0xaG3YRG8QiTC4R6fHjHQPaPpz9pJBEi0AeOE4mQh/FuWOijFjGXMMOfQEaU9i3z76cNR7FobZZUQnL6IyfdQ==
dependencies:
- "@jest/types" "^29.0.2"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
chalk "^4.0.0"
ci-info "^3.2.0"
graceful-fs "^4.2.9"
picomatch "^2.2.3"
-jest-validate@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.2.tgz#ad86e157cc1735a3a3ea88995a611ebf8544bd67"
- integrity sha512-AeRKm7cEucSy7tr54r3LhiGIXYvOILUwBM1S7jQkKs6YelwAlWKsmZGVrQR7uwsd31rBTnR5NQkODi1Z+6TKIQ==
+jest-validate@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.0.3.tgz#f9521581d7344685428afa0a4d110e9c519aeeb6"
+ integrity sha512-OebiqqT6lK8cbMPtrSoS3aZP4juID762lZvpf1u+smZnwTEBCBInan0GAIIhv36MxGaJvmq5uJm7dl5gVt+Zrw==
dependencies:
- "@jest/types" "^29.0.2"
+ "@jest/types" "^29.0.3"
camelcase "^6.2.0"
chalk "^4.0.0"
jest-get-type "^29.0.0"
leven "^3.1.0"
- pretty-format "^29.0.2"
+ pretty-format "^29.0.3"
-jest-watcher@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.2.tgz#093c044e0d7462e691ec64ca6d977014272c9bca"
- integrity sha512-ds2bV0oyUdYoyrUTv4Ga5uptz4cEvmmP/JzqDyzZZanvrIn8ipxg5l3SDOAIiyuAx1VdHd2FBzeXPFO5KPH8vQ==
+jest-watcher@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.0.3.tgz#8e220d1cc4f8029875e82015d084cab20f33d57f"
+ integrity sha512-tQX9lU91A+9tyUQKUMp0Ns8xAcdhC9fo73eqA3LFxP2bSgiF49TNcc+vf3qgGYYK9qRjFpXW9+4RgF/mbxyOOw==
dependencies:
- "@jest/test-result" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/test-result" "^29.0.3"
+ "@jest/types" "^29.0.3"
"@types/node" "*"
ansi-escapes "^4.2.1"
chalk "^4.0.0"
emittery "^0.10.2"
- jest-util "^29.0.2"
+ jest-util "^29.0.3"
string-length "^4.0.1"
-jest-worker@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.2.tgz#46c9f2cb9a19663d22babbacf998e4b5d7c46574"
- integrity sha512-EyvBlYcvd2pg28yg5A3OODQnqK9LI1kitnGUZUG5/NYIeaRgewtYBKB5wlr7oXj8zPCkzev7EmnTCsrXK7V+Xw==
+jest-worker@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.3.tgz#c2ba0aa7e41eec9eb0be8e8a322ae6518df72647"
+ integrity sha512-Tl/YWUugQOjoTYwjKdfJWkSOfhufJHO5LhXTSZC3TRoQKO+fuXnZAdoXXBlpLXKGODBL3OvdUasfDD4PcMe6ng==
dependencies:
"@types/node" "*"
merge-stream "^2.0.0"
supports-color "^8.0.0"
[email protected]:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.2.tgz#16e20003dbf8fb9ed7e6ab801579a77084e13fba"
- integrity sha512-enziNbNUmXTcTaTP/Uq5rV91r0Yqy2UKzLUIabxMpGm9YHz8qpbJhiRnNVNvm6vzWfzt/0o97NEHH8/3udoClA==
[email protected]:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.3.tgz#5227a0596d30791b2649eea347e4aa97f734944d"
+ integrity sha512-ElgUtJBLgXM1E8L6K1RW1T96R897YY/3lRYqq9uVcPWtP2AAl/nQ16IYDh/FzQOOQ12VEuLdcPU83mbhG2C3PQ==
dependencies:
- "@jest/core" "^29.0.2"
- "@jest/types" "^29.0.2"
+ "@jest/core" "^29.0.3"
+ "@jest/types" "^29.0.3"
import-local "^3.0.2"
- jest-cli "^29.0.2"
+ jest-cli "^29.0.3"
jquery@^3.4.1:
version "3.6.0"
@@ -11381,10 +11381,10 @@ pretty-error@^2.0.2:
lodash "^4.17.20"
renderkid "^2.0.4"
-pretty-format@^29.0.2:
- version "29.0.2"
- resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.2.tgz#7f7666a7bf05ba2bcacde61be81c6db64f6f3be6"
- integrity sha512-wp3CdtUa3cSJVFn3Miu5a1+pxc1iPIQTenOAn+x5erXeN1+ryTcLesV5pbK/rlW5EKwp27x38MoYfNGaNXDDhg==
+pretty-format@^29.0.3:
+ version "29.0.3"
+ resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.3.tgz#23d5f8cabc9cbf209a77d49409d093d61166a811"
+ integrity sha512-cHudsvQr1K5vNVLbvYF/nv3Qy/F/BcEKxGuIeMiVMRHxPOO1RxXooP8g/ZrwAp7Dx+KdMZoOc7NxLHhMrP2f9Q==
dependencies:
"@jest/schemas" "^29.0.0"
ansi-styles "^5.0.0"
|
c399e6446ec7bd13db1f4a04c9dbaa5ab12ae203
|
2023-10-31 19:17:58
|
Ethan Shen
|
feat(route): add 国家市场监督管理总局留言咨询 (#13658)
| false
|
add 国家市场监督管理总局留言咨询 (#13658)
|
feat
|
diff --git a/lib/v2/gov/maintainer.js b/lib/v2/gov/maintainer.js
index e97ca6ac0f267c..b743963c3f5699 100644
--- a/lib/v2/gov/maintainer.js
+++ b/lib/v2/gov/maintainer.js
@@ -45,6 +45,7 @@ module.exports = {
'/pbc/gzlw': ['Fatpandac'],
'/pbc/tradeAnnouncement': ['nczitzk'],
'/pbc/zcyj': ['Fatpandac'],
+ '/samr/xgzlyhd/:category?/:department?': ['nczitzk'],
'/sasac/:path+': ['TonyRL'],
'/stats/:path+': ['bigfei', 'nczitzk'],
'/zhengce/govall/:advance?': ['ciaranchen'],
diff --git a/lib/v2/gov/radar.js b/lib/v2/gov/radar.js
index 4d6b6876dd0136..38e3447bdaddda 100644
--- a/lib/v2/gov/radar.js
+++ b/lib/v2/gov/radar.js
@@ -992,6 +992,17 @@ module.exports = {
},
],
},
+ 'samr.gov.cn': {
+ _name: '国家市场监督管理总局',
+ xgzlyhd: [
+ {
+ title: '留言咨询',
+ docs: 'https://docs.rsshub.app/routes/government#guo-jia-shi-chang-jian-du-guan-li-zong-ju',
+ source: ['/gjjly/index'],
+ target: '/gov/samr/xgzlyhd/:category?/:department?',
+ },
+ ],
+ },
'sasac.gov.cn': {
_name: '国务院国有资产监督管理委员会',
'.': [
diff --git a/lib/v2/gov/router.js b/lib/v2/gov/router.js
index 4100a8c1770d29..ebd1258ecccf17 100644
--- a/lib/v2/gov/router.js
+++ b/lib/v2/gov/router.js
@@ -37,6 +37,7 @@ module.exports = function (router) {
router.get('/pbc/gzlw', require('./pbc/gzlw'));
router.get('/pbc/tradeAnnouncement', require('./pbc/tradeAnnouncement'));
router.get('/pbc/zcyj', require('./pbc/zcyj'));
+ router.get('/samr/xgzlyhd/:category?/:department?', require('./samr/xgzlyhd'));
router.get('/sasac/:path+', require('./sasac/generic'));
router.get(/stats(\/[\w/-]+)?/, require('./stats'));
router.get('/zhengce/govall/:advance?', require('./zhengce/govall'));
diff --git a/lib/v2/gov/samr/templates/description.art b/lib/v2/gov/samr/templates/description.art
new file mode 100644
index 00000000000000..7ffaaaefea907d
--- /dev/null
+++ b/lib/v2/gov/samr/templates/description.art
@@ -0,0 +1,26 @@
+{{ if item }}
+ <div>
+ <span>
+ <img height="50px" src="https://xgzlyhd.samr.gov.cn/gjjly/img/fd-q-avator.png">
+ <b>{{ item.lyr }}</b>
+ </span>
+ <div>
+ <h3>{{ item.lybt }}</h3>
+ <p>留言日期:{{ item.lysj }}</p>
+ <div style="word-break: break-all;">
+ {{ item.lynr }}
+ </div>
+ <br>
+ </div>
+ <span>
+ <img height="50px" src="https://xgzlyhd.samr.gov.cn/gjjly/img/fd-a-avator.png">
+ <b>{{ item.fzsjCn }}</b>
+ </span>
+ <div>
+ <p>时间:{{ item.pubtime }}</p>
+ <div style="word-break: break-all;">
+ {{ item.clyj }}
+ </div>
+ </div>
+ </div>
+{{ /if }}
\ No newline at end of file
diff --git a/lib/v2/gov/samr/xgzlyhd.js b/lib/v2/gov/samr/xgzlyhd.js
new file mode 100644
index 00000000000000..bc47efc4b8f2a2
--- /dev/null
+++ b/lib/v2/gov/samr/xgzlyhd.js
@@ -0,0 +1,100 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+const rootUrl = 'https://xgzlyhd.samr.gov.cn';
+const apiUrl = new URL('gjjly/message/getMessageList', rootUrl).href;
+const apiDataUrl = new URL('gjjly/message/getDataList', rootUrl).href;
+const currentUrl = new URL('gjjly/index', rootUrl).href;
+
+const types = {
+ category: '1',
+ department: '2',
+};
+
+const fetchOptions = async (type) => {
+ const { data: response } = await got.post(apiDataUrl, {
+ json: {
+ type: types[type],
+ },
+ });
+
+ return response.data;
+};
+
+const getOption = async (type, name) => {
+ const options = await fetchOptions(type);
+ const results = options.filter((o) => o.name === name || o.code === name);
+
+ if (results.length > 0) {
+ return results.pop();
+ }
+ return undefined;
+};
+
+module.exports = async (ctx) => {
+ const { category = undefined, department = undefined } = ctx.params;
+ const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 10;
+
+ let categoryOption;
+ let departmentOption;
+
+ if (category) {
+ categoryOption = await getOption('category', category);
+ }
+
+ if (department) {
+ departmentOption = await getOption('department', department);
+ }
+
+ const { data: response } = await got.post(apiUrl, {
+ json: {
+ clyj: '',
+ curPage: '1',
+ endTime: '',
+ fzsj: departmentOption?.code ?? '',
+ lybt: undefined,
+ lylx: categoryOption?.code ?? '',
+ lynr: '',
+ startTime: '',
+ zj: '',
+ },
+ });
+
+ const items = response.data.data.slice(0, limit).map((item) => ({
+ title: item.lybt,
+ link: `${currentUrl}#${item.zj}`,
+ description: art(path.join(__dirname, 'templates/description.art'), {
+ item,
+ }),
+ author: `${item.lyr} ⇄ ${item.fzsjCn}`,
+ category: [item.fzsjCn],
+ guid: `${currentUrl}#${item.zj}`,
+ pubDate: parseDate(item.pubtime),
+ }));
+
+ const { data: currentResponse } = await got(currentUrl);
+
+ const $ = cheerio.load(currentResponse);
+
+ const author = '国家市场监督管理总局';
+ const title = $('title').text();
+ const subtitle = [categoryOption ? categoryOption.name : undefined, departmentOption ? departmentOption.name : undefined].filter((c) => c).join(' - ');
+ const icon = new URL($('link[rel="icon"]').prop('href'), rootUrl).href;
+
+ ctx.state.data = {
+ item: items,
+ title: `${author}${title}${subtitle ? ` - ${subtitle}` : ''}`,
+ link: currentUrl,
+ description: $('meta[property="og:description"]').prop('content'),
+ language: 'zh',
+ image: new URL(`gjjly/${$('div.fd-logo img').prop('src')}`, rootUrl).href,
+ icon,
+ logo: icon,
+ subtitle,
+ author,
+ allowEmpty: true,
+ };
+};
diff --git a/website/docs/routes/government.md b/website/docs/routes/government.md
index be984bc5e88442..e8a7ebbe6c3958 100644
--- a/website/docs/routes/government.md
+++ b/website/docs/routes/government.md
@@ -475,6 +475,108 @@ Language
</Route>
+## 国家市场监督管理总局 {#guo-jia-shi-chang-jian-du-guan-li-zong-ju}
+
+### 留言咨询 {#guo-jia-shi-chang-jian-du-guan-li-zong-ju-liu-yan-zi-xun}
+
+<Route author="nczitzk" example="/gov/samr/xgzlyhd" path="/gov/samr/xgzlyhd/:category?/:department?" paramsDesc={['留言类型,见下表,默认为全部', '回复部门,见下表,默认为全部']} radar="1" rssbud="1">
+
+#### 留言类型 {#guo-jia-shi-chang-jian-du-guan-li-zong-ju-liu-yan-zi-xun-liu-yan-lei-xing}
+
+| 类型 | 类型 id |
+| ------------------------------------------ | -------------------------------- |
+| 反腐倡廉 | 14101a4192df48b592b5cfd77a26c0cf |
+| 规划统计 | b807cf9cdf434635ae908d48757e0f39 |
+| 行政执法和复议 | 8af2530e77154d7b939428667b7413f6 |
+| 假冒仿冒行为 | 75374a34b95341829e08e54d4a0d8c04 |
+| 走私贩私 | 84c728530e1e478e94fe3f0030171c53 |
+| 登记注册 | 07fff64612dc41aca871c06587abf71d |
+| 个体工商户登记 | ca8f91ba9a2347a0acd57ea5fd12a5c8 |
+| 信用信息公示系统 | 1698886c3cdb495998d5ea9285a487f5 |
+| 市场主体垄断 | 77bfe965843844449c47d29f2feb7999 |
+| 反不正当竞争 | 2c919b1dc39440d8850c4f6c405869f8 |
+| 商业贿赂 | b494e6535af149c5a51fd4197993f061 |
+| 打击传销与规范直销 | 407a1404844e48558da46139f16d6232 |
+| 消费环境建设 | 94c2003331dd4c5fa19b0cf88d720676 |
+| 网络交易监管 | 6302aac5b87140598da53f85c1ccb8fa |
+| 动产抵押登记 | 3856de5835444229943b18cac7781e9f |
+| 广告监管 | d0e38171042048c2bf31b05c5e57aa68 |
+| 三包 | c4dbd85692604a428b1ea7613e67beb8 |
+| 缺陷产品召回 | f93c9a6b81e941d09a547406370e1c0c |
+| 工业生产许可 | 2b41afaabaa24325b53a5bd7deba895b |
+| 产品质量监督抽查 | 4388504cb0c04e988e2cf0c90d4a3f14 |
+| 食品安全协调 | 3127b9f409c24d0eaa60b13c25f819fa |
+| 食品生产监管 | beaa5555d1364e5bb2a0f0a7cc9720e5 |
+| 食品销售、餐饮服务、食用农产品销售监管 | 3b6c49c6ce934e1b9505601a3b881a6a |
+| 保健、特殊医学用途配方和婴幼儿配方乳粉监管 | 13b43888f8554e078b1dfa475e2aaab0 |
+| 食品监督抽检、召回 | 0eb6c75581bf41ecaedc629370cb425c |
+| 食品安全标准 | 399cfd9abfa34c22a5cb3bb971a43819 |
+| 特种设备人员、机构管理 | e5d0e51cc7d0412790efac605008bf20 |
+| 特种设备检验 | 03f22fb3d4cd4f09b632079359e9dd7d |
+| 计量器具 | 90b25e22861446d5822e07c7c1f5169a |
+| 计量机构和人员管理 | 76202742f06c459da7482160e0ce17ad |
+| 国家标准 | 299b9672e1c246e69485a5b695f42c5b |
+| 行业、地方、团体、企业标准 | cbdc804c9b2c4e259a159c32eccf4ca9 |
+| 认证监督管理 | 41259262a42e4de49b5c0b7362ac3796 |
+| 认可与检验检测 | cb3c9d1e3d364f2a8b1cd70efa69d1cb |
+| 新闻宣传 | e3e553e4019c46ccbdc06136900138e9 |
+| 科技财务 | 47367b9704964355ba52899a4c5abbb0 |
+| 干部人事 | 6b978e3c127c489ea8e2d693b768887e |
+| 国际合作 | dd5ce768e33e435ab4bfb769ab6e079a |
+| 党群工作 | aa71052978af4304937eb382f24f9902 |
+| 退休干部 | 44505fc58c81428eb5cef15706007b5e |
+| 虚假宣传 | 5bb2b83ecadb4bf89a779cee414a81dd |
+| 滥用行政权力 | 1215206156dc48029b98da825f26fcbc |
+| 公平竞争 | 9880a23dcbb04deba2cc7b4404e13ff6 |
+| 滥用市场支配地位 | fea04f0acd84486e84cf71d9c13005b0 |
+| 数字经济领域反垄断执法 | 4bea424a6e4c4e2aac19fe3c73f9be23 |
+| 并购行为 | 90e315647acd415ca68f97fc1b42053d |
+| 经营者集中案件 | d6571d2cd5624bc18191b342a2e8defb |
+| 数字经济领域反垄断审查 | 03501ef176ef44fba1c7c70da44ba8a0 |
+| 综合执法 | cfbb1b5dade446299670ca38844b265e |
+| 信用监管 | a9d76ea04a3a4433946bc02b0bdb77eb |
+| 3C认证 | 111decc7b14a4fdbae86fb4a3ba5c0c1 |
+| 食用农产品 | 3159db51f8ca4f23a9340d87d5572d40 |
+| 食品添加 | 4e4b0e0152334cbb9c62fd1b80138305 |
+
+#### 回复部门 {#guo-jia-shi-chang-jian-du-guan-li-zong-ju-liu-yan-zi-xun-hui-fu-bu-men}
+
+| 部门 | 部门 id |
+| ---------------------------- | -------------------------------- |
+| 办公厅 | 6ed539b270634667afc4d466b67a53f7 |
+| 法规司 | 8625ec7ff8d744ad80a1d1a2bf19cf19 |
+| 执法稽查局 | 313a8cb1c09042dea52be52cb392c557 |
+| 登记注册局 | e4553350549f45f38da5602147cf8639 |
+| 信用监督管理司 | 6af98157255a4a858eac5f94ba8d98f4 |
+| 竞争政策协调司 | 8d2266be4791483297822e1aa5fc0a96 |
+| 综合规划司 | 958e1619159c45a7b76663a59d9052ea |
+| 反垄断执法一司 | f9fb3f6225964c71ab82224a91f21b2c |
+| 反垄断执法二司 | 7986c79e4f16403493d5b480aec30be4 |
+| 价格监督检查和反不正当竞争局 | c5d2b1b273b545cfbc6f874f670654ab |
+| 网络交易监督管理司 | 6ac05b4dbd4e41c69f4529262540459b |
+| 广告监督管理司 | 96457dfe16c54840885b79b4e6e17523 |
+| 质量发展局 | cb8d2b16fbb540dca296aa33a43fc573 |
+| 质量监督司 | af2c4e0a54c04f76b512c29ddd075d40 |
+| 食品安全协调司 | cc29962c74e84ef2b21e44336da6c6c5 |
+| 食品生产安全监督管理司 | b334db85a253458285db70b30ee26b0a |
+| 食品经营安全监督管理司 | 4315f0261a5d49f7bdcc5a7524e19ce3 |
+| 特殊食品安全监督管理司 | 62d14f386317486ca94bc53ca7f88891 |
+| 食品安全抽检监测司 | abfc910832cc460a81876ad418618159 |
+| 特种设备安全监察局 | ea79f90bec5840ef9b0881c83682225a |
+| 计量司 | b0556236fbcf4f45b6fdec8004dac3e4 |
+| 标准技术管理司 | a558d07a51f4454fa59290e0d6e93c26 |
+| 标准创新管理司 | ffb3a80984b344ed8d168f4af6508af0 |
+| 认证监督管理司 | ca4987393d514debb4d1e2126f576987 |
+| 认可与检验检测监督管理司 | 796bfab21b15498e88c9032fe3e3c9f1 |
+| 新闻宣传司 | 884fc0ea6c184ad58dda10e2170a1eda |
+| 科技和财务司 | 117355eea94c426199e2e519fd98ce07 |
+| 人事司 | a341e8b7929e44769b9424b7cf69d32a |
+| 国际司 | f784499ef24541f5b20de4c24cfc61e7 |
+| 机关党委 | a49119c6f40045dd994f3910500cedfa |
+| 离退办 | 6bf265ffd1c94fa4a3f1687b03fa908b |
+
+</Route>
+
## 国家林业和草原局 {#guo-jia-lin-ye-he-cao-yuan-ju}
### 国家林草科技大讲堂 {#guo-jia-lin-ye-he-cao-yuan-ju-guo-jia-lin-cao-ke-ji-da-jiang-tang}
|
03a00cde69dad1c88040bdbc1307624bb11bc228
|
2024-10-04 20:33:32
|
valuex
|
feat(route): add Resonac (#16960)
| false
|
add Resonac (#16960)
|
feat
|
diff --git a/lib/routes/resonac/namespace.ts b/lib/routes/resonac/namespace.ts
new file mode 100644
index 00000000000000..8be80f945f49d9
--- /dev/null
+++ b/lib/routes/resonac/namespace.ts
@@ -0,0 +1,6 @@
+import type { Namespace } from '@/types';
+
+export const namespace: Namespace = {
+ name: 'Resonac',
+ url: 'www.resonac.com',
+};
diff --git a/lib/routes/resonac/products.ts b/lib/routes/resonac/products.ts
new file mode 100644
index 00000000000000..918c8b79ea493d
--- /dev/null
+++ b/lib/routes/resonac/products.ts
@@ -0,0 +1,85 @@
+import { Route } from '@/types';
+import cache from '@/utils/cache';
+import got from '@/utils/got';
+import { load } from 'cheerio';
+// import { parseDate } from '@/utils/parse-date';
+// import timezone from '@/utils/timezone';
+
+const baseUrl = 'https://www.resonac.com';
+const host = 'https://www.resonac.com/products?intcid=glnavi_products';
+
+export const route: Route = {
+ path: '/products',
+ categories: ['other'],
+ example: '/resonac/products',
+ parameters: {},
+ features: {
+ requireConfig: false,
+ requirePuppeteer: true,
+ antiCrawler: false,
+ supportBT: false,
+ supportPodcast: false,
+ supportScihub: false,
+ },
+ name: 'Products',
+ maintainers: ['valuex'],
+ handler,
+ description: '',
+};
+
+async function handler() {
+ const response = await got(host);
+ const pageHtml = response.data;
+ const $ = load(pageHtml);
+ const groupLists = $('div.m-panel-card-link ul li')
+ .toArray()
+ .map((el) => ({
+ groupName: $('a', el).text().trim(),
+ groupURL: baseUrl + $('a', el).attr('href'),
+ }));
+
+ const lists = await Promise.all(
+ groupLists.map((productGroup) =>
+ cache.tryGet(productGroup.groupURL, async () => {
+ const strUrl = productGroup.groupURL;
+ const response = await got(strUrl);
+ const $ = load(response.data);
+ const item = $('dt.m-toggle__title div span a')
+ .toArray()
+ .map((el) => ({
+ title: $('b', el).text().trim(),
+ link: baseUrl + $(el).attr('href'),
+ group: productGroup.groupName,
+ }));
+ return item;
+ })
+ )
+ );
+
+ const fullList = lists.flat(1); // flatten array
+ // fullList = fullList.filter((item) => item.title !== 'Empty');
+
+ const items = await Promise.all(
+ fullList.map((item) =>
+ cache.tryGet(item.link, async () => {
+ try {
+ const response = await got(item.link);
+ const $ = load(response.data);
+ const thisTitle = item.title + ' | ' + item.group;
+ item.title = thisTitle;
+ item.description = $('main div.str-section').html();
+ return item;
+ } catch (error) {
+ return (error as Error).message;
+ }
+ })
+ )
+ );
+
+ return {
+ title: 'Resonac_Products',
+ link: baseUrl,
+ description: 'Resonac_Products',
+ item: items,
+ };
+}
|
1f640b07d227563e491ca7ef3b8d6ec6a0b2cce9
|
2023-07-24 20:14:56
|
Felix Hsu
|
fix(route): bloomberg api 404 error (#12834)
| false
|
bloomberg api 404 error (#12834)
|
fix
|
diff --git a/lib/v2/bloomberg/react-renderer.js b/lib/v2/bloomberg/react-renderer.js
new file mode 100644
index 00000000000000..3a174dcc0ca16b
--- /dev/null
+++ b/lib/v2/bloomberg/react-renderer.js
@@ -0,0 +1,181 @@
+const art = require('art-template');
+const path = require('path');
+const { processVideo } = require('./utils');
+
+const nodeRenderers = {
+ paragraph: (node, nextNode) => `<p>${nextNode(node.content)}</p>`,
+ text: (node) => {
+ const { attributes: attr, value: val } = node;
+ if (attr?.emphasis && attr?.strong) {
+ return `<strong><em>${val}</em></strong>`;
+ } else if (attr?.emphasis) {
+ return `<em>${val}</em>`;
+ } else if (attr?.strong) {
+ return `<strong>${val}</strong>`;
+ } else {
+ return val;
+ }
+ },
+ 'inline-newsletter': (node, nextNode) => `<div>${nextNode(node.content)}</div>`,
+ heading: (node, nextNode) => {
+ const nodeData = node.data;
+ if (nodeData.level === 2 || nodeData.level === 3) {
+ return `<h3>${nextNode(node.content)}</h3>`;
+ }
+ },
+ link: (node, nextNode) => {
+ const dest = node.data.destination;
+ const web = dest.web;
+ const bbg = dest.bbg;
+ const title = node.data.title;
+ if (web) {
+ return `<a href="${web}" title="${title}" target="_blank">${nextNode(node.content)}</a>`;
+ }
+
+ if (bbg && bbg.startsWith('bbg://news/stories')) {
+ const o = bbg.split('bbg://news/stories/').pop();
+ const s = 'https://www.bloomberg.com/news/terminal/'.concat(o);
+ return `<a href="${s}" title="${title}" target="_blank">${nextNode(node.content)}</a>`;
+ }
+ return String(nextNode(node.content));
+ },
+ entity: (node, nextNode) => {
+ const t = node.subType;
+ const linkDest = node.data.link.destination;
+ const web = linkDest.web;
+ if (t === 'person') {
+ return String(nextNode(node.content));
+ }
+ if (t === 'story') {
+ if (web) {
+ return `<a href="${web}" target="_blank">${nextNode(node.content)}</a>`;
+ }
+ const a = node.data.story.identifiers.suid;
+ const o = 'https://www.bloomberg.com/news/terminal/'.concat(a);
+ return `<a href="${o}" target="_blank">${nextNode(node.content)}</a>`;
+ }
+ if (t === 'security') {
+ const s = node.data.security.identifiers.parsekey;
+ if (s) {
+ const c = s.split(' ');
+ const href = 'https://www.bloomberg.com/quote/'.concat(c[0], ':').concat(c[1]);
+ return `<a href="${href}" target="_blank">${nextNode(node.content)}</a>`;
+ }
+ }
+ return String(nextNode(node.content));
+ },
+ br: () => `<br/>`,
+ hr: () => `<br/>`,
+ ad: () => {},
+ blockquote: (node, nextNode) => `<blockquote>${nextNode(node.content)}</blockquote>`,
+ quote: (node, nextNode) => `<blockquote>${nextNode(node.content)}</blockquote>`,
+ aside: (node, nextNode) => `<aside>${nextNode(node.content)}</aside>`,
+ list: (node, nextNode) => {
+ const t = node.subType;
+ if (t === 'unordered') {
+ return `<ul>${nextNode(node.content)}</ul>`;
+ }
+ if (t === 'ordered') {
+ return `<ol>${nextNode(node.content)}</ol>`;
+ }
+ },
+ listItem: (node, nextNode) => `<li>${nextNode(node.content)}</li>`,
+ media: (node) => {
+ const t = node.subType;
+ if (t === 'chart' && node.data.attachment) {
+ if (node.data.attachment.creator === 'TOASTER') {
+ const c = node.data.chart;
+ const e = {
+ src: (c && c.fallback) || '',
+ chart: node.data.attachment,
+ id: (c && c.id) || '',
+ alt: (c && c.alt) || '',
+ };
+ const w = e.chart;
+
+ const chart = {
+ source: w.source,
+ footnote: w.footnote,
+ url: w.url,
+ title: w.title,
+ subtitle: w.subtitle,
+ chartId: 'toaster-chart-'.concat(e.id),
+ chartAlt: e.alt,
+ fallback: e.src,
+ };
+ return art(path.join(__dirname, 'templates/chart_media.art'), { chart });
+ }
+ const image = {
+ alt: node.data.attachment?.footnote || '',
+ caption: node.data.attachment?.title + node.data.attachment.subtitle || '',
+ credit: node.data.attachment?.source || '',
+ src: node.data.chart?.fallback || '',
+ };
+ return art(path.join(__dirname, 'templates/image_figure.art'), image);
+ }
+ if (t === 'photo') {
+ const h = node.data;
+ let img = '';
+ if (h.attachment) {
+ const image = { src: h.photo?.src, alt: h.photo?.alt, caption: h.photo?.caption, credit: h.photo?.credit };
+ img = art(path.join(__dirname, 'templates/image_figure.art'), image);
+ }
+ if (h.link && h.link.destination && h.link.destination.web) {
+ const href = h.link.destination.web;
+ return `<a href="${href}" target="_blank">${img}</a>`;
+ }
+ return img;
+ }
+ if (t === 'video') {
+ const h = node.data;
+ const id = h.attachment && h.attachment.id;
+ return processVideo(id);
+ }
+ if (t === 'audio' && node.data.attachment) {
+ const B = node.data.attachment;
+ const P = B.title;
+ const D = B.url;
+ const M = B.image;
+ if (P && D) {
+ const audio = {
+ src: D,
+ img: M,
+ caption: P,
+ credit: '',
+ };
+ return art(path.join(__dirname, 'templates/audio_media.art'), audio);
+ }
+ }
+ return '';
+ },
+};
+
+const nodeToHtmlString = (node, obj) => {
+ const nextNode = (nodes) => nodeListToHtmlString(nodes);
+ if (!node.type || !nodeRenderers[node.type]) {
+ return `<node>${node.type}</node>`;
+ }
+ return nodeRenderers[node.type](node, nextNode, obj);
+};
+
+const nodeListToHtmlString = (nodes) =>
+ nodes
+ .map((node, index) =>
+ nodeToHtmlString(node, {
+ index,
+ prev: nodes[index - 1]?.type,
+ next: nodes[index + 1]?.type,
+ })
+ )
+ .join('');
+
+const documentToHtmlString = (document) => {
+ if (!document || !document.content) {
+ return '';
+ }
+ return nodeListToHtmlString(document.content);
+};
+
+module.exports = {
+ documentToHtmlString,
+};
diff --git a/lib/v2/bloomberg/templates/chart_media.art b/lib/v2/bloomberg/templates/chart_media.art
new file mode 100644
index 00000000000000..255fbb7d60e645
--- /dev/null
+++ b/lib/v2/bloomberg/templates/chart_media.art
@@ -0,0 +1,21 @@
+<figure>
+ {{if chart.title}}
+ {{chart.title}}
+ {{/if}}
+ {{if chart.subtitle}}
+ <p>{{chart.subtitle}}</p>
+ {{/if}}
+ <noscript>
+ <img src="{{ chart.fallback }}" alt="{{ chart.chartAlt }}" loading="lazy" style="display:block; margin-left:auto; margin-right:auto;" width:100%; />
+ </noscript>
+ <iframe id="{{chart.chartId}}" title="{{chart.title}}" referrerpolicy="no-referrer" width=100% height=150vh frameborder=0 marginheight=0 marginwidth=0
+ loading="lazy" scrolling="no" style="border:0; margin:0; padding:0; width:100%; height:150vh;" src="{{ chart.url }}" ></iframe>
+ {{if chart.source}}
+ <figcaption>
+ <div class="source">{{@ chart.source }}</div>
+ {{if chart.footnote}}
+ <p>{{chart.footnote}}</p>
+ {{/if}}
+ </figcaption>
+ {{/if}}
+</figure>
diff --git a/lib/v2/bloomberg/utils.js b/lib/v2/bloomberg/utils.js
index 48f592c8e05723..de8a76c24ab1dc 100644
--- a/lib/v2/bloomberg/utils.js
+++ b/lib/v2/bloomberg/utils.js
@@ -6,6 +6,8 @@ const { parseDate } = require('@/utils/parse-date');
const got = require('@/utils/got');
const { art } = require('@/utils/render');
+const { documentToHtmlString } = require('./react-renderer');
+
const rootUrl = 'https://www.bloomberg.com/feeds';
const sel = 'script[data-component-props="ArticleBody"], script[data-component-props="FeatureBody"]';
const apiEndpoints = {
@@ -27,7 +29,7 @@ const apiEndpoints = {
},
newsletters: {
url: 'https://www.bloomberg.com/news/newsletters/',
- sel,
+ sel: 'script#__NEXT_DATA__',
},
'photo-essays': {
url: 'https://www.bloomberg.com/javelin/api/photo-essay_transporter/',
@@ -104,9 +106,9 @@ const parseArticle = (item, ctx) =>
}
}
- // Blocked by PX3, return the default
+ // Blocked by PX3, or 404 by api, return the default
const redirectUrls = res.redirectUrls.map(String);
- if (redirectUrls.some((r) => new URL(r).pathname === '/tosv2.html')) {
+ if (redirectUrls.some((r) => new URL(r).pathname === '/tosv2.html') || res.statusCode === 404) {
return {
title: item.title,
link: item.link,
@@ -123,6 +125,8 @@ const parseArticle = (item, ctx) =>
return parsePhotoEssaysPage(res, api, item);
case 'features/': // single features page
return parseFeaturePage(res, api, item);
+ case 'newsletters':
+ return parseNewsletterPage(res, api, item);
default:
return parseOtherPage(res, api, item);
}
@@ -131,6 +135,27 @@ const parseArticle = (item, ctx) =>
return item;
});
+const parseNewsletterPage = async (res, api, item) => {
+ const newsletter_json = JSON.parse(cheerio.load(res.data)(api.sel).html()).props.pageProps;
+ const story_json = newsletter_json.story;
+ const media_img = story_json.ledeImageUrl || Object.values(story_json.imageAttachments ?? {})[0]?.baseUrl;
+
+ const rss_item = {
+ title: story_json.headline || item.title,
+ link: story_json.url || item.link,
+ guid: `bloomberg:${story_json.id}`,
+ description: processHeadline(story_json) + (await processLedeMedia(story_json)) + documentToHtmlString(story_json.body || ''),
+ pubDate: parseDate(story_json.publishedAt) || item.pubDate,
+ author: story_json.authors?.map((a) => a.name).join(', ') ?? [],
+ category: story_json.mostRelevantTags ?? [],
+ media: {
+ content: { url: media_img },
+ thumbnails: { url: media_img },
+ },
+ };
+ return rss_item;
+};
+
const parseAudioPage = async (res, api, item) => {
const audio_json = JSON.parse(cheerio.load(res.data)(api.sel).html()).props.pageProps;
const episode = audio_json.episode;
@@ -258,7 +283,7 @@ const parseOtherPage = async function (res, api, item) {
};
const processHeadline = (story_json) => {
- const dek = story_json.dek || '';
+ const dek = story_json.dek || story_json.summary || '';
const abs = story_json.abstract?.map((a) => `<li>${a}</li>`).join('');
return abs ? dek + `<ul>${abs}</ul>` : dek;
};
@@ -276,6 +301,13 @@ const processLedeMedia = async (story_json) => {
video: kind === 'video' && (await processVideo(story_json.ledeAttachment.bmmrId)),
};
return art(path.join(__dirname, 'templates/lede_media.art'), { media });
+ } else if (story_json.lede) {
+ const lede = story_json.lede;
+ const image = {
+ src: lede.url,
+ alt: lede.alt || lede.title,
+ };
+ return art(path.join(__dirname, 'templates/image_figure.art'), image);
} else if (story_json.imageAttachments) {
const attachment = Object.values(story_json.imageAttachments)[0];
if (attachment) {
@@ -404,4 +436,5 @@ module.exports = {
asyncPoolAll,
parseNewsList,
parseArticle,
+ processVideo,
};
|
8a5dbbcc1f215f6a90d545b558f181baf5d6e949
|
2020-04-13 17:04:12
|
EsuRt
|
fix: 中国政府网吹风会和新闻页面格式调整 (#4406)
| false
|
中国政府网吹风会和新闻页面格式调整 (#4406)
|
fix
|
diff --git a/lib/routes/gov/news/index.js b/lib/routes/gov/news/index.js
index 806fd06dbd8ba6..48e6756db21295 100644
--- a/lib/routes/gov/news/index.js
+++ b/lib/routes/gov/news/index.js
@@ -55,37 +55,53 @@ module.exports = async (ctx) => {
let fullTextGet = '';
if (item.html().search(/dysMiddleResultConItemTitle/g) !== -1) {
contentUrl = item.find('a').attr('href');
- description = await ctx.cache.tryGet(contentUrl, async () => {
- fullTextGet = await got.get(contentUrl);
- fullTextData = cheerio.load(fullTextGet.data);
- if (fullTextData.html().search(/pages_content/g) !== -1) {
- return fullTextData('.pages_content').html();
- } else {
- return fullTextData('#UCAP-CONTENT').html();
- }
- });
+ if (contentUrl.search(/content/g) === -1) {
+ description = item.find('a').text(); // 忽略获取吹风会的全文
+ } else {
+ description = await ctx.cache.tryGet(contentUrl, async () => {
+ fullTextGet = await got.get(contentUrl);
+ fullTextData = cheerio.load(fullTextGet.data);
+ if (fullTextData.html().search(/pages_content/g) !== -1) {
+ fullTextData('.shuzi').remove(); // 移除videobg的图片
+ fullTextData('#myFlash').remove(); // 移除flash
+ return fullTextData('.pages_content').html();
+ } else {
+ fullTextData('.shuzi').remove(); // 移除videobg的图片
+ fullTextData('#myFlash').remove(); // 移除flash
+ return fullTextData('#UCAP-CONTENT').html();
+ }
+ });
+ }
} else {
href = item.find('a').attr('href');
contentUrl = href.startsWith('/') ? `http://www.gov.cn${href}` : href;
- description = await ctx.cache.tryGet(contentUrl, async () => {
- fullTextGet = await got.get(contentUrl);
- fullTextData = cheerio.load(fullTextGet.data);
- const $1 = fullTextData.html();
- if (contentUrl.search(/zhengceku/g) !== -1) {
- fullText = fullTextData('.pages_content').html();
- } else {
- if ($1.search(/UCAP-CONTENT/g) === -1) {
- fullText = fullTextData('body').html();
+ if (contentUrl.search(/content/g) === -1) {
+ description = item.find('a').text(); // 忽略获取吹风会的全文
+ } else {
+ description = await ctx.cache.tryGet(contentUrl, async () => {
+ fullTextGet = await got.get(contentUrl);
+ fullTextData = cheerio.load(fullTextGet.data);
+ const $1 = fullTextData.html();
+ if (contentUrl.search(/zhengceku/g) !== -1) {
+ // 政策文件库
+ fullText = fullTextData('.pages_content').html();
} else {
- fullTextData('.shuzi').remove();
- fullText = fullTextData('#UCAP-CONTENT').html();
+ if ($1.search(/UCAP-CONTENT/g) === -1) {
+ fullTextData('.shuzi').remove(); // 移除videobg的图片
+ fullTextData('#myFlash').remove(); // 移除flash
+ fullText = fullTextData('body').html();
+ } else {
+ fullTextData('.shuzi').remove(); // 移除videobg的图片
+ fullTextData('#myFlash').remove(); // 移除flash
+ fullText = fullTextData('#UCAP-CONTENT').html();
+ }
}
- }
- const regImg = /(img src=")(.*)(".*)/g;
- const regUrl = /(http.*\/)(content.*)/;
- const urlSplit = contentUrl.replace(regUrl, '$1');
- return fullText.replace(regImg, '$1' + urlSplit + '$2' + '$3');
- });
+ const regImg = /(img src=")(.*)(".*)/g;
+ const regUrl = /(http.*\/)(content.*)/;
+ const urlSplit = contentUrl.replace(regUrl, '$1');
+ return fullText.replace(regImg, '$1' + urlSplit + '$2' + '$3'); // 处理图片链接
+ });
+ }
}
return {
title: item.find('a').text(),
diff --git a/lib/routes/gov/statecouncil/briefing.js b/lib/routes/gov/statecouncil/briefing.js
index 73744602ba4ffe..ecd5b79c894fe3 100644
--- a/lib/routes/gov/statecouncil/briefing.js
+++ b/lib/routes/gov/statecouncil/briefing.js
@@ -16,14 +16,14 @@ module.exports = async (ctx) => {
.map(async (index, item) => {
item = $(item);
const contenlUrl = item.find('a').attr('href');
- const description = await ctx.cache.tryGet(contenlUrl, async () => {
- const fullText = await got.get(contenlUrl);
- const fullTextData = cheerio.load(fullText.data);
- return fullTextData('.online_list').html();
- });
+ // const description = await ctx.cache.tryGet(contenlUrl, async () => {
+ // const fullText = await got.get(contenlUrl);
+ // const fullTextData = cheerio.load(fullText.data);
+ // return fullTextData('.online_list').html();
+ // });
return {
title: item.find('a').text(),
- description: description,
+ description: item.find('a').text(),
link: contenlUrl,
};
})
|
c47fd02bd189c28bf93f1796570ec966addd9e89
|
2020-06-01 09:34:01
|
snipersteve
|
feat: 新增几家律师事务所官网文章 (#4872)
| false
|
新增几家律师事务所官网文章 (#4872)
|
feat
|
diff --git a/docs/other.md b/docs/other.md
index 726cd6087bb5cd..67b3e072d12b1d 100644
--- a/docs/other.md
+++ b/docs/other.md
@@ -338,6 +338,35 @@ type 为 all 时,category 参数不支持 cost 和 free
<Route author="SettingDust" example="/uraaka-joshi/_rrwq" path="/uraaka-joshi/:id" :paramsDesc="['用户名']"/>
+## 律师事务所文章
+
+### 君合
+
+<Route author="snipetsteve" example="/law/jh" path="/law/jh" />
+
+### 通商
+
+<Route author="snipetsteve" example="/law/ts" path="/law/ts" />
+
+### 海问
+
+<Route author="snipetsteve" example="/law/hw" path="/law/hw" />
+
+### 环球
+
+<Route author="snipetsteve" example="/law/hq" path="/law/hq" />
+
+### 国枫
+
+<Route author="snipetsteve" example="/law/gf" path="/law/gf" />
+
+### 中伦
+
+<Route author="snipetsteve" example="/law/zl" path="/law/zl" />
+
+### 锦天城
+
+<Route author="snipetsteve" example="/law/jtc" path="/law/jtc" />
## 马良行
### 产品更新
diff --git a/lib/router.js b/lib/router.js
index f8348f7ad93017..289ad79bd5de42 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -2771,6 +2771,27 @@ router.get('/zhutix/latest', require('./routes/zhutix/latest'));
// arXiv
router.get('/arxiv/:query', require('./routes/arxiv/query'));
+// 环球律师事务所文章
+router.get('/law/hq', require('./routes/law/hq'));
+
+// 海问律师事务所文章
+router.get('/law/hw', require('./routes/law/hw'));
+
+// 国枫律师事务所文章
+router.get('/law/gf', require('./routes/law/gf'));
+
+// 通商律师事务所文章
+router.get('/law/ts', require('./routes/law/ts'));
+
+// 锦天城律师事务所文章
+router.get('/law/jtc', require('./routes/law/jtc'));
+
+// 中伦律师事务所文章
+router.get('/law/zl', require('./routes/law/zl'));
+
+// 君合律师事务所文章
+router.get('/law/jh', require('./routes/law/jh'));
+
// Mobilism
router.get('/mobilism/release', require('./routes/mobilism/release'));
diff --git a/lib/routes/law/gf.js b/lib/routes/law/gf.js
new file mode 100644
index 00000000000000..1d59950d90eff9
--- /dev/null
+++ b/lib/routes/law/gf.js
@@ -0,0 +1,41 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = 'http://www.grandwaylaw.com/cn/publications/articles.html';
+ const ori_url = 'http://www.grandwaylaw.com';
+ const res = await got.get(url);
+ const $ = cheerio.load(res.data);
+ const list = $('.cbw ul li').get();
+
+ const out = await Promise.all(
+ list.map(async (item) => {
+ const $ = cheerio.load(item);
+ const title = $('a').html();
+ const sub_url = $('a').attr('href');
+ const itemUrl = ori_url + sub_url;
+
+ const cache = await ctx.cache.get(itemUrl);
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+
+ const responses = await got.get(itemUrl);
+ const $d = cheerio.load(responses.data);
+
+ const single = {
+ title,
+ link: itemUrl,
+ description: $d('.xwzz .txt').html(),
+ };
+
+ ctx.cache.set(itemUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ })
+ );
+ ctx.state.data = {
+ title: $('title').text(),
+ link: url,
+ item: out,
+ };
+};
diff --git a/lib/routes/law/hq.js b/lib/routes/law/hq.js
new file mode 100644
index 00000000000000..008075b3aaf735
--- /dev/null
+++ b/lib/routes/law/hq.js
@@ -0,0 +1,39 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = 'http://www.glo.com.cn/news/publications_list13.html';
+ const res = await got.get(url);
+ const $ = cheerio.load(res.data);
+ const list = $('ul.ul-list li').get();
+
+ const out = await Promise.all(
+ list.map(async (item) => {
+ const $ = cheerio.load(item);
+ const title = $('a').attr('title');
+ const itemUrl = $('a').attr('href');
+
+ const cache = await ctx.cache.get(itemUrl);
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+
+ const responses = await got.get(itemUrl);
+ const $d = cheerio.load(responses.data);
+
+ const single = {
+ title,
+ link: itemUrl,
+ description: $d('article').html(),
+ };
+
+ ctx.cache.set(itemUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ })
+ );
+ ctx.state.data = {
+ title: $('title').text(),
+ link: url,
+ item: out,
+ };
+};
diff --git a/lib/routes/law/hw.js b/lib/routes/law/hw.js
new file mode 100644
index 00000000000000..c3296ef2fa27e1
--- /dev/null
+++ b/lib/routes/law/hw.js
@@ -0,0 +1,39 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = 'http://www.haiwen-law.com/class/view?id=19';
+ const res = await got.get(url);
+ const $ = cheerio.load(res.data);
+ const list = $('div.newlist ul li.clearfix').get();
+
+ const out = await Promise.all(
+ list.map(async (item) => {
+ const $ = cheerio.load(item);
+ const title = $('.ittitle a').html();
+ const itemUrl = $('.ittitle a').attr('href');
+
+ const cache = await ctx.cache.get(itemUrl);
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+
+ const responses = await got.get(itemUrl);
+ const $d = cheerio.load(responses.data);
+
+ const single = {
+ title,
+ link: itemUrl,
+ description: $d('.large').html(),
+ };
+
+ ctx.cache.set(itemUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ })
+ );
+ ctx.state.data = {
+ title: $('title').text(),
+ link: url,
+ item: out,
+ };
+};
diff --git a/lib/routes/law/jh.js b/lib/routes/law/jh.js
new file mode 100644
index 00000000000000..9627a6cd2658b2
--- /dev/null
+++ b/lib/routes/law/jh.js
@@ -0,0 +1,41 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = 'http://www.junhe.com/legal-updates';
+ const ori_url = 'http://www.junhe.com';
+ const res = await got.get(url);
+ const $ = cheerio.load(res.data);
+ const list = $('.news-content ul.list').get();
+
+ const out = await Promise.all(
+ list.map(async (item) => {
+ const $ = cheerio.load(item);
+ const title = $('h1').html();
+ const sub_url = $('a').attr('href');
+ const itemUrl = ori_url + sub_url;
+
+ const cache = await ctx.cache.get(itemUrl);
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+
+ const responses = await got.get(itemUrl);
+ const $d = cheerio.load(responses.data);
+
+ const single = {
+ title,
+ link: itemUrl,
+ description: $d('.d-content').html(),
+ };
+
+ ctx.cache.set(itemUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ })
+ );
+ ctx.state.data = {
+ title: $('title').text(),
+ link: url,
+ item: out,
+ };
+};
diff --git a/lib/routes/law/jtc.js b/lib/routes/law/jtc.js
new file mode 100644
index 00000000000000..52533c6fcdb0a2
--- /dev/null
+++ b/lib/routes/law/jtc.js
@@ -0,0 +1,41 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = 'https://www.allbrightlaw.com/CN/10475.aspx';
+ const ori_url = 'https://www.allbrightlaw.com';
+ const res = await got.get(url);
+ const $ = cheerio.load(res.data);
+ const list = $('.news_list_img ul li').get();
+
+ const out = await Promise.all(
+ list.map(async (item) => {
+ const $ = cheerio.load(item);
+ const title = $('.news_txt h2').html();
+ const sub_url = $('a').attr('href');
+ const itemUrl = ori_url + sub_url;
+
+ const cache = await ctx.cache.get(itemUrl);
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+
+ const responses = await got.get(itemUrl);
+ const $d = cheerio.load(responses.data);
+
+ const single = {
+ title,
+ link: itemUrl,
+ description: $d('.news_content_box .news_content').html(),
+ };
+
+ ctx.cache.set(itemUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ })
+ );
+ ctx.state.data = {
+ title: $('title').text(),
+ link: url,
+ item: out,
+ };
+};
diff --git a/lib/routes/law/ts.js b/lib/routes/law/ts.js
new file mode 100644
index 00000000000000..cb3fa323444e27
--- /dev/null
+++ b/lib/routes/law/ts.js
@@ -0,0 +1,41 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = 'http://www.tongshang.com/researches';
+ const ori_url = 'http://www.tongshang.com';
+ const res = await got.get(url);
+ const $ = cheerio.load(res.data);
+ const list = $('.tableList .newsTab').get();
+
+ const out = await Promise.all(
+ list.map(async (item) => {
+ const $ = cheerio.load(item);
+ const title = $('a').html();
+ const sub_url = $('a').attr('href');
+ const itemUrl = ori_url + sub_url;
+
+ const cache = await ctx.cache.get(itemUrl);
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+
+ const responses = await got.get(itemUrl);
+ const $d = cheerio.load(responses.data);
+
+ const single = {
+ title,
+ link: itemUrl,
+ description: $d('.col-md-9').html(),
+ };
+
+ ctx.cache.set(itemUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ })
+ );
+ ctx.state.data = {
+ title: $('title').text(),
+ link: url,
+ item: out,
+ };
+};
diff --git a/lib/routes/law/zl.js b/lib/routes/law/zl.js
new file mode 100644
index 00000000000000..47a7db79072cc1
--- /dev/null
+++ b/lib/routes/law/zl.js
@@ -0,0 +1,40 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const url = 'http://www.zhonglun.com/zx/zlgd.html';
+ const ori_url = 'http://www.zhonglun.com';
+ const res = await got.get(url);
+ const $ = cheerio.load(res.data);
+ const list = $('.zx_list ul li').get();
+
+ const out = await Promise.all(
+ list.map(async (item) => {
+ const $ = cheerio.load(item);
+ const sub_url = $('a').attr('href');
+ const itemUrl = ori_url + sub_url;
+
+ const cache = await ctx.cache.get(itemUrl);
+ if (cache) {
+ return Promise.resolve(JSON.parse(cache));
+ }
+
+ const responses = await got.get(itemUrl);
+ const $d = cheerio.load(responses.data);
+
+ const single = {
+ title: $d('.news_main .txt span').html(),
+ link: itemUrl,
+ description: $d('.news_main').html(),
+ };
+
+ ctx.cache.set(itemUrl, JSON.stringify(single));
+ return Promise.resolve(single);
+ })
+ );
+ ctx.state.data = {
+ title: $('title').text(),
+ link: url,
+ item: out,
+ };
+};
|
fbb7492d736c6aa6d544db259d682fd504779820
|
2024-06-28 17:41:34
|
dependabot[bot]
|
chore(deps): bump hono from 4.4.8 to 4.4.9 (#16023)
| false
|
bump hono from 4.4.8 to 4.4.9 (#16023)
|
chore
|
diff --git a/package.json b/package.json
index 1e6641af7d0fea..44fe3d42f343f0 100644
--- a/package.json
+++ b/package.json
@@ -75,7 +75,7 @@
"fanfou-sdk": "5.0.0",
"form-data": "4.0.0",
"googleapis": "140.0.1",
- "hono": "4.4.8",
+ "hono": "4.4.9",
"html-to-text": "9.0.5",
"http-cookie-agent": "6.0.5",
"https-proxy-agent": "7.0.4",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e419fac875d177..5538c874de93a5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -13,7 +13,7 @@ importers:
version: 1.11.4
'@hono/zod-openapi':
specifier: 0.14.5
- version: 0.14.5([email protected])([email protected])
+ version: 0.14.5([email protected])([email protected])
'@notionhq/client':
specifier: 2.2.15
version: 2.2.15
@@ -84,8 +84,8 @@ importers:
specifier: 140.0.1
version: 140.0.1
hono:
- specifier: 4.4.8
- version: 4.4.8
+ specifier: 4.4.9
+ version: 4.4.9
html-to-text:
specifier: 9.0.5
version: 9.0.5
@@ -3748,8 +3748,8 @@ packages:
[email protected]:
resolution: {integrity: sha512-4FP6J0oI8jqb6gLLl9tSwVdosWJ/AKSGJ+HwYf6Ixe4MUcEkst4uWzpVQrNOCin0fzTRQbXV8ePheU8WiiDYBw==}
- [email protected]:
- resolution: {integrity: sha512-eewnSgTzdWgFVn97kPV24h+9UVNUQ+9mj6IRxr7dBseTaTBSHtFo/T/vRNcqJkQFysVoXyecflr3Xe/fdvzEpQ==}
+ [email protected]:
+ resolution: {integrity: sha512-VW1hnYipHL/XsnSYiCTLJ+Z7iisZYWwSOiKXm9RBV2NKPxNqjfaHqeMFiDl11fK893ofmErvRpX20+FTNjZIjA==}
engines: {node: '>=16.0.0'}
[email protected]:
@@ -7620,16 +7620,16 @@ snapshots:
'@hono/[email protected]': {}
- '@hono/[email protected]([email protected])([email protected])':
+ '@hono/[email protected]([email protected])([email protected])':
dependencies:
'@asteasolutions/zod-to-openapi': 7.1.1([email protected])
- '@hono/zod-validator': 0.2.2([email protected])([email protected])
- hono: 4.4.8
+ '@hono/zod-validator': 0.2.2([email protected])([email protected])
+ hono: 4.4.9
zod: 3.23.8
- '@hono/[email protected]([email protected])([email protected])':
+ '@hono/[email protected]([email protected])([email protected])':
dependencies:
- hono: 4.4.8
+ hono: 4.4.9
zod: 3.23.8
'@humanwhocodes/[email protected]':
@@ -8122,7 +8122,7 @@ snapshots:
'@scalar/[email protected]([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))':
dependencies:
'@scalar/api-reference': 1.24.21([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected]([email protected])([email protected])))
- hono: 4.4.8
+ hono: 4.4.9
transitivePeerDependencies:
- '@jest/globals'
- '@types/bun'
@@ -10715,7 +10715,7 @@ snapshots:
[email protected]: {}
- [email protected]: {}
+ [email protected]: {}
[email protected]: {}
|
eebd99c85a897edfbbb5cf84e2f5f641ef37fa3b
|
2023-08-24 22:04:19
|
Andvari
|
feat(route): Add Discourse notifications support (#13114)
| false
|
Add Discourse notifications support (#13114)
|
feat
|
diff --git a/lib/v2/discourse/maintainer.js b/lib/v2/discourse/maintainer.js
index 6d6c640d8ec69f..559fca350ffa4c 100644
--- a/lib/v2/discourse/maintainer.js
+++ b/lib/v2/discourse/maintainer.js
@@ -1,3 +1,4 @@
module.exports = {
'/:configId/posts': ['dzx-dzx'],
+ '/:configId/notification': ['dzx-dzx'],
};
diff --git a/lib/v2/discourse/notifications.js b/lib/v2/discourse/notifications.js
new file mode 100644
index 00000000000000..b781f3d048c7a5
--- /dev/null
+++ b/lib/v2/discourse/notifications.js
@@ -0,0 +1,22 @@
+const { getConfig } = require('./utils');
+const got = require('@/utils/got');
+
+module.exports = async (ctx) => {
+ const { link, key } = getConfig(ctx);
+
+ const response = await got(`${link}/notifications.json`, { headers: { 'User-Api-Key': key } }).json();
+ const items = response.notifications.map((e) => ({
+ title: e.fancy_title ?? e.data.badge_name,
+ link: `${link}/${e.data.hasOwnProperty('badge_id') ? `badges/${e.data.badge_id}/${e.data.badge_slug}?username=${e.data.username}` : `${e.topic_id}/${e.post_number}`}`,
+ pubDate: new Date(e.created_at),
+ author: e.data.display_username ?? e.data.username,
+ category: `notification_type:${e.notification_type}`,
+ }));
+
+ const { about } = await got(`${link}/about.json`, { headers: { 'User-Api-Key': key } }).json();
+ ctx.state.data = {
+ title: `${about.title} - Notifications`,
+ description: about.description,
+ item: items,
+ };
+};
diff --git a/lib/v2/discourse/posts.js b/lib/v2/discourse/posts.js
index 0dc8317be9b5e9..8d7ed20924a090 100644
--- a/lib/v2/discourse/posts.js
+++ b/lib/v2/discourse/posts.js
@@ -1,12 +1,9 @@
-const config = require('@/config').value;
+const { getConfig } = require('./utils');
const got = require('@/utils/got');
const RSSParser = require('@/utils/rss-parser');
module.exports = async (ctx) => {
- if (!config.discourse.config[ctx.params.configId]) {
- throw Error('Discourse RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install">relevant config</a>');
- }
- const { link, key } = config.discourse.config[ctx.params.configId];
+ const { link, key } = getConfig(ctx);
const feed = await RSSParser.parseString(
(
diff --git a/lib/v2/discourse/router.js b/lib/v2/discourse/router.js
index b59d0004f6d806..e538d1ef8238ad 100644
--- a/lib/v2/discourse/router.js
+++ b/lib/v2/discourse/router.js
@@ -1,3 +1,4 @@
module.exports = (router) => {
router.get('/:configId/posts', require('./posts'));
+ router.get('/:configId/notifications', require('./notifications'));
};
diff --git a/lib/v2/discourse/utils.js b/lib/v2/discourse/utils.js
new file mode 100644
index 00000000000000..1b56e7b107d44d
--- /dev/null
+++ b/lib/v2/discourse/utils.js
@@ -0,0 +1,12 @@
+const config = require('@/config').value;
+
+function getConfig(ctx) {
+ if (!config.discourse.config[ctx.params.configId]) {
+ throw Error('Discourse RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install">relevant config</a>');
+ }
+ return config.discourse.config[ctx.params.configId];
+}
+
+module.exports = {
+ getConfig,
+};
diff --git a/website/docs/routes/bbs.md b/website/docs/routes/bbs.md
index 9136f178c8327b..a98f47f40bb14c 100644
--- a/website/docs/routes/bbs.md
+++ b/website/docs/routes/bbs.md
@@ -150,7 +150,11 @@ You need to set the environment variable `DISCOURSE_CONFIG_{id}` before using it
### Latest posts {#discourse-latest-posts}
-<Route author="dzx-dzx" example="/discourse/0/posts" path="/discuz/:configId/posts" paramsDesc={['Environment variable configuration id, see above']} selfhost="1"/>
+<Route author="dzx-dzx" example="/discourse/0/posts" path="/discourse/:configId/posts" paramsDesc={['Environment variable configuration id, see above']} selfhost="1"/>
+
+### Notifications {#discourse-notifications}
+
+<Route author="dzx-dzx" example="/discourse/0/notifications" path="/discourse/:configId/notifications" paramsDesc={['Environment variable configuration id, see above']} selfhost="1"/>
## Discuz {#discuz}
|
0b8effc1ff85fafd4e85e9137ccaa2d38f7b1e43
|
2024-06-27 18:47:04
|
dependabot[bot]
|
chore(deps): bump entities from 4.5.0 to 5.0.0 (#16011)
| false
|
bump entities from 4.5.0 to 5.0.0 (#16011)
|
chore
|
diff --git a/package.json b/package.json
index 9a94809fe929da..dcce423129b481 100644
--- a/package.json
+++ b/package.json
@@ -70,7 +70,7 @@
"destr": "2.0.3",
"directory-import": "3.3.1",
"dotenv": "16.4.5",
- "entities": "4.5.0",
+ "entities": "5.0.0",
"etag": "1.8.1",
"fanfou-sdk": "5.0.0",
"form-data": "4.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6284ebe0d73c39..55545efc6761ab 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -69,8 +69,8 @@ importers:
specifier: 16.4.5
version: 16.4.5
entities:
- specifier: 4.5.0
- version: 4.5.0
+ specifier: 5.0.0
+ version: 5.0.0
etag:
specifier: 1.8.1
version: 1.8.1
@@ -3076,6 +3076,10 @@ packages:
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
engines: {node: '>=0.12'}
+ [email protected]:
+ resolution: {integrity: sha512-BeJFvFRJddxobhvEdm5GqHzRV/X+ACeuw0/BuuxsCh1EUZcAIz8+kYmBp/LrQuloy6K1f3a0M7+IhmZ7QnkISA==}
+ engines: {node: '>=0.12'}
+
[email protected]:
resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==}
engines: {node: '>=6'}
@@ -9849,6 +9853,8 @@ snapshots:
[email protected]: {}
+ [email protected]: {}
+
[email protected]: {}
[email protected]:
|
5cfa5845a09eefc2395499b01b7127f89e491def
|
2021-01-20 18:07:43
|
tuzi3040
|
fix(config): debug not shown when DEBUG_INFO set true
| false
|
debug not shown when DEBUG_INFO set true
|
fix
|
diff --git a/lib/routes/index.js b/lib/routes/index.js
index 22fb4f740ab568..15c8e3f92dcf5c 100644
--- a/lib/routes/index.js
+++ b/lib/routes/index.js
@@ -59,7 +59,7 @@ module.exports = async (ctx) => {
if (!config.debugInfo || config.debugInfo === 'false') {
showDebug = false;
} else {
- showDebug = config.debugInfo === true || config.debugInfo === ctx.query.debug;
+ showDebug = config.debugInfo === 'true' || config.debugInfo === ctx.query.debug;
}
const { disallowRobot } = config;
|
860710232287d216cd9e83237c225f843f639b10
|
2024-05-04 03:40:24
|
dependabot[bot]
|
chore(deps): bump tsx from 4.8.2 to 4.9.0 (#15466)
| false
|
bump tsx from 4.8.2 to 4.9.0 (#15466)
|
chore
|
diff --git a/package.json b/package.json
index bd1b3b5683bc2c..a39606d73adcb5 100644
--- a/package.json
+++ b/package.json
@@ -116,7 +116,7 @@
"tldts": "6.1.18",
"tosource": "2.0.0-alpha.3",
"tough-cookie": "4.1.4",
- "tsx": "4.8.2",
+ "tsx": "4.9.0",
"twitter-api-v2": "1.16.3",
"undici": "6.15.0",
"uuid": "9.0.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e064c398999b6f..0142aaa0a21890 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -204,8 +204,8 @@ dependencies:
specifier: 4.1.4
version: 4.1.4
tsx:
- specifier: 4.8.2
- version: 4.8.2
+ specifier: 4.9.0
+ version: 4.9.0
twitter-api-v2:
specifier: 1.16.3
version: 1.16.3
@@ -8931,8 +8931,8 @@ packages:
/[email protected]:
resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
- /[email protected]:
- resolution: {integrity: sha512-hmmzS4U4mdy1Cnzpl/NQiPUC2k34EcNSTZYVJThYKhdqTwuBeF+4cG9KUK/PFQ7KHaAaYwqlb7QfmsE2nuj+WA==}
+ /[email protected]:
+ resolution: {integrity: sha512-UY0UUhDPL6MkqkZU4xTEjEBOLfV+RIt4xeeJ1qwK73xai4/zveG+X6+tieILa7rjtegUW2LE4p7fw7gAoLuytA==}
engines: {node: '>=18.0.0'}
hasBin: true
dependencies:
|
e3daf69915b4c12adbe77d963cbc3f771e81bbf1
|
2024-05-20 20:24:31
|
dependabot[bot]
|
chore(deps): bump tsx from 4.10.4 to 4.10.5 (#15633)
| false
|
bump tsx from 4.10.4 to 4.10.5 (#15633)
|
chore
|
diff --git a/package.json b/package.json
index ed39e5db4512a9..614591e402b14a 100644
--- a/package.json
+++ b/package.json
@@ -116,7 +116,7 @@
"tldts": "6.1.20",
"tosource": "2.0.0-alpha.3",
"tough-cookie": "4.1.4",
- "tsx": "4.10.4",
+ "tsx": "4.10.5",
"twitter-api-v2": "1.16.4",
"undici": "6.17.0",
"uuid": "9.0.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 2d6e514c0815f3..259b081f08b8cd 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -207,8 +207,8 @@ importers:
specifier: 4.1.4
version: 4.1.4
tsx:
- specifier: 4.10.4
- version: 4.10.4
+ specifier: 4.10.5
+ version: 4.10.5
twitter-api-v2:
specifier: 1.16.4
version: 1.16.4
@@ -5038,8 +5038,8 @@ packages:
[email protected]:
resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
- [email protected]:
- resolution: {integrity: sha512-Gtg9qnZWNqC/OtcgiXfoAUdAKx3/cgKOYvEocAsv+m21MV/eKpV/WUjRXe6/sDCaGBl2/v8S6v29BpUnGMCX5A==}
+ [email protected]:
+ resolution: {integrity: sha512-twDSbf7Gtea4I2copqovUiNTEDrT8XNFXsuHpfGbdpW/z9ZW4fTghzzhAG0WfrCuJmJiOEY1nLIjq4u3oujRWQ==}
engines: {node: '>=18.0.0'}
hasBin: true
@@ -10659,7 +10659,7 @@ snapshots:
[email protected]: {}
- [email protected]:
+ [email protected]:
dependencies:
esbuild: 0.20.2
get-tsconfig: 4.7.5
|
e24faf4d0e38f897f5783c646857fbd06a2e121b
|
2019-06-27 16:26:56
|
Azureki
|
feat: 优化知乎话题url (#2499)
| false
|
优化知乎话题url (#2499)
|
feat
|
diff --git a/lib/routes/zhihu/activities.js b/lib/routes/zhihu/activities.js
index bf06c2da4a3834..56955434d7eb2b 100644
--- a/lib/routes/zhihu/activities.js
+++ b/lib/routes/zhihu/activities.js
@@ -75,7 +75,7 @@ module.exports = async (ctx) => {
case 'topic':
title = detail.name;
description = `<p>${detail.introduction}</p><p>话题关注者人数:${detail.followers_count}</p>`;
- url = detail.url;
+ url = `https://www.zhihu.com/topic/${detail.url.split('/').pop()}`;
break;
case 'live':
title = detail.subject;
|
f6ab7b6ac9bf54102792afc5f8e22a570cabc703
|
2022-12-18 19:59:01
|
水货
|
feat(route): 增加茂名地方政府网站 (#11239)
| false
|
增加茂名地方政府网站 (#11239)
|
feat
|
diff --git a/docs/government.md b/docs/government.md
index e2687858984ddc..4f97dce9bd84f3 100644
--- a/docs/government.md
+++ b/docs/government.md
@@ -202,6 +202,132 @@ pageClass: routes
</Route>
+## 茂名市人民政府
+
+### 茂名市人民政府门户网站
+
+<Route author="ShuiHuo" example="/gov/maoming/www/zwgk/zcjd/jd" path="/gov/maoming/:path+" :paramsDesc="['路径']">
+
+::: tip 提示
+
+路径处填写对应页面 URL 中茂名有关政府网站的域名最前面的部分和域名后的字段。下面是一个例子。
+
+若订阅 [茂名市人民政府门户网站 > 政务公开 > 政策解读](http://www.maoming.gov.cn/zwgk/zcjd/jd/) 则将对应页面 URL <http://www.maoming.gov.cn/zwgk/zcjd/jd/> 中 `http://www.maoming.gov.cn/` 的字段 `www` 和 `/zwgk/zcjd/jd/` 作为路径填入。此时路由为 [`/gov/maoming/www/zwgk/zcjd/jd/`](https://rsshub.app/gov/maoming/www/zwgk/zcjd/jd/)
+
+若订阅 [茂名市农业农村局网站 > 政务区 > 政务公开 > 通知公告](http://mmny.maoming.gov.cn/zwq/zwgk/tzgg/) 则将对应页面 URL <http://mmny.maoming.gov.cn/zwq/zwgk/tzgg/> 中 `http://mmny.maoming.gov.cn/` 的字段 `mmny` 和 `/zwq/zwgk/tzgg/` 作为路径填入。此时路由为 [`/gov/maoming/mmny/zwq/zwgk/tzgg/`](https://rsshub.app/gov/maoming/mmny/zwq/zwgk/tzgg/)
+
+:::
+
+</Route>
+
+### 茂名市茂南区人民政府
+
+<Route author="ShuiHuo" example="/gov/maonan/zwgk" path="/gov/maonan/:category" :paramsDesc="['分类名']">
+
+| 政务公开 | 政务新闻 | 茂南动态 | 重大会议 | 公告公示 | 招录信息 | 政策解读 |
+| :--: | :--: | :--: | :--: | :--: | :--: | :--: |
+| zwgk | zwxw | mndt | zdhy | tzgg | zlxx | zcjd |
+
+</Route>
+
+### 茂名市电白区人民政府
+
+<Route author="ShuiHuo" example="/gov/dianbai/www/zwgk/zcjd" path="/gov/dianbai/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
+
+::: tip 提示
+
+路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
+
+若订阅 [政务公开 > 政策解读](http://www.dianbai.gov.cn/zwgk/zcjd/) 则将对应页面 URL <http://www.dianbai.gov.cn/zwgk/zcjd/> 中 `http://www.dianbai.gov.cn/` 的字段`www` 和 `zwgk/zcjd/` 作为路径填入。此时路由为 [`/gov/dianbai/www/zwgk/zcjd/`](https://rsshub.app/gov/dianbai/www/zwgk/zcjd/)
+
+:::
+
+</Route>
+
+### 信宜市人民政府
+
+<Route author="ShuiHuo" example="/gov/xinyi/www/zwgk/zcjd" path="/gov/xinyi/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
+
+::: tip 提示
+
+路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
+
+若订阅 [政务公开 > 政策解读](http://www.xinyi.gov.cn/zwgk/zcjd/) 则将对应页面 URL <http://www.xinyi.gov.cn/zwgk/zcjd/> 中 `http://www.xinyi.gov.cn/` 的字段 `www` 和 `zwgk/zcjd/` 作为路径填入。此时路由为 [`/gov/xinyi/www/zwgk/zcjd/`](https://rsshub.app/gov/xinyi/www/zwgk/zcjd/)
+
+:::
+
+</Route>
+
+### 高州市人民政府
+
+<Route author="ShuiHuo" example="/gov/gaozhou/www/zwgk/zcjd" path="/gov/gaozhou/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政策解读']">
+
+::: tip 提示
+
+路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
+
+若订阅 [政策解读](http://www.gaozhou.gov.cn/zcjd/) 则将对应页面 URL <http://www.gaozhou.gov.cn/zcjd/> 中 `http://www.gaozhou.gov.cn/` 的字段 `www` 和 `zcjd/` 作为路径填入。此时路由为 [`/gov/gaozhou/www/zcjd/`](https://rsshub.app/gov/gaozhou/www/zcjd/)
+
+:::
+
+</Route>
+
+### 化州市人民政府
+
+<Route author="ShuiHuo" example="/gov/huazhou/www/zwgk/zcjd" path="/gov/huazhou/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政策解读']">
+
+::: tip 提示
+
+路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
+
+若订阅 [政策解读](http://www.huazhou.gov.cn/syzl/zcjd/) 则将对应页面 URL <http://www.huazhou.gov.cn/syzl/zcjd/> 中 `http://www.huazhou.gov.cn/` 的字段 `www` `syzl/zcjd/` 作为路径填入。此时路由为 [`/gov/huazhou/www/syzl/zcjd/`](https://rsshub.app/gov/huazhou/www/syzl/zcjd/)
+
+:::
+
+</Route>
+
+### 广东茂名滨海新区政务网
+
+<Route author="ShuiHuo" example="/gov/mgs/www/zwgk/zcjd" path="/gov/mgs/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
+
+::: tip 提示
+
+路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
+
+若订阅 [政务公开 > 政策解读](http://www.mgs.gov.cn/zwgk/zcjd/) 则将对应页面 URL <http://www.mgs.gov.cn/zwgk/zcjd/> 中 `http://www.mgs.gov.cn/` 的字段 `www` 和 `zwgk/zcjd/` 作为路径填入。此时路由为 [`/gov/mgs/www/zwgk/zcjd/`](https://rsshub.app/gov/mgs/www/zwgk/zcjd/)
+
+:::
+
+</Route>
+
+### 广东茂名高新技术产业开发区
+
+<Route author="ShuiHuo" example="/gov/mmht/www/xwzx/zcjd" path="/gov/mmht/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
+
+::: tip 提示
+
+路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
+
+若订阅 [政务公开 > 政策解读](http://www.mmht.gov.cn/xwzx/zcjd/) 则将对应页面 URL <http://www.mmht.gov.cn/xwzx/zcjd/> 中 `http://www.mmht.gov.cn/` 的字段 `www` 和 `xwzx/zcjd/` 作为路径填入。此时路由为 [`/gov/mmht/www/xwzx/zcjd/`](https://rsshub.app/gov/mmht/www/xwzx/zcjd/)
+
+:::
+
+</Route>
+
+### 广东省茂名水东湾新城建设管理委员会
+
+<Route author="ShuiHuo" example="/gov/sdb/www/zwgk/zcjd" path="/gov/sdb/:path+" :paramsDesc="['路径,只填写 `www` 默认为 政务公开 > 政策解读']">
+
+::: tip 提示
+
+路径处填写对应页面 URL 中最前面的部分和域名后的字段。下面是一个例子。
+
+若订阅 [政务公开 > 政策解读](http://www.sdb.gov.cn/zwgk/zcjd/) 则将对应页面 URL <http://www.sdb.gov.cn/zwgk/zcjd/> 中 `http://www.sdb.gov.cn/` 的字段 `www` 和 `zwgk/zcjd/` 作为路径填入。此时路由为 [`/gov/sdb/www/zwgk/zcjd/`](https://rsshub.app/gov/sdb/www/zwgk/zcjd/)
+
+:::
+
+</Route>
+
## 国家广播电视总局
### 分类
diff --git a/lib/v2/gov/dianbai/dianbai.js b/lib/v2/gov/dianbai/dianbai.js
new file mode 100644
index 00000000000000..92b0a4769b952c
--- /dev/null
+++ b/lib/v2/gov/dianbai/dianbai.js
@@ -0,0 +1,18 @@
+const { gdgov } = require('../general/general');
+
+module.exports = async (ctx) => {
+ const info = {
+ defaultPath: 'zwgk/zcjd/',
+ list_element: '.news_list li a',
+ title_element: '.content_title',
+ title_match: '(.*)',
+ description_element: '#zoomcon',
+ author_element: undefined,
+ author_match: undefined,
+ authorisme: '茂名市电白区人民政府网',
+ pubDate_element: 'publishtime',
+ pubDate_match: '(.*)',
+ pubDate_format: undefined,
+ };
+ await gdgov(info, ctx);
+};
diff --git a/lib/v2/gov/gaozhou/gaozhou.js b/lib/v2/gov/gaozhou/gaozhou.js
new file mode 100644
index 00000000000000..a5d6349f931f66
--- /dev/null
+++ b/lib/v2/gov/gaozhou/gaozhou.js
@@ -0,0 +1,19 @@
+const { gdgov } = require('../general/general');
+
+module.exports = async (ctx) => {
+ const info = {
+ defaultPath: 'zcjd/',
+ list_element: '.newslist li a',
+ list_include: 'site',
+ title_element: '.head',
+ title_match: '(.*)',
+ description_element: '.contener',
+ author_element: undefined,
+ author_match: undefined,
+ authorisme: '高州市人民政府网',
+ pubDate_element: '.time span:nth-child(1)',
+ pubDate_match: '发布时间:(.*)',
+ pubDate_format: undefined,
+ };
+ await gdgov(info, ctx);
+};
diff --git a/lib/v2/gov/general/general.js b/lib/v2/gov/general/general.js
new file mode 100644
index 00000000000000..04f45eec29140b
--- /dev/null
+++ b/lib/v2/gov/general/general.js
@@ -0,0 +1,250 @@
+// 来人拯救一下啊( >﹏<。)
+// 待做功能:
+// 1. 传入和处理
+// [] index.php?c=category&id=12
+// 2. 处理其他网站链接
+// [] 其他政府网站
+// 3. 添加视频内容
+// [] 示例1: http://www.dianbai.gov.cn/ywdt/dbyw/content/post_1091433.html
+// 4. 处理网站功能
+// [] hdjlpt 互动交流
+
+// 使用方法
+// const { gdgov } = require('../general/general');
+//
+// module.exports = 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/ 则为指定路径。
+// name_element: 'SiteName, ColumnName', // 网站名,默认使用网页标题。
+// name_match_type: 'meta', // 网站名类型。可选 meta(从 <meta> 中获取 content 里面的内容)、name(name_element 就是网站名)、element(选择元素从中获取文本)。
+// name_match: '(.*)', // 网站名类型为 element 时使用的匹配内容。
+// name_join: '—', // 网站名为 meta 或 element 时,如有多个选择器找到内容,将这里的字符串放到这些内容之间。
+// list_element: '.news_list li a', // 页面列表中选择具体到 a。element 都是填写 CSS 选择器。
+// list_include: 'site', // 筛选列表中的页面,会生成选择器添加到 list_element 中。可选 all(包含全部)、site(仅限本站)。
+// title_element: '.content_title', // 正文的标题,默认使用 <meta name="ArticleTitle" content="*">
+// title_match: '(.*)', // 使用正则匹配选择器获取到的文本。match 都是填写正则表达式。
+// description_element: '#zoomcon', // 正文。
+// author_element: undefined, // 正文来源,一般是某某网站、某某媒体,默认使用 <meta name="ContentSource" content="*">。
+// author_match: undefined, // 匹配正文来源。
+// authorisme: '茂名市电白区人民政府网', // 作者是 本网 等内容时改成这里的文本。
+// pubDate_element: 'publishtime', // 发布时间,默认使用 <meta name="PubDate" content="*">。
+// pubDate_match: '(.*)', // 匹配发布时间。
+// pubDate_format: undefined // 发布时间的格式。
+// };
+// await gdgov(info, ctx);
+// };
+
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const timezone = require('@/utils/timezone');
+
+const gdgov = async (info, ctx) => {
+ const path = ctx.path.split('/').filter((item) => item !== '');
+ const [site, branch] = path;
+
+ // 网站
+ const pathstartat = info.pathstartat === undefined ? 0 : info.pathstartat;
+ let rootUrl = 'http://' + branch + '.' + site + '.gov.cn';
+ for (let index = 0; index < pathstartat; index++) {
+ const element = path[index + 2];
+ rootUrl = rootUrl + '/' + element;
+ }
+
+ // 默认路径
+ const defaultPath = info.defaultPath;
+
+ // 网站名
+ let name_element = info.name_element;
+ const name_match_type = info.name_match_type;
+ const name_match = info.name_match;
+ const name_join = info.name_join;
+
+ // 列表元素
+ let list_element = info.list_element;
+ let list_include = info.list_include;
+ if (list_element === undefined) {
+ list_element = 'a[href*="content"]';
+ list_include = 'site';
+ }
+ if (list_include === 'site') {
+ list_element = list_element.split(',').filter((item) => item !== '');
+ for (let index = 0; index < list_element.length; index++) {
+ list_element[index] += '[href*="' + rootUrl.slice(7) + '"]';
+ }
+ list_element = list_element.join(',');
+ }
+
+ // 标题元素
+ let title_element = info.title_element;
+ let title_match = info.title_match;
+
+ // 作者(来源)元素
+ const author_element = info.author_element;
+ const author_match = info.author_match;
+ const authorisme = info.authorisme;
+
+ // 正文
+ let description_element = info.description_element;
+
+ // 发布时间元素
+ let pubDate_element = info.pubDate_element;
+ let pubDate_match = info.pubDate_match;
+ let pubDate_format = info.pubDate_format;
+
+ path.splice(0, 2 + pathstartat);
+ let pathname = path.join('/');
+ pathname = pathname === '' ? defaultPath : pathname.endsWith('/') ? pathname : pathname + '/';
+ const currentUrl = `${rootUrl}/${pathname}`;
+
+ let $ = '';
+ let name = '';
+ let list = '';
+ // 判断是否处于特殊目录
+ if (pathname.startsWith('gkmlpt')) {
+ title_element = undefined;
+ title_match = undefined;
+ description_element = 'div[class="article-content"]';
+ pubDate_element = undefined;
+ pubDate_match = undefined;
+ pubDate_format = undefined;
+
+ const res = await got(`${rootUrl}/gkmlpt/api/all/0`);
+ name = authorisme + '政府信息公开平台';
+ list = res.data.articles.filter((item) => item.url.includes('content'));
+ } else {
+ const res = await got(currentUrl);
+ const dataArray = res.data;
+ $ = cheerio.load(dataArray);
+ switch (name_match_type) {
+ case 'name':
+ name = name_element;
+ break;
+ case 'meta':
+ name_element = name_element.split(',').filter((item) => item !== '');
+ for (let index = 0; index < name_element.length; index++) {
+ name_element[index] = $('meta[name="' + name_element[index].trim() + '"]').attr('content');
+ }
+ name = name_element.join(name_join);
+ break;
+ case 'element':
+ name_element = name_element.split(',').filter((item) => item !== '');
+ for (let index = 0; index < name_element.length; index++) {
+ name_element[index] = $(name_element[index].trim()).text().match(name_match)[1];
+ }
+ name = name_element.join(name_join);
+ break;
+ default:
+ name = $('head title').text();
+ break;
+ }
+ list = $(list_element);
+ }
+
+ const lists = Array.from(
+ list.map((i, item) => {
+ let link = '';
+
+ if (pathname.startsWith('gkmlpt')) {
+ link = i.url;
+ } else {
+ link = $(item).attr('href');
+ // 判断获取到的链接是否完整,不完整则补全。
+ if (!link.startsWith('http')) {
+ link.startsWith('/') ? (link = `${rootUrl}${link}`) : (link = `${rootUrl}/${link}`);
+ }
+ }
+
+ return link;
+ })
+ );
+
+ const items = await Promise.all(
+ lists.map((link) => {
+ const idlink = new URL(link);
+
+ if (idlink.pathname === '/zcjdpt') {
+ // http://www.dg.gov.cn/zcjdpt?id=4798
+ // http://smzj.maoming.gov.cn/zcjdpt?id=4595
+ // http://fgj.maoming.gov.cn/zcjdpt?id=4993
+ // https://zcjd.cloud.gd.gov.cn/api/home/article?id=4993
+ return ctx.cache.tryGet(link, async () => {
+ const { art } = require('@/utils/render');
+
+ const zcjdlink = 'https://zcjd.cloud.gd.gov.cn/api/home/article' + idlink.search;
+ const response = await got(zcjdlink);
+ const data = response.data.data;
+ for (let index = 0; index < data.jie_du_items.length; index++) {
+ data.jie_du_items[index].jd_content = data.jie_du_items[index].jd_content.replace(/((\n {4})|(\n))/g, '</p><p style="font-size: 16px;line-height: 32px;text-indent: 2em;">');
+ }
+
+ return {
+ link,
+ title: data.art_title,
+ description: art(__dirname + '/templates/zcjdpt.art', data),
+ pubDate: timezone(parseDate(data.pub_time), +8),
+ author: RegExp('(本|本网|本站)').test(data.pub_unite) ? authorisme : data.pub_unite,
+ };
+ });
+ } else if (idlink.host === 'mp.weixin.qq.com') {
+ const { finishArticleItem } = require('@/utils/wechat-mp');
+ return finishArticleItem(ctx, { link });
+ } else {
+ return ctx.cache.tryGet(link, async () => {
+ // 获取网页
+ const { data: res } = await got(link);
+ const content = cheerio.load(res);
+
+ // 获取来源
+ let author = '';
+ if (author_element === undefined) {
+ author = content('meta[name="ContentSource"]').attr('content');
+ } else {
+ author = content(author_element).text().trim().match(author_match)[1].trim().replace(/(-*$)/g, '');
+ }
+
+ // 获取发布时间
+ let pubDate = '';
+ if (pubDate_element === undefined) {
+ pubDate = content('meta[name="PubDate"]').attr('content');
+ } else {
+ pubDate = content(pubDate_element).text().trim().match(pubDate_match)[1].trim().replace(/(-*$)/g, '');
+ }
+
+ // 获取标题
+ let title = '';
+ if (title_element === undefined) {
+ title = content('meta[name="ArticleTitle"]').attr('content');
+ } else {
+ title = content(title_element).text().trim().match(title_match)[1];
+ }
+ // 获取正文
+ const description_content = description_element.split(',').filter((item) => item !== '');
+ for (let index = 0; index < description_content.length; index++) {
+ description_content[index] = content(description_content[index].trim()).html();
+ }
+ const description = description_content.join('');
+
+ return {
+ link,
+ title,
+ description,
+ pubDate: timezone(parseDate(pubDate, pubDate_format), +8),
+ author: RegExp('(本|本网|本站)').test(author) ? authorisme : author,
+ };
+ });
+ }
+ })
+ );
+
+ ctx.state.data = {
+ title: name,
+ link: currentUrl,
+ item: items,
+ };
+};
+
+module.exports = {
+ gdgov,
+};
diff --git a/lib/v2/gov/general/templates/zcjdpt.art b/lib/v2/gov/general/templates/zcjdpt.art
new file mode 100644
index 00000000000000..e75bd0026ba4ef
--- /dev/null
+++ b/lib/v2/gov/general/templates/zcjdpt.art
@@ -0,0 +1,128 @@
+<div class="content">
+ <div class="wrap" style="max-width: 1200px;margin: auto;">
+ <h3 class="policy" style="text-align: center;font-size: 40px;font-weight: bold;color: #32638C;line-height: 66px;">{{art_title}}</h3>
+ <p class="department" style="max-width: 506px;text-align: center;background: #3b87c7;font-size: 20px;font-weight: bold;color: #FFF;margin: 12px auto 36px;box-sizing: border-box;padding: 10px 15px;background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfoAAAAzCAMAAABIWzqzAAAAXVBMVEUAAAA7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8c7h8e9GIvqAAAAHnRSTlMA/fjk0xQEwbKoaz8v8OyblYmCWjUlIQ0Kx3NfVUbjQScSAAABNElEQVR42u3cB3LCUBAE0VFEiSyCCXv/Y9rlCFhwgD/97qAqqXe1agKWGu3ygKF8J60DhtaSDkXATnHQh3PAzlmf3gJm3vRlzAJWslHflgErS/2o5gEj80q/TgEjJ/2py4CNstaNa8DGVbdI+T4a3duT8k3kez3YBCxs9OhIyrdQHPXPNmBgqwmzQPJmmjKQ8pOXDZq0CiRupWnVIpC0RaUnukDSOt0h5dsoaz3VBxLW64U2kKxWr4yBZI3iqTfV6oWeqpOwrBdv+KbKWnzXm+pEzTO1qETDN7USkztT2SDm9aZmmnAJGLiI3TxTxVFs5JraiD18U/meeO+qZVBvqyfeuypr4r2rTlzVMDWvxC0dU0vivatsIN67mvGLra2tuJFrqjiIy9im1uIevql8x+ksV807+Hx1WMdc5EgAAAAASUVORK5CYII=) 0 0 no-repeat;background-size: 100% 100%;">{{pub_unite}}</p>
+ <div class="p_date" style="text-align: center;margin: 0 0 36px 0;display: flex;justify-content: center;flex-wrap: wrap;">
+ {{if pub_time.length}}<span class="pub_time" style="font-size: 20px;color: #32638C;width: 15em;margin: 0.5em;">政策发布时间:{{pub_time}}</span>{{/if}}
+ {{if expiry_date.length}}<span class="expiry_date" style="font-size: 20px;color: #32638C;width: 15em;margin: 0.5em;"> 政策有效期:{{expiry_date}}</span>{{/if}}
+ </div>
+ <div class="smalltext" style="position: relative;padding: 2em 0;max-width: 1044px;margin: auto;background: url(https://zcjd.cloud.gd.gov.cn/zcjd/TemplateOne/images/smalltext.png) center no-repeat;background-size: 100% 100%;">
+ <div class="s_title" style="display: flex;flex-wrap: wrap;justify-content: space-between;padding: 2em 2em 0.5em;">
+ <div>
+ <span class="sLeft" style="line-height: 42px;font-size: 22px;border-left: 0.2em solid #3b87c7;padding-left: 0.3em;">政策原文</span>
+ </div>
+ {{if she_qi_items.has_money}}
+ <div class="cIs she_qi" style="border: 2px dashed #3B87C7;padding: 0 19px 0 12px;white-space: nowrap;">
+ <span style="font-size: 20px;line-height: 42px;">本政策涉及资金支持</span>
+ </div>
+ {{/if}}
+ </div>
+ <div class="p_main" style="padding: 1em 2em;">
+ <h3 style="font-size: 22px;line-height: 36px;margin-bottom: 7px;text-align: center;">{{zc_title}}</h3>
+ <p style="font-size: 18px;line-height: 32px;text-indent: 2em;">{{summary}}</p>
+ </div>
+ <a href="{{link}}" class="toOriginal" style="font-size: 20px;color: #2F6EA3;font-weight: bold;text-decoration: none;width: 90%;display: block;text-align: right;">>>阅读原文</a>
+ </div>
+
+ {{if she_qi_items.id}}
+ <div class="cBar she_qi" style="margin-top: 56px;">
+ <h3 class="c_title" style="text-align: center;background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABK0AAAACCAYAAACaPC/6AAAA9klEQVRoQ+2XMQoCMRBFN6vibRR7QRsPIYo3cK+gJxBBa5tFT2G7lYLgAWw8hxtJEdxNk2kMCbwtwy8m8/e/yahBcd5kztfJs9djvyjt8Wh9mXyUnrq6fjc/3XbztzlPUWPqltw/Nk2KvZbUjB9x5Qw/8MM3GyRslGQ/RQ35IB/ko92B5puQfJAP8kE+mh2IeWeEV/AKXsXPKzUsSu0apbW+Pg+rmT03i4nK6q2r69VqfD8uKxv21DSmbsn9Y9Pgh/+fDekZfuBHCDbCq7jmEH7gh+/tJJlDzA/mB/Pj1wH2j/b+JWFISA28glfwCl7ZDri8/jeLvsjV9/igSBApAAAAAElFTkSuQmCC) center repeat-x;"><span style="display: inline-block;font-size: 36px;color: #32638C;font-weight: bold;background: #FFF;padding: 0 30px;line-height: 44px;">政策种类</span></h3>
+ <div class="pTypeList" style="text-align: center;">
+ <% var zcType = she_qi_items.zc_type_text.split(','); %>
+ <% var zcTypeIcon = she_qi_items.zc_type_icon.split(','); %>
+ <% for(var i = 0; i < zcType.length; i++){ %>
+ <div class="tIcon" style="display: inline-block;vertical-align: middle;margin: 22px 35px 0;text-align: left;width: 180px;height: 86px;background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAABWCAYAAABmQby7AAAgAElEQVR4Xu1dB3hUxdqes33TCaSQkIQEAoQiqPw06eWiIBawckXUy7XrFRAFRVBRBEQF61WugooiKipNBQtFJKGIEkINpAdCAiEhZfue/3snmXWzJCFASD3neTTL7pwzc2be851v3q9JrB4PWZalIS9sVuu8A/VmZ2mkg7E42cliR3Zp1fG5Me1bWuxySG6RVfv4Zwd8jheYZD5USbJJEjM7nXJur+iA3MV3dk6WVOzQoZzSzMUbMwpTzhQWOgpMpzc/P8Rej7emdF1PMyDVdb8EYjX16XvWwoJGvp4wWKuWhjmdrJssM1+1WjKqVbKhd3Sgeu7YWKPN7mTFFgeb+d0RVlBqYypCslolMYdTZnb675r2Ldj9AyMdGrXEjuQUq59feyw7Na80XqeRdhPIk9WStG/LtN5HJUkqexiUo8nPQJ0Buv8riS1u/r/AoAcHhg4i/N1VbJE7zPz2iHd2vlnva1TrwlsYWGSggUUEGll0KyPrGOLNBAo1BGIcADHAXGJ1sLMmOzNqVaylj47h19TTJvb17hy2L7uIZeWbmcnusGjVqn107l8jrwj+ddaomB8I2AVNfkWb+Q1edkAPW5QQYjNJXcx2eWL7EOOYWTfG+rRradBaSPomZRczktCsQ6g389JBcDPmJFFNmGWkUlS5NBi0RCCXqY1oRacR0O3sVLGN5ZfYSGKXsN+PnuEAnzGq/ZnR3YKOUfMfzA726Y0r0jI33xttbuZr3yRv/7IBGhJZVpUMUTNpYpHFPjLU36C7KsJXuqtvOItuaeRAFJIXUrc2dALcDFQSHHhgzprt7DQBPNhPx/wNGuZkzLY+Mff4wg3pX+o18lJVcGiqAuymhetaBzTpyIYvd50c8eqGlLsdsnNMmwCDvn9sIOvbLoB1C/flagKEL6nDF3RU1vx8D4E4R7QrJVXl/S2ZbENSnt1kk09p1GwR6d/fbH2qT/IFDUZp3GBn4AJhVf19WGS5s+RkUw+dKL75zZ/TWsQEeTFiLFhHUin0GhXXf6sCoftAAHgHVA/6YHOQ3kyf6UFxdQ4prFGpuLqipeuqyn85n6RHH9C/fzl4mv166DRLzCxidlneTZvND/y0Xp9vnNa9pMGulDKwGs1ArQB68PObNNf2irr33gFtHvfXq7ti8wZWwluvYT56daVAFnowRgk2A0ArIUYj96yVZeSb2IlCC6kLVlZEaoPJ5uQqBB4KYi6YF12zhZeWBXhpWIifngV6a1kr2hxCtQik77FLrEoP52oJPQgn6foA9Ve0kaS+CsZ0D/52+pj2C/WSdKBGM6c0apAzcEmABo88fPGOYJNJfkmtUt00e0y7VqDScHi+7sXdCz0Xr//TtHkDgJNo4/Znxll24EQx0XRl9DEouqoObBwhsCHBAVxsKNtwhsTAwgMMrEOIF+vWxo+1IeYED0tlbwUVSXmcfzS3lAObAM0iWhr3U7ezDjO2roskWRvkiimDqnYGLhrQAPOg13f3MJtsCyWVakDPSF/tEyPasggCUWUAEkA+XWJlx/JMbHdaIYs/doYDCgfUCEjfC9Wtca5gRqBy4IDExn8diPob2TWIdQ3z4dIdh/vYxFvCTA8XfsdvViJJ3tyUtmDDvpIPts244oyCn8Y1AxcFaA7meTuHOJj8FhkxOkO6TegbxvyM2nPoNgHkPFIfdqYWst+S89ku+ltMqgT034sFcVXTDMkNTR3YBuFh0Kq5Dn/L1aEktX052+EJbHEtsC4b9uex1zamYdP4rrcXm/vLE31ONq4lbd6jvWBAA8z3f5Z009604ndb+mpDJvVvI43qFsRVDE/JDICY6ZXPN2H031+ZZxlUDWzmqlMpanNJBMBxzasi/dktPUPZFQRsPwI2dH33Qxho/vdbJttOHLZGrVqp1snTN0/um1abY1Kudflm4IIBbbXLEw7lFC/+fMfxFsPjWrJBHQIr3fTBHH3geDFbnnCcqxfY3NUlkCubMqvDSbShmg2lcd98ZQjr3NqnwtgBfmwYsRld9ns2W7c3l0AtrVHp5P8ooL58IKzNK18QoIniGksC9x21LIdCF27hratUxQAjsTYxl63ceYKRcxEfrzCi1ObgL+Za0LdBBUaRcef2/2vN8HbB2NxlNTaMUIk+3p7NVu4+aXM4HD/dcVXrh58cHZN+MX0q59TdDNQI0EJnfnJU289HxLUKwfAqUzHw3SmSbktJuv2YlMc3azjqSr2o6bRhWDbyiIK0HtG5Fbv3mnBO+3luGMnCyT7als2ST5awySNilnYO85qi+IPUdJbrp12NAH33x/t7Hcwo+CQ2xLvjjFHtuO+Fu6+FuMhhWvi3fkln+48XNTgQVza9eODwsMWR6jF1ZDSDIcjzvvC2gboU4m9w0DMwt1DDFgRLUnH9LJfS6/lm4LyAHjw/oY1Dlj4jM3G/hwZHam4k3bMyMP9BPPLrG1O5UUSnFra783XfMH4HsKGCTPlHNOse4VepGgXpDcH+Z0bRIwHt/D9WeOqGsXaeo6gW0IOXphrMJ07Op4V8aHyvUO2DgyMrXez4lAK2+Oc0lnXG7OJ7G+btVj0qMB6t/fUc1H1jAs5hQKBnf/1HDvs4PivrbKl82+8zeiUoftYNb5WrBXS/uQkTyFHird5t/fxnXt+eeZNFznPzBAZj3vfHuKlaGC8a3m2ef0RCr4alcdq1MaxXW/8KoAZrQ05N7E1SqUxWeavOIN+mcNTnn9e6blEloNftze+6ZGvaKqfs7DBvXEfWjvRLT56ZrHzy82uSpcaoZlQ10aD2YoO9yYe68r3Cu5sz2Oo/T9pJrX7DaDM9o4R61TVkq++vUkDnyrKPj8354rHc0iesdqcES5vwMxYMB9iMGd8cYUdoI9hQKLnamFro01A/+pNPylRSP9zZD0xWISF5+qrD7PCJ0kziem7f/kzv+NroV7lG7czAOYAGRUcc7GCjTrPa7nD6ohtPOgsLvpA2gHgFNzRKrjamBeoHJPX43mHsX/3bMF25HwiuDY76tyP57OX1x8B+fG/Q+N6l+HxUnHVgCN8gANr9l3dmD1Z1pikU341cmOj63drKz8HS0+yX+sY7B9CINJl3a+SHHUOMN/uS+6enmoET1pAF7T169ZptjiYJaP4QlwchYJNI4VsV5gEP9KKf0lh2gaVoQt/wqde0D1hS1YNUk8Ulf1XnI8vSVLpTZysAANdc/uQVUhDZpfB5xeYTmncTTjn0xlKdZ3//6h7puHNwaz2+TythjnuXJBjw2WmTyJ+2/JBlzY1XRzgeGxZuxDdHckp1CzamSUezi139aiTGf4tt7SMtvqNzmeMLHZO/TvI6kF3M8SJJKt6P0y5rAsi49sHdXdUtvFW8n7d+JpVsbw7/XZIlBHzy7wlL6lfGdXR0CfP1xr/X7cv1WvBDKgUR8WAPPU13AZm3snSS6thTo2JzR1/RIutiOP9zAb1gx/UaSV7xwMBIH/g92MmqJg5IJ8Tqkd7M0ikotTFvAl03Vc0HqB/wt6aFcIWNieaFJhs7U2pnmWcsqTtSCt6PP1Z4PCJQr3nrzs52m9PBwTTj28PqXSnEXIvF5R+YFov7/oQuttYBRv4G/O/mdNXnO3NcIMUCi37m3BRrHNQxkANuy+F8x7OrkvVO5vT6e9gy//zwkChpfJ9wfo2krELV5C8Oq002B++bYiFc1762a5CaUkTwf1PspXz/siTd8UITb6dVqV3g7xTupVowLk7tY9SwYgpInrs+WdqWXCjrtSoXyHEOeVeq59/aQW7tZ9CSJdmxbFu25otd2eTmoOJjpjc4l8jeerV62ogYuWeMvwqY2nrktHrRL+myHt5pdMBTspD6gWo7Y3T71Gva+e/RatRbNiad2XR998Ckapapwk8VAP2PV/d6F1hK1rT01Q2ZfX176cqovzlZNISj/eJf0riPQ1MHs5glgHpop5bsOWJ5KjOPw1dlXWKuyWyTS7qE+ejnj+1k8zaotCVmp23uD8eMO1LzHZ6LG+yr079wUwcbgYEv7hc7j6tX7DzO/brd9yr49yNDotjVtA54KyQQPbpkayYjUPHhlWMB/ibs+iuCuKusg66HCPiPtmVxS61QCcvccxnrSmFwY8nzEAHG2A+sIiqygB5M0S/8bXCAwryevCi1dB6MSwg4zqRoeqF+wdQAAedDb3HsNxDIAV+v5NwS7hKsJ1Ev0k7gejgPezEEYGAeEeuZTjYLcQ9Q8c6SkKBcLKx3tD/fu6jVKsecdUcTN+4//ZvBKL9RE3+aCoDuT9KZMlgsHRgb0MpzAdEQfDOlHqgwUTV9chprO4DClzzzsEGEU5P7Gwv3BLoSwQklZCbHIgwgZy1skgHAxKwilsPpzL+9CwEcIwGVwM9pUIAgh5KUgMOHQYqkaQWghgXo8brmIEBED9xwxSZcgBB/AShBq6JvjIde2Xzay+OG+Wf0IUDJqUoCkjgAUAEIgNHdN118j2h7fk23BXUPfcM1MD7h9uC+7njYRDwpruL+8FZoV+4FiSimWd8ls90ZRTaawmQa7zxd65CvqgtsdgGa+2ss2PEddTJq4a2dNF3JxdLdIohIkudXH2W70wubFKtRkwcNAOkdHcDo9e8KBBDnYQKxyFhgQMN9zrCwPDLGLR5SnIfFFRL/fItbVbu/oUg6v0e8ZlV8bGXBFzWZg/pogwcFuNt0KJ+Rdyc7XWovdDjYB1qV1ytVbcRd9z3wtV1XmkzWr3u1DYh56eYO5Bj/9zOIRtvolTN7dfMMjgag/UmXfHxYFAX9Bp1jRayPxW5OfQJ/UKPeJqMWBCoJ3f892idqxvghYac858EF6Dnrjj398/68l6ZdG60Z2qlVhdcNnpQnvzrEo6QvJkSqsU++oPGGk2fe02RFRCqGxiTpGvv8Y/x420Hdgp96Swqvm9g//H29WjXdkwnhgIYhxdvqWPZH+tlxca29XTqbuBB9z2atPsK9zpoi71yTBYeUps0cm04WRE+zeE3OV9pc2gxAqEB9h14NcOs0aihtb6ZqVdPdHcU4oK2y3J1EzhrJKUd65rbABmIuGRG+35fLR9RcAY0JBe8+aWAEu++aNnwuFCl9aSC9mLOFSoF94+lSa/5H248/Ont0uxXiWvz3lNOWW6Ja6L7yDPnHhga7dDAbFHbV6NxCL2bCqjsH9FVPclqCn0co0VrV5d+r7b6V6/09A4JCnvLlQcogULpHq2OjhKOYBO45wEd+oVsbn6l39wuvsFAQ7chZ8RqZuUF6NyWfjYsBCNgKRJFj06yoHRczg7V7zicUIrd0ezYlDpde3fFMn9m4ugQH/mKrc2WPCN9+z4xux5DWVkgePAmIq3t/SwbnTpWDjEukwyH/yG09WysqRz0D4gxl53rii4Pg8feoZHbj5qf7ZEkDFyTEllocOykHXQBepSJgFGBGTB18Fn7Yl6cAunzxoHYgXx9AXZmvSz2vcbPqHvu9b/bksHc3Z5oop/1T8TP6vS31m7ujLyWM2XJX77KIFGEJg/6cklfK5qw9Cj2l2asbAilgO+AbDrXD/W3WrJDUQG5W8NMPL9/PSszyJ15tQh6Q+syN/zfxqu8+OjRKc0OPYBegIan/pMQwk0mkC8+zBnIf9ToM6NHkm8HeGt+Z5/XwTFZTr4NrZp0D0PBHWfBjCuVJtP/RLaLFeKnPS/EvB/nqnpx2XbQOOZyFhEbjLeT3O4Oc2RX9uSJS4FPxxh1xrB855ShMR/0+RRC2UAPJCyafnJnGSySul5LzzD33D4qsEMYP/QSpZt/ZlN5sPOtqujTYGCLu8MYeIc3SclrTearLdpS2DWnE75UKSuwbyX93BJKuuHs/UegV+5BcEOEU0lxcRWu6AJAI91EkCzn3K3uLmk7aZWwHtQ91dchB6ynJZpd3UQblnp6vTnO57zPVJGn2BhXPtQCgx14VyihPieLXcRmBWpNLQzXOJNfbF4m80GjYTCk93/wHudJe5U+pcN0PZAmd90MKRRbkK1LIY2YBaKgbDw+JPCe1Q00WQWlTezMANo5KoLCJHyYyvU7zokTE9B9U2uGq6aQTuvsmANBzKd/GtmRKK+vuIV57Y2m0VwKgEc3x2NAoBdD1vIqQ0Pspy+0DnyYhcGG61Ovl7btCfHU9v3zwynMk9AtrjrJdaQXN1iGpqrUCoJG19PFhbXmkiOKkVL+ohhYxa80xm0pyTnEBevmk7hWiMaBDQ0IrKse5iwWW42bSoRWVo36BjN7Bxn1GcZ0fbsvO0elU/5YGzNuxxceoHvDpfVdI7tIGLAeckn46cEqR0B7rBkCjgOi/yZUUQaSKhK4/YAOnU788xPZmFSUZdaqx0sD5Casp3OqG/07oysLIJVIsDpD/AUUYf7X7hALoSgD9APH29xB1pxhW6g/MQkJDi9iVenb9rBvajZH6vRK/hKTMPfNv6aQhj7sKtbO/+ZMMK7+mK4CuhOVAFDgKESmm7/oFNHonV4SirHzTnLZBXq9K9y7b+2ywj/HZ8b1DjR2pDJr76xO5GJ777ogCaLc1Ez7R0yhBOrL/K4CuP0Bj7sFyUEKaFPJuHkjxhdkSolX89Kq3yPwd6k7PCcIa/F5zDIytapkwiSjo+fR1MexKSo6uALp+AA2srie35lNUw2dIXNACcyv9c4gtlEQ8IZkNIz31QThQP/b5AXaiwKKAunzdQNn1ICA/f0N7FkRpwhQduu4BDWNKBqU1QFoNytSU0iMi8LolE+OOYCQSIr7lYls8VVPtivBwd38OUHdv/ERZRvefUowrboBGOoMXboxVwFz3WOYqBiK/UTFiw4F8G3FMjxis5qUiaykPkn1h9dF1mWdMo1E4J5pqjQg9Gq55P1DK3FeIj1YclMpKMMMXetKANuyffcIZKCPlqNsZAPv2SXw2555tdumTAIPx4Y3TupeIUXBA95sbP0WnlV54bGhbH3cnf/yIaJWHKCIAOdCaawoDMVkANKWPlReM6yh5VgKr22Vtnr0BzEt/z2Jf786xk5Te6KNTP4A4QvfZ4IBGGjCzyf790LjA0JcptEhIHvxYQBkh565PoUSNZ5q91x3eWJ0pySKiVZSjbmZA5OGA1oD5X7nrBGpHbpVU8qStT/U5Jzcdb48k51Zn8caYVsaelKixwmYHF6F0sbwwUHOPXIGEnjwimt1AjkmKdfDyAVokwEQPPMUu7eUCKA0vZUuiXD+O9e/9nDG1qqq+HNCDn9+kMemMzwUY1U+Tj69+NOUa9gyWRSgWUsc2V887gBnpct/+ZxeeEkw5Kp8B96yn7g+9+/ciJa9LlStPn4s2ICVAhaLeesopE2XsKqPmSJBktA/2/linYa9Xl9mf98NT6b6+u0dRsWXrmO7BPs9QOgP3FK6gqpZRfo6PSX9prlIaczCREvHcQ2nAavpQu78uz9Hzyr+oanHxs1jgyqAjUraJnG+cnXJHTflJlabtRbvyBRbb2srS8bqTA+4pgd1zRwN8groELt3bIQpK2DDgjow5xEEVefkARHGIAMrsCtIBAa/7KKc2ClHtzy5mf1GQNp1ToGLqNfcPDPtw0qDIrecTJK4p+HzT8VbJZ0uXXRMbMLoPFZ50L+guIsCR0gDF6Gu6oOfrvLH8jkUL9Kl+M+iZPLxc6LiSw2PBxOIiyNZOq+pqU77AmA+8WgFOLEw+2QHK2pZBC8ARoIFxBxn+0Q4VybLOWHgbBNYB7DiwF6Jy1vyNIvZDeymDLCoxiANt0S66lRe7gnKC47nA73BKO0vZsvg1xfWIGECJjuvIdRZOWfga7hHZ1Ldog78YA8A8sV8YC6DAETVVBfh2z0m2I7WA34PIsS7awq+8PY0zicCMcidZBWYLsUn7KLv2Jr1K+tGgMexwZzKqw40L0CSl1Q7GbpQd8ipP6xca4bt3NmVwZyVkgW8u1kORpHEiSWZUxBIPOhYDfCiy5uM7fKbdN22i/wYB2oAdQjHPO3q15lIIIFi2PYuzRwKkWGC09SLf6v9QDmqoNlpqi1RXW5PzXeof2kAC4hrPUpYruCoA/Bv257GPfs+222xyBR6x2GpXIT3FmO4hZvRF+QlNz6464l1ktVndQVFsdtipTIWTCiTxpOB5RRbnlJWHTZTX0FXrhSS9iTCg7Rrh7UDtFT8vjZV6sz9ODNiezEKb63qSxD+T55v100k9WJgflYShY876o+rvE/NM+ExD5uPh9y/L5kV3drH0ivY/k5lvObXgx2OHDmYVpzO1nKkKCsmsLlt/ZcCu8JIiUIeb7fIqev30RmN30MI6gycIPtJNqdBmdU87fkPtD0gvlOgQVB0m7TjtJxD6E01JZ6hWCisyOYofXL7/OC/AQzh2X+Au4b6W+bd01AcatTS9soNoUA3NJRep7otLXo/FS+/rpqX++Plz1hxTr6X6LbwdU5U9AeXHy+NiLQM6BHCwrE88Vfzqj6lawjq/piTL/HxZJdknD492jLs6mD9l9Dp3PPrZ/rLfJJmDmrRNfs5NFFJGgOZAo3I/JQ99liS7Vb3ibVUOVorqWItu78D71Rg0tgc+OWBFFS2NXuUCKbPb+ee1/+lT9nTTseSXVOu6IyfL8GaVXN+r9cxWXsHLnkdykyp+lVxKyWlPQKuzC2wTPkvIWhoZaGA3UaF6N3WLl1f48LdM9ikR2/wGm7iYFkV3Jg2IYOP7hFWwDEL1Okm1UXBEt/RK9jKoXn1oxeG95ywu/d6xlU/J23d30pgtZUB/cuUhKTm/oExKui0u/rn0kd6uxY7fdcL+4d4MtcXkVUGiot0307u5HhoCgX3IsjSBHYZ6f+Ifm2YPFqqw81KA8vfFG/anc7YRC9enRH2xJ+fzqJaGfi+SebcDvdaECoLGUNxhQ0ehHFQwaqqYhqoBXRC1VWaNaV8h1ErQSvz9rJL20xzMolSWqwkwpLUpR33OQCX7YlgOEyaYbPZ37+gV5vPgoIgKoVkoIQYwY4OIzUhTldKCpps7tiPrROXIbLQlFw/vWXqooTf7emkz6M9kBcz1CeGKfVcKaBhaJFXpe7Rot0M69SXWw5NThOve6xSi1ZSPGaNi2PC4VpVGw5dYnEX3D4x4WR/p+4Z7SYSmPB+N4d4qBTQGPvCVHUNNDvuS2GDvGFRS9TQmgOoBN43MSqB6moqkFjwqsiJ5ZkbCHgIsz5ItmWBUV6mDQ+650F14YwBFYx5jlYAGjXffx4nTDx4vffbRoZHGWyjK2VNKw8/jLSq19fPB000C1IISQxKZB0jVEoUsuapMYKay0PIz3xyW8kvsB9Qq+ZatT/c92JgXvymOvUpA42ZRrmJMD9+V4/u2GQ0S3/PAIsNE+QYlRUegYmOW1AAzNr/DSMV4lDIiuTvvC+PFS1Q8aXdaYUGwn/Hx7/9z1adNERCN/Z6qBTRuziLLnSnd/5cOu7MLSHzPKlmisNCbVAMcWZYaI6iFZB5OpY+Rr84TzKhk8N/NmdxJS5KluYbw0DmKqtEwoX9eQGPYZAwYe6LAvGTDvlOBV0b6cROpoPJAb8G0mXfWyt7bnM6LDMFw21joPEHPQc24r384a+Gt4wXgxfgxQTaS3N9S6YMlv2WtlJ1eD1VVlrdhLnHzGlWNAA19+sHlB+7em3n2na5hPkYEiEZSZIt7PB0kdTHRWcspkmDVHznc5NvQgY2HEubou2kDCCOSLznJeMYIcgchyj1MGN/8zubsh6cOb8Nj15SjYc5AjQCNoQ9emmqwnsh5mHb3L1H+DiPyUniCWkizLYdPs//9lsXdTXE0NGcmoWLAwYeoN3YNZeJ3d8bCfcBfAs40scFerKWvfodaIz1A+VkTm4O1rWFCtWajqjGgBahNJ07OoMDEaVRC2fjE8Lbckuh54KIoNv4RJUzfkVLA4DqoJbWkvqk9AWRscFFAE0nL3WMocR/CEWvt3lyeOap7hN+eBbd3ekQnSQk1m1KlVX3OwAUBWoBaf+bUlCKr46nIFnr/hbfGsZY+FXNLox1UEIok55QeNlPwc8Wmsj6kNYAMSx+ADKk8jjIeoTSbu1QWY4bahDAflOMoMju269TqJ7c/0zu+PhdJ6bvmM3DBgOagpggXi17/4PC4oJkPDY4IaUE+vOJCnlw1QIwM69vIDXJdYh5LJ8ldV0yIADLcXduR6tCfVIsxVOmLiiS5XDLFVAkPOjhfYWNLW4BfDVrpUYVrrjmYGkLLiwI0Bo4ol9R867hwf9182emMAbWFTWBl+ZIhrbGryiPOGioIXucANjaOwsm9tkAu+GT0508PWrdwX1Iv/Fj/2EAWQR6E7hEc7gtQSEaimd8ms33HS2yyg63w0rFnPSOKG8KCKWOofgYuGtAC1OTD2Lu01PHiR79njoDT0iNDoljXcJ9zXudCPwWATTYHz7r+M0VFINym0OyQC0qsEoIhAX6R7OZ8IBc6Mf6CfkMcpB8xFdDru1Piya4EZmzqEGUBB97qshwhqc57WzLytxzKf63Eon9PoeYa56NzSYAWoE4rYSF3LN4xhaT2BG+9KvTWnqHs2q5BPD0vb1PJ3KBjRGVQdARLovgxADsj38wKKOwIFY3wF6nIqKgRV1E8DzwYFBXBwRpK/SAqpD2BF6oFIj7ge8IjRCoBMi6HMCNUykWUSLsgbzN9l2S22Z8a80VWvGI0aZxgFkKzVkYPvdru5XWt5GTTrE65b1SgXnszcbsoTkklL6oM+y/jecsQC/BCLaFYNplcNCUkFi+mmDo4QiFyBP7XkN5eBGQ/ilXzJ2mMjR7i1wBu+F7gd4C4sqBPBKRio0oPjkxORhLi5oZ3DjpJXnWfUzXd1+i0HMWnuVbgUG8XuWQJ7TnyYYsSQkwm+R5iFe4ifborYt8GdQjklkWwCtW9+jEYgI47zrsdnuZ293YCvFW9CcreIoxTh9Dbwbr8SOnNLA65UCOxLcwpLd46o/ev9bYCSse1OgO1DmgxuoHz4+PahXiNXTA2bmKAtzbG4XCqt1G+aTAiiM2DtOCXEToAAAISSURBVBWqRG0mbeESv/zC7qH+q/86yT0DSdIXkFTfSvFIX3hJhjU1jSau1VlXLnbZZuCyARojhhqyYfbgDqSGDCN9+P7JKw6Gnyq2tAgnLnhIx0B2dZQ/+U5ouapAJbn4TQrpyyWroEDwuYopcAG4/E5KSUWBLg6dHMYTqDuQ+hQZfXLe9ylrJRX7QXJ6b1I2fZcNU/V64csKaHFn+2VZt3fzCb93dqYPpEwSE0kdbi9LLJyik/1jKGoafhTC0IFkJEgFAMsidGOKhObMB4d7+Wh5bgr6H/4JuvAYBUYjEj2L+O7sAjPPZ516ipJMkufcbb3Cf6Eo5vVHckq3TVl+9IAikesVb5e98zoBtPtdgL8esighymxiIwinvYhqi3loaFS723uGhlHyEm0iWRSXJ2TzZCS+BjVnQqCeiAPcNeg4yvDEdfIDlEpgEeUKTskttZNebKP8LYVE423TatiW2DD/nS+M65zR1pvlKZu9y46lBtFBnQPa866xiVx8e7fITqFeEYThqC0H8+PmrE0OMdudYQT+QNrQBZIurCFxXGZfJyv29d1DSmZe376EpHZ+ap4pY+Z3R1IzzpgOkyxP0hmdJ+xm70KN5XSRSILdIGZaGUSdzEC9A9rzLgnEhuGLd/hTCgGj0yZpiaLQuNpIZQlKbugSbJ06KtpO/LeDpK955MJEm7Uk36IAuE4w06A7+X+FavbdRVyCEAAAAABJRU5ErkJggg==) no-repeat;"><i style="display: inline-block;vertical-align: middle;width: 86px;line-height: 86px;text-align: center;font-size: 40px;color: #FFF;font-family: 'cmsicon';"><%= zcTypeIcon[i] %></i><span style="line-height: 86px;margin-left: 6px;font-size: 18px;color: #3B87C7;"><%= zcType[i] %></span></div>
+ <% } %>
+ </div>
+ </div>
+
+ <div class="cBar she_qi" style="margin-top: 56px;">
+ <h3 class="c_title" style="text-align: center;background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABK0AAAACCAYAAACaPC/6AAAA9klEQVRoQ+2XMQoCMRBFN6vibRR7QRsPIYo3cK+gJxBBa5tFT2G7lYLgAWw8hxtJEdxNk2kMCbwtwy8m8/e/yahBcd5kztfJs9djvyjt8Wh9mXyUnrq6fjc/3XbztzlPUWPqltw/Nk2KvZbUjB9x5Qw/8MM3GyRslGQ/RQ35IB/ko92B5puQfJAP8kE+mh2IeWeEV/AKXsXPKzUsSu0apbW+Pg+rmT03i4nK6q2r69VqfD8uKxv21DSmbsn9Y9Pgh/+fDekZfuBHCDbCq7jmEH7gh+/tJJlDzA/mB/Pj1wH2j/b+JWFISA28glfwCl7ZDri8/jeLvsjV9/igSBApAAAAAElFTkSuQmCC) center repeat-x;"><span style="display: inline-block;font-size: 36px;color: #32638C;font-weight: bold;background: #FFF;padding: 0 30px;line-height: 44px;">政策关键词</span></h3>
+ <div class="keywords" style="text-align: center;margin-top: 46px;">
+ <% var zcKey = she_qi_items.zc_key.split(','); %>
+ <% for (var i = 0; i < zcKey.length; i++) { %>
+ <% if (i % 2 == 0) { %>
+ <span style="display: inline-block;vertical-align: middle;line-height: 48px;background: #BDDCF4;padding: 0 45px;font-size: 18px;color: #32638C;margin: 10px 4px 0;">{{zcKey[i]}}</span>
+ <% } else { %>
+ <span class="dBlue" style="display: inline-block;vertical-align: middle;line-height: 48px;background: #3B87C7;padding: 0 45px;font-size: 18px;color: #FFF;margin: 10px 4px 0;">{{zcKey[i]}}</span>
+ <% } %>
+ <% } %>
+ </div>
+ </div>
+
+ <div class="cBar she_qi" style="margin-top: 56px;">
+ <h3 class="c_title" style="text-align: center;background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABK0AAAACCAYAAACaPC/6AAAA9klEQVRoQ+2XMQoCMRBFN6vibRR7QRsPIYo3cK+gJxBBa5tFT2G7lYLgAWw8hxtJEdxNk2kMCbwtwy8m8/e/yahBcd5kztfJs9djvyjt8Wh9mXyUnrq6fjc/3XbztzlPUWPqltw/Nk2KvZbUjB9x5Qw/8MM3GyRslGQ/RQ35IB/ko92B5puQfJAP8kE+mh2IeWeEV/AKXsXPKzUsSu0apbW+Pg+rmT03i4nK6q2r69VqfD8uKxv21DSmbsn9Y9Pgh/+fDekZfuBHCDbCq7jmEH7gh+/tJJlDzA/mB/Pj1wH2j/b+JWFISA28glfwCl7ZDri8/jeLvsjV9/igSBApAAAAAElFTkSuQmCC) center repeat-x;"><span style="display: inline-block;font-size: 36px;color: #32638C;font-weight: bold;background: #FFF;padding: 0 30px;line-height: 44px;">适用群体</span></h3>
+ <div class="zc-user-item" style="display: flex;flex-direction: column;align-items: center;margin-top: 3em;">
+ <div class="zc-user-item_content zc-company-content" style="position: relative;padding: 12px 12px 12px 6em;box-sizing: border-box;line-height: 20px;background: #f7fafd;border: 1px dotted #3b87c7;width: 92%;">
+ <i class="zc-user-item_icon" style="position: absolute;left: -18px;margin-top: -22px;display: inline-block;line-height: 44px;font-size: 22px;color: #3b87c7;text-align: center;background: #bddcf4;padding: 0 0.5em;">企业类型</i>
+ <% var cType = she_qi_items.company_type_text.split(','); %>
+ {{each cType}}
+ <span style="color: #666;font-size: 18px;margin-left: 2em;font-weight: bold;line-height: 2em;">{{$value}}</span>
+ {{/each}}
+ </div>
+ </div>
+ <div class="zc-user-item" style="display: flex;flex-direction: column;align-items: center;margin-top: 3em;">
+ <div class="zc-user-item_content zc-company-content" style="position: relative;padding: 12px 12px 12px 6em;box-sizing: border-box;line-height: 20px;background: #f7fafd;border: 1px dotted #3b87c7;width: 92%;">
+ <i class="zc-user-item_icon" style="position: absolute;left: -18px;margin-top: -22px;display: inline-block;line-height: 44px;font-size: 22px;color: #3b87c7;text-align: center;background: #bddcf4;padding: 0 0.5em;">行业</i>
+ <% var iType = she_qi_items.industry_text.split(','); %>
+ {{each iType}}
+ <span style="color: #666;font-size: 18px;margin-left: 2em;font-weight: bold;line-height: 2em;">{{$value}}</span>
+ {{/each}}
+ </div>
+ </div>
+ <div class="zc-user-item" style="display: flex;flex-direction: column;align-items: center;margin-top: 3em;">
+ <div class="zc-user-item_content zc-company-content" style="position: relative;padding: 12px 12px 12px 6em;box-sizing: border-box;line-height: 20px;background: #f7fafd;border: 1px dotted #3b87c7;width: 92%;">
+ <i class="zc-user-item_icon" style="position: absolute;left: -18px;margin-top: -22px;display: inline-block;line-height: 44px;font-size: 22px;color: #3b87c7;text-align: center;background: #bddcf4;padding: 0 0.5em;">企业规模</i>
+ <% var cScale = she_qi_items.scale_text.split(','); %>
+ {{each cScale}}
+ <span style="color: #666;font-size: 18px;margin-left: 2em;font-weight: bold;line-height: 2em;">{{$value}}</span>
+ {{/each}}
+ </div>
+ </div>
+ </div>
+ {{/if}}
+
+ <!-- 解读 -->
+ {{if jie_du_items.length}}
+ <div class="interpret">
+ {{each jie_du_items}}
+ <div class="iBar" style="position: relative;padding: 0px 15px 40px;border: 2px dashed #2F6EA3;margin: 80px auto 0;">
+ <h3 class="i_title" style="text-align: center;font-size: 36px;color: #32638C;">{{$value.jd_title}}</h3>
+ <div class="compare">
+ <div class="commonText"style="border: 4px solid #3B87C7;background: #3B87C7;">
+ <div class="iNShow qaWhite" style="padding: 20px;color: #FFFFFF;">
+ <p style="font-size: 16px;line-height: 32px;text-indent: 2em;">{{@ $value.jd_content}}</p>
+ </div>
+ </div>
+ </div>
+ {{if $value.attach_items.length}}
+ <div class="iList">
+ {{each $value.attach_items}}
+ <img style="width: 100%;margin-top: 24px;" src="{{$value.file_url}}">
+ {{/each}}
+ </div>
+ {{/if}}
+ </div>
+ {{/each}}
+ </div>
+ {{/if}}
+
+ <!-- 一问一答 -->
+ {{if wen_da_items.length}}
+ <div class="qAnda">
+ <div class="swiper-container qaSwiper">
+ <div class="swiper-wrapper">
+ {{each wen_da_items}}
+ <div class="swiper-slide">
+ <div class="qSlide qaWhite" style="margin-top: 2em;display: flex;flex-direction: column;align-items: center;">
+ <h3 style="margin: 0;padding: 1em;background: #3b87c7;color: #FFF;width: 100%;">问:{{$value.question}}</h3>
+ <div style="border: 1px solid #3b87c7;box-sizing: border-box;padding: 1em;background: #ebf3f9;width: 100%;">答:{{$value.answer}}</div>
+ </div>
+ </div>
+ {{/each}}
+ </div>
+ </div>
+ </div>
+ {{/if}}
+ </div>
+</div>
diff --git a/lib/v2/gov/huazhou/huazhou.js b/lib/v2/gov/huazhou/huazhou.js
new file mode 100644
index 00000000000000..80f18519e56128
--- /dev/null
+++ b/lib/v2/gov/huazhou/huazhou.js
@@ -0,0 +1,19 @@
+const { gdgov } = require('../general/general');
+
+module.exports = async (ctx) => {
+ const info = {
+ defaultPath: 'syzl/zcjd/',
+ list_element: '.list-content li a',
+ list_include: 'site',
+ title_element: 'h3',
+ title_match: '(.*)',
+ description_element: '.txt',
+ author_element: undefined,
+ author_match: undefined,
+ authorisme: '化州市人民政府网',
+ pubDate_element: '.article-date',
+ pubDate_match: '日期:(.*)',
+ pubDate_format: undefined,
+ };
+ await gdgov(info, ctx);
+};
diff --git a/lib/v2/gov/maintainer.js b/lib/v2/gov/maintainer.js
index 7ead7f607f03ff..1c1c2943cde2a0 100644
--- a/lib/v2/gov/maintainer.js
+++ b/lib/v2/gov/maintainer.js
@@ -45,13 +45,21 @@ module.exports = {
'/beijing/bphc/:channel': ['bigfei'],
'/beijing/jw/tzgg': ['nczitzk'],
'/beijing/kw/:channel': ['Fatpandac'],
- '/guangdong/tqyb/tfxtq': ['Fatpandac'],
+ '/dianbai/:path+': ['ShuiHuo'],
+ '/gaozhou/:path+': ['ShuiHuo'],
'/guangdong/tqyb/sncsyjxh': ['Fatpandac'],
+ '/guangdong/tqyb/tfxtq': ['Fatpandac'],
'/gz/xw/:category': ['drgnchan'],
'/gz/zwgk/:category': ['drgnchan'],
'/hebei/czt/xwdt/:category?': ['nczitzk'],
+ '/huazhou/:path+': ['ShuiHuo'],
'/huizhou/zwgk/:category?': ['Fatpandac'],
'/hunan/changsha/major-email': ['shansing'],
+ '/maoming/:path+': ['ShuiHuo'],
+ '/maonan/:category': ['ShuiHuo'],
+ '/mgs/:path+': ['ShuiHuo'],
+ '/mmht/:path+': ['ShuiHuo'],
+ '/sdb/:path+': ['ShuiHuo'],
'/shaanxi/kjt/:id?': ['nczitzk'],
'/shanghai/rsj/ksxm': ['Fatpandac'],
'/shanghai/wsjkw/yqtb': ['zcf0508'],
@@ -61,5 +69,6 @@ module.exports = {
'/shenzhen/zzb/:caty/:page?': ['zlasd'],
'/sichuan/deyang/govpulicinfo/:countyName': ['zytomorrow'],
'/taiyuan/rsj/:caty/:page?': ['2PoL'],
+ '/xinyi/:path+': ['ShuiHuo'],
'/xuzhou/hrss/:category?': ['nczitzk'],
};
diff --git a/lib/v2/gov/maoming/maoming.js b/lib/v2/gov/maoming/maoming.js
new file mode 100644
index 00000000000000..c8f78571d28eb4
--- /dev/null
+++ b/lib/v2/gov/maoming/maoming.js
@@ -0,0 +1,416 @@
+const { gdgov } = require('../general/general');
+
+module.exports = async (ctx) => {
+ const path = ctx.path.split('/').filter((item) => item !== '');
+ let pathstartat = 0;
+ let defaultPath = '';
+ let list_element = '';
+ let list_include = 'site';
+ let title_element = '';
+ let title_match = '(.*)';
+ let description_element = '';
+ let authorisme = '';
+ let pubDate_element = '';
+ let pubDate_match = '';
+ // let pubDate_format = undefined;
+ switch (path[1]) {
+ case 'www':
+ list_element = '.GsTL5 a';
+ authorisme = '茂名市人民政府网';
+ switch (path[2]) {
+ case undefined:
+ list_element = 'h1 a, #d11_li ul a[href*="content"], .two-o ul a[href*="content"], .thr-o ul a[href*="content"]';
+ break;
+ case 'jtysj':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市交通运输局';
+ break;
+ case 'mmtyjrswj':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市退役军人事务局';
+ break;
+ case 'mmsjj':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市审计局';
+ break;
+ case 'mmgyzc':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市人民政府国有资产监督管理委员会';
+ break;
+ case 'mmtjj':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市统计局';
+ break;
+ case 'mmylbzj':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市医疗保障局';
+ break;
+ case 'mmjrgzj':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市金融工作局';
+ break;
+ case 'xfj':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市信访局';
+ break;
+ case 'mmzfgjj':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市住房公积金管理中心';
+ break;
+ case 'mmgxhzs':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市供销合作联社';
+ break;
+ case 'mmdszbgs':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市地志办';
+ break;
+ case 'mmjjlyslgc':
+ pathstartat = 1;
+ defaultPath = 'gkmlpt/';
+ authorisme = '茂名市高州水库管理中心';
+ break;
+ case 'ywdt':
+ switch (path[3]) {
+ case undefined:
+ list_element = '#d11_li ul a[href*="content"], .two-o ul a[href*="content"]';
+ break;
+ }
+ break;
+ case 'zwgk':
+ switch (path[3]) {
+ case undefined:
+ list_element = '.er-zw-l ul a';
+ break;
+ case 'zcjd':
+ switch (path[4]) {
+ case undefined:
+ list_element = '.swiper-slide a, .bt a, .zcjdlist a';
+ break;
+ }
+ break;
+ }
+ break;
+ }
+ title_element = '#ScDetailTitle';
+ description_element = '#zoomcon';
+ pubDate_element = '.desc span:nth-child(2)';
+ pubDate_match = '日期:(.*)';
+ break;
+ // 不知道这种怎么做
+ // case 'rd':
+ // defaultPath = 'index.php?c=category&id=12';
+ // list_element = '.news_title ul li \a'';
+ // list_include = 'all';
+ // title_element = '.article_title';
+ // title_match = '(.*)';
+ // description_element = '.article_content > *:not(.article_)';
+ // authorisme = '茂名市人大网';
+ // pubDate_element = '.op_ span:nth-child(1)';
+ // pubDate_match = '发布时间:(.*)';
+ // break;
+ case 'fgj':
+ list_element = '.list a';
+ switch (path[2]) {
+ case undefined:
+ list_element = '.item a, .index-news-list a';
+ break;
+ case 'zwgk':
+ switch (path[3]) {
+ case undefined:
+ list_element = '.zw-news-list a';
+ break;
+ }
+ break;
+ }
+ title_element = '.title';
+ description_element = '.content';
+ authorisme = '茂名市发展和改革局';
+ pubDate_element = '.info';
+ pubDate_match = '发布时间:(.*)';
+ break;
+ case 'jxj':
+ if (path[2] === undefined) {
+ list_element = '.lanse_16, .hei_14, .NoticeInfo li a, #con_two_2 a, #con_two_3 a, .hei[href*="content"], .main2lr_main a';
+ } else {
+ list_element = '#main21l_main_dk > table > tbody > tr > td:nth-child(2) a';
+ }
+ title_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(2)';
+ description_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(4)';
+ authorisme = '茂名市工业和信息化局';
+ pubDate_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr > td';
+ pubDate_match = '发表时间:\n(.*)';
+ break;
+ case 'mmjyj':
+ list_element = '.news_title a';
+ if (path[3] === undefined) {
+ switch (path[2]) {
+ case undefined:
+ list_element = '.title0_ a, .content0 a';
+ break;
+ case 'xwzx':
+ list_element = '.news_title li a, .news_title_ li a';
+ break;
+ }
+ }
+ title_element = '.article_title';
+ description_element = '.article_body';
+ authorisme = '茂名市教育局';
+ pubDate_element = '.op_ span:nth-child(2)';
+ pubDate_match = '发布时间:(.*)';
+ break;
+ case 'kjj':
+ if (path[2] === undefined) {
+ list_element = '.hover-content-item ul li a[href*="kjj.maoming.gov.cn"][href*="content"]';
+ } else {
+ list_element = '.list-right-content a[href*="kjj.maoming.gov.cn"], .list-right-content a[href*="mp.weixin.qq.com"]';
+ }
+ list_include = 'all';
+ title_element = '.article-detail-title';
+ description_element = '.article-detail-content';
+ authorisme = '茂名市科学技术局';
+ pubDate_element = '.article-detail-time span:nth-child(2)';
+ pubDate_match = '发布时间:(.*)';
+ break;
+ case 'mmga':
+ if (path[3] === undefined) {
+ list_element = '.lnewsc a[href*="content"]';
+ } else {
+ list_element = '.new_list a';
+ }
+ title_element = '.top h2';
+ description_element = '.mid.text';
+ authorisme = '茂名市公安局';
+ pubDate_element = '.top td:nth-child(1)';
+ pubDate_match = '时间:(.*)';
+ break;
+ case 'smzj':
+ defaultPath = 'zwgk/xxgkml/zcjd/';
+ list_element = '.HK_List_ul_5 a';
+ title_element = '.HTitle';
+ description_element = '#mmhygs';
+ authorisme = '茂名市民政局';
+ pubDate_element = '.HTime';
+ pubDate_match = '日期:(.*)';
+ break;
+ case 'sfj':
+ if (path[2] === undefined) {
+ list_element = '.bothA a';
+ } else {
+ list_element = '.list a';
+ }
+ title_element = '.title';
+ description_element = '#context';
+ authorisme = '茂名市司法局';
+ pubDate_element = '.info span:nth-child(1)';
+ pubDate_match = '发布时间:(.*)';
+ break;
+ case 'czj':
+ if (path[2] === undefined) {
+ list_element = '.tabContent_item a[href*="content"]';
+ } else {
+ list_element = '.newsList_right .clearfix a';
+ }
+ title_element = '.newsContainer_title';
+ description_element = '.newsContainer_text';
+ authorisme = '茂名市财政局';
+ pubDate_element = '.time';
+ pubDate_match = '(.*)';
+ break;
+ case 'mmrs':
+ list_element = '.g-list a';
+ if (path[3] === undefined) {
+ switch (path[2]) {
+ case undefined:
+ list_element = '.news-box a, .new_list a, .news-box2 a[href*="content"]';
+ break;
+ case 'xwzx':
+ list_element = '.marqueetop ul li a, .special-clu ul li a, .soc-list ul li a';
+ break;
+ case 'zwxx':
+ list_element = '.marqueetop a, .gud-file ul li a, .dyn-box ul li a, .org-list a';
+ break;
+ }
+ }
+ title_element = '.pre-box h3';
+ description_element = '.pre-box .clearfix';
+ authorisme = '茂名市人力资源和社会保障局网站';
+ pubDate_element = '.pre-box > *:nth-child(3)';
+ pubDate_match = '发布时间:(.*) ';
+ break;
+ case 'zrzyj':
+ list_element = '.ul li a[href*="content"]';
+ title_element = 'header.title h1';
+ description_element = 'article.info';
+ authorisme = '茂名市自然资源局';
+ pubDate_element = 'header.title p span:nth-child(1)';
+ pubDate_match = '日期:(.*)';
+ break;
+ case 'sthjj':
+ if (path[3] === undefined) {
+ list_element = '.item-style1 ul li a[href*="content"], #notice-box ul li a';
+ } else {
+ list_element = '.pull-left';
+ }
+ title_element = '.article_top_l p';
+ title_match = '(.*)\n';
+ description_element = '.txt';
+ authorisme = '茂名市生态环境局';
+ pubDate_element = '.article_top_l > p > :nth-child(2)';
+ pubDate_match = '发布时间:(.*)';
+ break;
+ case 'jianshe':
+ defaultPath = 'xwdt/zcjd/';
+ list_element = '.listhref a';
+ title_element = '#showtitlediv';
+ description_element = '.aleft > *:nth-child(3)';
+ authorisme = '茂名市住房和城乡建设局';
+ pubDate_element = '#showtitlediv + table';
+ pubDate_match = '刊登时间:(.*),信息';
+ break;
+ case 'swj':
+ defaultPath = 'zcjd/';
+ list_element = '#lblListInfo a';
+ title_element = '.HTitle';
+ description_element = '#mmhygs';
+ authorisme = '茂名市水务局';
+ pubDate_element = '.HTime';
+ pubDate_match = '日期:(.*)';
+ break;
+ case 'mmny':
+ list_element = '.xw > a';
+ switch (path[2]) {
+ case undefined:
+ list_element = '.txt li a, .Tabcon ul li a';
+ break;
+ case 'zsq':
+ if (path[3] !== undefined) {
+ list_element = '.img a';
+ }
+ break;
+ }
+ title_element = '.bt';
+ title_match = '(.*)\n';
+ description_element = '.lien > table > tbody > tr:nth-child(4)';
+ authorisme = '茂名市农业农村局';
+ pubDate_element = '.lien > table > tbody > tr:nth-child(2)';
+ pubDate_match = '日期:(.*) 点击数';
+ break;
+ case 'lyj':
+ if (path[2] === undefined) {
+ list_element = '#main-slide .changeDiv a, .lycneter_all a[href*="content"]';
+ } else {
+ list_element = '.r_text a';
+ }
+ title_element = 'h3';
+ description_element = '.time_r + div';
+ authorisme = '茂名市林业局';
+ pubDate_element = '.time_r';
+ pubDate_match = '发布时间:(.*) 文章来源';
+ break;
+ case 'mmswj':
+ if (path[2] === undefined) {
+ list_element = 'div[id^="con_three_"] a, .pt6 a[href*="content"]';
+ } else {
+ list_element = '#main21l_main_dk > table a';
+ }
+ title_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(2)';
+ description_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(4)';
+ authorisme = '茂名市商务局';
+ pubDate_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(3)';
+ pubDate_match = '发表时间:(.*)';
+ break;
+ case 'wgxj':
+ defaultPath = 'zcfg/zcjd/';
+ list_element = '.com-news a';
+ title_element = '.text-title h2';
+ description_element = '.text-body';
+ authorisme = '茂名市文化广电旅游体育局';
+ pubDate_element = '.text-title p';
+ pubDate_match = '最后更新: (.*) 来源';
+ break;
+ case 'wsjkj':
+ if (path[2] === undefined) {
+ list_element = '.tbv_mn a';
+ } else {
+ list_element = '.news_list a';
+ }
+ title_element = 'h1.content_title';
+ description_element = '#zoomcon';
+ authorisme = '茂名市卫生健康局';
+ pubDate_element = '.desc span:nth-child(1)';
+ pubDate_match = '发布时间:(.*)';
+ break;
+ case 'scj':
+ if (path[2] === undefined) {
+ list_element = '.title_content a';
+ } else {
+ list_element = '.news_list > ul > li a';
+ }
+ title_element = '.subject_tit';
+ description_element = '#zoomcon';
+ authorisme = '茂名市市场监督管理局';
+ pubDate_element = '.subject_litle span:nth-child(1)';
+ pubDate_match = '发布时间:(.*)';
+ break;
+ case 'ajj':
+ if (path[2] === undefined) {
+ list_element = '.picList a, .title_content a[href*="content"]';
+ } else {
+ list_element = '.newslist ul li a';
+ }
+ title_element = '.opinion_result center p:nth-child(1)';
+ description_element = '.opinion_result_content';
+ authorisme = '茂名市应急管理局';
+ pubDate_element = '.opinion_result center p:nth-child(2) span:nth-child(1)';
+ pubDate_match = '发布时间:(.*)';
+ break;
+ case 'cgj':
+ if (path[2] === undefined) {
+ list_element = '#con_two_1 a[href*="cgj.maoming.gov.cn"], #con_two_1 a[href*="mp.weixin.qq.com"], .newshotkuan.pt9 .heibti[href*="cgj.maoming.gov.cn"], .newshotkuan.pt9 .heibti[href*="mp.weixin.qq.com"], .qkuan01.mt9 .heibti[href*="cgj.maoming.gov.cn"], .qkuan01.mt9 .heibti[href*="mp.weixin.qq.com"], #demo a[href*="cgj.maoming.gov.cn"], #demo a[href*="mp.weixin.qq.com"], .main3lr_main a[href*="cgj.maoming.gov.cn"], .main3lr_main a[href*="mp.weixin.qq.com"]';
+ } else {
+ list_element = '#main21l_main_dkc .hei[href*="cgj.maoming.gov.cn"], #main21l_main_dkc .hei[href*="mp.weixin.qq.com"]';
+ }
+ list_include = 'all';
+ title_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(2)';
+ description_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(4)';
+ authorisme = '茂名市城市管理和综合执法局';
+ pubDate_element = 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(3)';
+ pubDate_match = '发表时间:(.*)';
+ break;
+ case 'xzfw':
+ defaultPath = 'zcjd/';
+ list_element = '#lblListInfo a';
+ title_element = '.HTitle';
+ description_element = '#mmhygs';
+ authorisme = '茂名市政务服务网';
+ pubDate_element = '.HTime';
+ pubDate_match = '发布日期:(.*) 点击率';
+ break;
+ }
+ const info = {
+ pathstartat,
+ defaultPath,
+ list_element,
+ list_include,
+ title_element,
+ title_match,
+ description_element,
+ authorisme,
+ pubDate_element,
+ pubDate_match,
+ // pubDate_format,
+ };
+ await gdgov(info, ctx);
+};
diff --git a/lib/v2/gov/maonan/maonan.js b/lib/v2/gov/maonan/maonan.js
new file mode 100644
index 00000000000000..765c3cdd98df8f
--- /dev/null
+++ b/lib/v2/gov/maonan/maonan.js
@@ -0,0 +1,100 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const timezone = require('@/utils/timezone');
+
+const host = 'http://www.maonan.gov.cn';
+
+module.exports = async (ctx) => {
+ let id = '';
+ let name = '';
+
+ switch (ctx.params.category) {
+ case 'zwgk':
+ id = 'zwgk';
+ name = '政务公开';
+ break;
+ case 'zwxw':
+ id = 'zwxw';
+ name = '政务新闻';
+ break;
+ case 'mndt':
+ id = 'zwxw/mndt';
+ name = '茂南动态';
+ break;
+ case 'zdhy':
+ id = 'zwxw/zdhy';
+ name = '重大会议';
+ break;
+ case 'tzgg':
+ id = 'zwgk/tzgg';
+ name = '公告公示';
+ break;
+ case 'zlxx':
+ id = 'zwgk/zlxx';
+ name = '招录信息';
+ break;
+ case 'zcjd':
+ id = 'zwgk/zcjd';
+ name = '政策解读';
+ break;
+ }
+
+ const res = await got(`${host}/${id}/`);
+ const dataArray = res.data;
+ const $ = cheerio.load(dataArray);
+ const list = $('li.clearfix a[href*="www.maonan.gov.cn"], li.clearfix a[href*="mp.weixin.qq.com"]');
+
+ const items = await Promise.all(
+ list.map((i, item) => {
+ item = $(item);
+
+ const url = new URL(item.attr('href'));
+ const link = url.href;
+
+ const pubDate = timezone(parseDate($('a[href="' + link + '"] ~ .time').text()), +8);
+
+ return ctx.cache.tryGet(link, async () => {
+ // 获取网页
+ const { data: res } = await got(link);
+ const content = cheerio.load(res);
+
+ switch (url.host) {
+ case 'mp.weixin.qq.com':
+ return {
+ title: item.text(),
+ description: content('#js_content').html(),
+ pubDate,
+ link,
+ author: content('#js_name').text(),
+ };
+ case 'www.maonan.gov.cn':
+ switch (url.pathname) {
+ case '/zcjdpt':
+ return {
+ title: content('meta[name="ArticleTitle"]').attr('content'),
+ description: content('.wrap').html(),
+ pubDate,
+ link,
+ author: content('meta[name="ContentSource"]').attr('content') === '本网' ? '茂名市茂南区人民政府网' : content('meta[name="ContentSource"]').attr('content'),
+ };
+ default:
+ return {
+ title: content('.newsContainer_title').text(),
+ description: content('.newsContainer_text').html(),
+ pubDate,
+ link,
+ author: content('.author').text().trim() === '本网' ? '茂名市茂南区人民政府网' : content('.author').text().trim(),
+ };
+ }
+ }
+ });
+ })
+ );
+
+ ctx.state.data = {
+ title: `茂名市茂南区人民政府 - ${name}`,
+ link: `${host}/${id}`,
+ item: items,
+ };
+};
diff --git a/lib/v2/gov/mgs/mgs.js b/lib/v2/gov/mgs/mgs.js
new file mode 100644
index 00000000000000..3b538938c639e1
--- /dev/null
+++ b/lib/v2/gov/mgs/mgs.js
@@ -0,0 +1,19 @@
+const { gdgov } = require('../general/general');
+
+module.exports = async (ctx) => {
+ const info = {
+ defaultPath: 'zwgk/zcjd/',
+ list_element: '.list_con li a',
+ list_include: 'site',
+ title_element: '.title',
+ title_match: '(.*)',
+ description_element: '.artile_con',
+ author_element: undefined,
+ author_match: undefined,
+ authorisme: '广东茂名滨海新区政务网',
+ pubDate_element: '.note > span:nth-child(1)',
+ pubDate_match: '时间:(.*)',
+ pubDate_format: undefined,
+ };
+ await gdgov(info, ctx);
+};
diff --git a/lib/v2/gov/mmht/mmht.js b/lib/v2/gov/mmht/mmht.js
new file mode 100644
index 00000000000000..9b2adee5285b5a
--- /dev/null
+++ b/lib/v2/gov/mmht/mmht.js
@@ -0,0 +1,19 @@
+const { gdgov } = require('../general/general');
+
+module.exports = async (ctx) => {
+ const info = {
+ defaultPath: 'xwzx/zcjd/',
+ list_element: '#main21l_main_dk > table > tbody > tr > td:nth-child(2) a',
+ list_include: 'site',
+ title_element: 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(2)',
+ title_match: '(.*)',
+ description_element: 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(4)',
+ author_element: undefined,
+ author_match: undefined,
+ authorisme: '茂名市高新技术产业开发局政务网',
+ pubDate_element: 'td[background="/global/rlyelen_line04.gif"] > table:nth-child(1) > tbody > tr:nth-child(3) > td > table > tbody > tr > td',
+ pubDate_match: '发表时间:(.*) 信息来源',
+ pubDate_format: undefined,
+ };
+ await gdgov(info, ctx);
+};
diff --git a/lib/v2/gov/radar.js b/lib/v2/gov/radar.js
index d444c786fdbded..a6f61c4ed9005e 100644
--- a/lib/v2/gov/radar.js
+++ b/lib/v2/gov/radar.js
@@ -428,6 +428,28 @@ module.exports = {
},
],
},
+ 'dianbai.gov.cn': {
+ _name: '茂名市电白区人民政府',
+ www: [
+ {
+ title: '茂名市电白区人民政府',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-dian-bai-qu-ren-min-zheng-fu',
+ source: ['/*'],
+ target: (params, url) => `/gov/dianbai/${new URL(url).host.split('.dianbai.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
+ },
+ ],
+ },
+ 'gaozhou.gov.cn': {
+ _name: '高州市人民政府',
+ www: [
+ {
+ title: '高州市人民政府',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-gao-zhou-shi-ren-min-zheng-fu',
+ source: ['/*'],
+ target: (params, url) => `/gov/gaozhou/${new URL(url).host.split('.gaozhou.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
+ },
+ ],
+ },
'gz.gov.cn': {
_name: '广州市人民政府',
www: [
@@ -485,6 +507,17 @@ module.exports = {
},
],
},
+ 'huazhou.gov.cn': {
+ _name: '化州市人民政府',
+ www: [
+ {
+ title: '化州市人民政府',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-hua-zhou-shi-ren-min-zheng-fu',
+ source: ['/*'],
+ target: (params, url) => `/gov/huazhou/${new URL(url).host.split('.huazhou.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
+ },
+ ],
+ },
'huizhou.gov.cn': {
_name: '惠州市人民政府',
www: [
@@ -520,6 +553,64 @@ module.exports = {
},
],
},
+ 'maoming.gov.cn': {
+ _name: '茂名市人民政府门户网站',
+ '.': [
+ {
+ title: '茂名市人民政府',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-ren-min-zheng-fu-men-hu-wang-zhan',
+ source: ['/*'],
+ target: (params, url) => `/gov/maoming/${new URL(url).host.split('.maoming.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
+ },
+ ],
+ },
+ 'maonan.gov.cn': {
+ _name: '茂名市茂南区人民政府',
+ '.': [
+ {
+ title: '政务公开',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
+ source: ['/zwgk/*'],
+ target: '/gov/maonan/zwgk',
+ },
+ {
+ title: '政务新闻',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
+ source: ['/zwxw/*'],
+ target: '/gov/maonan/zwxw',
+ },
+ {
+ title: '茂南动态',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
+ source: ['/zwxw/mndt/*'],
+ target: '/gov/maonan/mndt',
+ },
+ {
+ title: '重大会议',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
+ source: ['/zwxw/zdhy/*'],
+ target: '/gov/maonan/zdhy',
+ },
+ {
+ title: '公告公示',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
+ source: ['/zwgk/tzgg/*'],
+ target: '/gov/maonan/tzgg',
+ },
+ {
+ title: '招录信息',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
+ source: ['/zwgk/zlxx/*'],
+ target: '/gov/maonan/zlxx',
+ },
+ {
+ title: '政策解读',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-mao-ming-shi-mao-nan-qu-ren-min-zheng-fu',
+ source: ['/zwgk/zcjd/*'],
+ target: '/gov/maonan/zcjd',
+ },
+ ],
+ },
'mee.gov.cn': {
_name: '生态环境部',
www: [
@@ -542,6 +633,17 @@ module.exports = {
},
],
},
+ 'mgs.gov.cn': {
+ _name: '广东茂名滨海新区政务网',
+ www: [
+ {
+ title: '广东茂名滨海新区政务网',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-guang-dong-mao-ming-bin-hai-xin-qu-zheng-wu-wang',
+ source: ['/*'],
+ target: (params, url) => `/gov/mgs/${new URL(url).host.split('.mgs.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
+ },
+ ],
+ },
'miit.gov.cn': {
_name: '工业和信息化部',
'.': [
@@ -559,6 +661,17 @@ module.exports = {
},
],
},
+ 'mmht.gov.cn': {
+ _name: '广东茂名高新技术产业开发区',
+ www: [
+ {
+ title: '茂名高新技术产业开发区政务网',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-guang-dong-mao-ming-gao-xin-ji-shu-chan-ye-kai-fa-qu',
+ source: ['/*'],
+ target: (params, url) => `/gov/mmht/${new URL(url).host.split('.mmht.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
+ },
+ ],
+ },
'moe.gov.cn': {
_name: '中华人民共和国教育部',
'.': [
@@ -705,6 +818,17 @@ module.exports = {
},
],
},
+ 'sdb.gov.cn': {
+ _name: '广东省茂名水东湾新城建设管理委员会',
+ www: [
+ {
+ title: '广东省茂名水东湾新城建设管理委员会',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-guang-dong-sheng-mao-ming-shui-dong-wan-xin-cheng-jian-she-guan-li-wei-yuan-hui',
+ source: ['/*'],
+ target: (params, url) => `/gov/sdb/${new URL(url).host.split('.sdb.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
+ },
+ ],
+ },
'sh.gov.cn': {
_name: '上海市人民政府',
wsjkw: [
@@ -809,6 +933,17 @@ module.exports = {
},
],
},
+ 'xinyi.gov.cn': {
+ _name: '信宜市人民政府',
+ www: [
+ {
+ title: '信宜市人民政府',
+ docs: 'https://docs.rsshub.app/government.html#mao-ming-shi-ren-min-zheng-fu-xin-yi-shi-ren-min-zheng-fu',
+ source: ['/*'],
+ target: (params, url) => `/gov/xinyi/${new URL(url).host.split('.xinyi.gov.cn')[0] + new URL(url).pathname.replace(/(index.*$)/g, '')}`,
+ },
+ ],
+ },
'www.gov.cn': {
_name: '中国政府网',
'.': [
diff --git a/lib/v2/gov/router.js b/lib/v2/gov/router.js
index dfcc6024a7ff50..0688b5026a4032 100644
--- a/lib/v2/gov/router.js
+++ b/lib/v2/gov/router.js
@@ -37,12 +37,20 @@ module.exports = function (router) {
router.get(/beijing\/bphc(\/[\w/-]+)?/, require('./beijing/bphc'));
router.get('/beijing/jw/tzgg', require('./beijing/jw/tzgg'));
router.get('/beijing/kw/:channel', require('./beijing/kw/index'));
- router.get('/guangdong/tqyb/tfxtq', require('./guangdong/tqyb/tfxtq'));
+ router.get(/dianbai(\/[\w/-]+)?/, require('./dianbai/dianbai'));
+ router.get(/gaozhou(\/[\w/-]+)?/, require('./gaozhou/gaozhou'));
router.get('/guangdong/tqyb/sncsyjxh', require('./guangdong/tqyb/sncsyjxh'));
+ router.get('/guangdong/tqyb/tfxtq', require('./guangdong/tqyb/tfxtq'));
router.get('/gz/:channel/:category', require('./gz/index'));
router.get('/hebei/czt/xwdt/:category?', require('./hebei/czt'));
+ router.get(/huazhou(\/[\w/-]+)?/, require('./huazhou/huazhou'));
router.get('/huizhou/zwgk/:category?', require('./huizhou/zwgk/index'));
router.get('/hunan/changsha/major-email', require('./hunan/changsha/major-email'));
+ router.get(/maoming(\/[\w/-]+)?/, require('./maoming/maoming'));
+ router.get('/maonan/:category', require('./maonan/maonan'));
+ router.get(/mgs(\/[\w/-]+)?/, require('./mgs/mgs'));
+ router.get(/mmht(\/[\w/-]+)?/, require('./mmht/mmht'));
+ router.get(/sdb(\/[\w/-]+)?/, require('./sdb/sdb'));
router.get('/shaanxi/kjt/:id?', require('./shaanxi/kjt'));
router.get('/shanghai/rsj/ksxm', require('./shanghai/rsj/ksxm'));
router.get('/shanghai/wsjkw/yqtb', require('./shanghai/wsjkw/yqtb'));
@@ -52,5 +60,6 @@ module.exports = function (router) {
router.get('/shenzhen/zzb/:caty/:page?', require('./shenzhen/zzb/index'));
router.get('/sichuan/deyang/govpulicinfo/:countyName', require('./sichuan/deyang/govpulicinfo'));
router.get('/taiyuan/rsj/:caty/:page?', require('./taiyuan/rsj'));
+ router.get(/xinyi(\/[\w/-]+)?/, require('./xinyi/xinyi'));
router.get('/xuzhou/hrss/:category?', require('./xuzhou/hrss'));
};
diff --git a/lib/v2/gov/sdb/sdb.js b/lib/v2/gov/sdb/sdb.js
new file mode 100644
index 00000000000000..6c3a962153f6ae
--- /dev/null
+++ b/lib/v2/gov/sdb/sdb.js
@@ -0,0 +1,19 @@
+const { gdgov } = require('../general/general');
+
+module.exports = async (ctx) => {
+ const info = {
+ defaultPath: 'zwgk/zcjd/',
+ list_element: '.art-list li a',
+ list_include: 'site',
+ title_element: '.title',
+ title_match: '(.*)',
+ description_element: '.text',
+ author_element: '.source',
+ author_match: '来源:(.*)发布时间',
+ authorisme: '广东省茂名水东湾新城建设管理委员会网站',
+ pubDate_element: '.source',
+ pubDate_match: '发布时间:(.*)',
+ pubDate_format: undefined,
+ };
+ await gdgov(info, ctx);
+};
diff --git a/lib/v2/gov/xinyi/xinyi.js b/lib/v2/gov/xinyi/xinyi.js
new file mode 100644
index 00000000000000..bbece179b16d7c
--- /dev/null
+++ b/lib/v2/gov/xinyi/xinyi.js
@@ -0,0 +1,19 @@
+const { gdgov } = require('../general/general');
+
+module.exports = async (ctx) => {
+ const info = {
+ defaultPath: 'zwgk/zcjd/',
+ list_element: '.newsList li a',
+ list_include: 'site',
+ title_element: '.title',
+ title_match: '(.*)',
+ description_element: '.conTxt',
+ author_element: undefined,
+ author_match: undefined,
+ authorisme: '信宜市人民政府网',
+ pubDate_element: '.property span:nth-child(-n+2)',
+ pubDate_match: '发布时间:(.*)',
+ pubDate_format: undefined,
+ };
+ await gdgov(info, ctx);
+};
|
b1a1f1401b6d14b94ccde45fbbc7dd4fdecb51f4
|
2024-06-06 18:56:41
|
dependabot[bot]
|
chore(deps): bump tsx from 4.11.2 to 4.12.0 (#15832)
| false
|
bump tsx from 4.11.2 to 4.12.0 (#15832)
|
chore
|
diff --git a/package.json b/package.json
index 96493c376aeead..e66973cc21e01b 100644
--- a/package.json
+++ b/package.json
@@ -117,7 +117,7 @@
"tldts": "6.1.24",
"tosource": "2.0.0-alpha.3",
"tough-cookie": "4.1.4",
- "tsx": "4.11.2",
+ "tsx": "4.12.0",
"twitter-api-v2": "1.17.1",
"undici": "6.18.2",
"uuid": "9.0.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8f33b87004bd8b..5e7317305eb9fc 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -210,8 +210,8 @@ importers:
specifier: 4.1.4
version: 4.1.4
tsx:
- specifier: 4.11.2
- version: 4.11.2
+ specifier: 4.12.0
+ version: 4.12.0
twitter-api-v2:
specifier: 1.17.1
version: 1.17.1
@@ -5358,8 +5358,8 @@ packages:
[email protected]:
resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==}
- [email protected]:
- resolution: {integrity: sha512-V5DL5v1BuItjsQ2FN9+4OjR7n5cr8hSgN+VGmm/fd2/0cgQdBIWHcQ3bFYm/5ZTmyxkTDBUIaRuW2divgfPe0A==}
+ [email protected]:
+ resolution: {integrity: sha512-642NAWAbDqPZINjmL32Lh/B+pd8vbVj6LHPsWm09IIHqQuWhCrNfcPTjRlHFWvv3FfM4vt9NLReBIjUNj5ZhDg==}
engines: {node: '>=18.0.0'}
hasBin: true
@@ -11462,7 +11462,7 @@ snapshots:
[email protected]: {}
- [email protected]:
+ [email protected]:
dependencies:
esbuild: 0.20.2
get-tsconfig: 4.7.5
|
4dc3362e41bb19bb883ea126af1aa20ea809043d
|
2022-07-17 17:54:20
|
Ethan Shen
|
feat(route): 公視新聞網 (#10236)
| false
|
公視新聞網 (#10236)
|
feat
|
diff --git a/docs/traditional-media.md b/docs/traditional-media.md
index fe90d4473a716b..1ed858d7db98ef 100644
--- a/docs/traditional-media.md
+++ b/docs/traditional-media.md
@@ -878,6 +878,45 @@ Type 栏目:
<Route author="nczitzk" example="/pts/dailynews" path="/pts/dailynews"/>
+### 專題策展
+
+<Route author="nczitzk" example="/pts/curations" path="/pts/curations"/>
+
+### 觀點
+
+<Route author="nczitzk" example="/pts/opinion" path="/pts/opinion"/>
+
+### 數位敘事
+
+<Route author="nczitzk" example="/pts/projects" path="/pts/projects"/>
+
+### 深度報導
+
+<Route author="nczitzk" example="/pts/report" path="/pts/report"/>
+
+### 分類
+
+<Route author="nczitzk" example="/pts/category/9" path="/pts/category/:id" :paramsDesc="['分類 id,见下表,可在对应分類页 URL 中找到']">
+
+| 名称 | 编号 |
+| ---- | -- |
+| 政治 | 1 |
+| 社會 | 7 |
+| 全球 | 4 |
+| 生活 | 5 |
+| 兩岸 | 9 |
+| 地方 | 11 |
+| 產經 | 10 |
+| 文教科技 | 6 |
+| 環境 | 3 |
+| 社福人權 | 12 |
+
+</Route>
+
+### 標籤
+
+<Route author="nczitzk" example="/pts/tag/230" path="/pts/tag/:id" :paramsDesc="['標籤 id,可在对应標籤页 URL 中找到']"/>
+
## 共同网
### 最新报道
diff --git a/lib/v2/pts/curations.js b/lib/v2/pts/curations.js
new file mode 100644
index 00000000000000..c48cc3fcab5951
--- /dev/null
+++ b/lib/v2/pts/curations.js
@@ -0,0 +1,44 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+module.exports = async (ctx) => {
+ const rootUrl = 'https://news.pts.org.tw';
+ const currentUrl = `${rootUrl}/curations`;
+
+ const response = await got({
+ method: 'get',
+ url: currentUrl,
+ });
+
+ const $ = cheerio.load(response.data);
+
+ const items = $('.project-intro')
+ .last()
+ .find('h3 a')
+ .toArray()
+ .map((item) => {
+ item = $(item);
+
+ const projectDiv = item.parent().parent();
+
+ return {
+ title: item.text(),
+ link: item.attr('href'),
+ pubDate: parseDate(projectDiv.find('time').text()),
+ description: art(path.join(__dirname, 'templates/description.art'), {
+ image: projectDiv.parent().find('.cover-fit').attr('src'),
+ }),
+ };
+ });
+
+ ctx.state.data = {
+ title: $('title')
+ .text()
+ .replace(/第\d+頁 | /, ''),
+ link: currentUrl,
+ item: items,
+ };
+};
diff --git a/lib/v2/pts/dailynews.js b/lib/v2/pts/index.js
similarity index 52%
rename from lib/v2/pts/dailynews.js
rename to lib/v2/pts/index.js
index 8eb7d47f8de082..f74e17e75bfd77 100644
--- a/lib/v2/pts/dailynews.js
+++ b/lib/v2/pts/index.js
@@ -2,10 +2,12 @@ const got = require('@/utils/got');
const cheerio = require('cheerio');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
module.exports = async (ctx) => {
const rootUrl = 'https://news.pts.org.tw';
- const currentUrl = `${rootUrl}/dailynews`;
+ const currentUrl = `${rootUrl}${ctx.path === '/' ? '/dailynews' : ctx.path}`;
const response = await got({
method: 'get',
@@ -14,19 +16,20 @@ module.exports = async (ctx) => {
const $ = cheerio.load(response.data);
- const list = $('h2 a')
- .map((_, item) => {
+ let items = $('h2 a')
+ .slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 30)
+ .toArray()
+ .map((item) => {
item = $(item);
return {
title: item.text(),
link: item.attr('href'),
};
- })
- .get();
+ });
- const items = await Promise.all(
- list.map((item) =>
+ items = await Promise.all(
+ items.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const detailResponse = await got({
method: 'get',
@@ -35,17 +38,27 @@ module.exports = async (ctx) => {
const content = cheerio.load(detailResponse.data);
- item.author = content('meta[property="article:author"]').attr('content');
+ item.author = content('meta[property="article:author"]').attr('content').split(' / ')[0];
item.pubDate = timezone(parseDate(content('meta[property="article:published_time"]').attr('content')), +8);
- item.description = `<img src="${content('meta[property="og:image"]').attr('content')}">${content('.post-article').html()}`;
-
+ item.category = content('.tag-list')
+ .first()
+ .find('.blue-tag')
+ .toArray()
+ .map((t) => content(t).text())
+ .filter((t) => t !== '...');
+ item.description = art(path.join(__dirname, 'templates/description.art'), {
+ image: content('meta[property="og:image"]').attr('content'),
+ description: content('.post-article').html(),
+ });
return item;
})
)
);
ctx.state.data = {
- title: '即時 | 公視新聞網 PNN',
+ title: $('title')
+ .text()
+ .replace(/第\d+頁 | /, ''),
link: currentUrl,
item: items,
};
diff --git a/lib/v2/pts/maintainer.js b/lib/v2/pts/maintainer.js
index 8eaa4e035b0178..0441ed933c7165 100644
--- a/lib/v2/pts/maintainer.js
+++ b/lib/v2/pts/maintainer.js
@@ -1,3 +1,9 @@
module.exports = {
+ '/category/:id': ['nczitzk'],
+ '/curations': ['nczitzk'],
'/dailynews': ['nczitzk'],
+ '/opinion': ['nczitzk'],
+ '/projects': ['nczitzk'],
+ '/report': ['nczitzk'],
+ '/tag/:id': ['nczitzk'],
};
diff --git a/lib/v2/pts/projects.js b/lib/v2/pts/projects.js
new file mode 100644
index 00000000000000..93198627d249c0
--- /dev/null
+++ b/lib/v2/pts/projects.js
@@ -0,0 +1,44 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+module.exports = async (ctx) => {
+ const rootUrl = 'https://news.pts.org.tw';
+ const currentUrl = `${rootUrl}/projects`;
+
+ const response = await got({
+ method: 'get',
+ url: currentUrl,
+ });
+
+ const $ = cheerio.load(response.data);
+
+ const items = $('h3 a')
+ .toArray()
+ .map((item) => {
+ item = $(item);
+
+ const projectDiv = item.parent().parent();
+ const description = projectDiv.find('p').text();
+
+ return {
+ title: item.text(),
+ link: item.attr('href'),
+ pubDate: parseDate(projectDiv.find('time').text()),
+ description: art(path.join(__dirname, 'templates/description.art'), {
+ image: projectDiv.parent().find('.cover-fit')?.attr('src') ?? projectDiv.parent().parent().find('.cover-fit').attr('src'),
+ description: description ? `<p>${description}</p>` : '',
+ }),
+ };
+ });
+
+ ctx.state.data = {
+ title: $('title')
+ .text()
+ .replace(/第\d+頁 | /, ''),
+ link: currentUrl,
+ item: items,
+ };
+};
diff --git a/lib/v2/pts/radar.js b/lib/v2/pts/radar.js
index a5ff8e2bd7d0a6..557aaa0c1d78a2 100644
--- a/lib/v2/pts/radar.js
+++ b/lib/v2/pts/radar.js
@@ -3,11 +3,47 @@ module.exports = {
_name: '公視新聞網 PNN',
news: [
{
- title: '即時',
+ title: '即時新聞',
docs: 'https://docs.rsshub.app/traditional-media.html#gong-shi-xin-wen-wang-ji-shi-xin-wen',
- source: ['/dailynews'],
+ source: ['/dailynews', '/'],
target: '/pts/dailynews',
},
+ {
+ title: '專題策展',
+ docs: 'https://docs.rsshub.app/traditional-media.html#gong-shi-xin-wen-wang-zhuan-ti-ce-zhan',
+ source: ['/curations', '/'],
+ target: '/pts/curations',
+ },
+ {
+ title: '觀點',
+ docs: 'https://docs.rsshub.app/traditional-media.html#gong-shi-xin-wen-wang-guan-dian',
+ source: ['/opinion', '/'],
+ target: '/pts/opinion',
+ },
+ {
+ title: '數位敘事',
+ docs: 'https://docs.rsshub.app/traditional-media.html#gong-shi-xin-wen-wang-shu-wei-xu-shi',
+ source: ['/projects', '/'],
+ target: '/pts/projects',
+ },
+ {
+ title: '深度報導',
+ docs: 'https://docs.rsshub.app/traditional-media.html#gong-shi-xin-wen-wang-shen-du-bao-dao',
+ source: ['/report', '/'],
+ target: '/pts/report',
+ },
+ {
+ title: '分類',
+ docs: 'https://docs.rsshub.app/traditional-media.html#gong-shi-xin-wen-wang-fen-lei',
+ source: ['/category/:id', '/'],
+ target: '/pts/category/:id',
+ },
+ {
+ title: '標籤',
+ docs: 'https://docs.rsshub.app/traditional-media.html#gong-shi-xin-wen-wang-biao-qian',
+ source: ['/tag/:id', '/'],
+ target: '/pts/tag/:id',
+ },
],
},
};
diff --git a/lib/v2/pts/router.js b/lib/v2/pts/router.js
index e2bb9b13d54af3..41f8454144819c 100644
--- a/lib/v2/pts/router.js
+++ b/lib/v2/pts/router.js
@@ -1,3 +1,6 @@
module.exports = function (router) {
- router.get('/dailynews', require('./dailynews'));
+ router.get('/curations', require('./curations'));
+ router.get('/projects', require('./projects'));
+ router.get(/([\w-/]+)?/, require('./index'));
+ router.get('', require('./index'));
};
diff --git a/lib/v2/pts/templates/description.art b/lib/v2/pts/templates/description.art
new file mode 100644
index 00000000000000..69e93d20cfd954
--- /dev/null
+++ b/lib/v2/pts/templates/description.art
@@ -0,0 +1,6 @@
+{{ if image }}
+<img src="{{ image }}">
+{{ /if }}
+{{ if description }}
+{{@ description }}
+{{ /if }}
\ No newline at end of file
|
31b6b45996380a52913a4237c53195d55e8453be
|
2023-10-04 04:26:40
|
dependabot[bot]
|
chore(deps-dev): bump @vercel/nft from 0.24.1 to 0.24.2 (#13459)
| false
|
bump @vercel/nft from 0.24.1 to 0.24.2 (#13459)
|
chore
|
diff --git a/package.json b/package.json
index 75720a96bfa00d..99f4d8d04e0515 100644
--- a/package.json
+++ b/package.json
@@ -179,7 +179,7 @@
"@types/supertest": "2.0.14",
"@types/tiny-async-pool": "2.0.0",
"@types/tough-cookie": "4.0.3",
- "@vercel/nft": "0.24.1",
+ "@vercel/nft": "0.24.2",
"cross-env": "7.0.3",
"eslint": "8.50.0",
"eslint-config-prettier": "9.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 355162d1ec295b..4ea3269c9d76ca 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -290,8 +290,8 @@ devDependencies:
specifier: 4.0.3
version: 4.0.3
'@vercel/nft':
- specifier: 0.24.1
- version: 0.24.1
+ specifier: 0.24.2
+ version: 0.24.2
cross-env:
specifier: 7.0.3
version: 7.0.3
@@ -1795,8 +1795,8 @@ packages:
dev: false
optional: true
- /@vercel/[email protected]:
- resolution: {integrity: sha512-bGYrA/w98LNl9edxXcAezKs+Ixa2a+RkAvxXK38gH3815v+WkNa2AGY+wQv59vu2f9il9+zIKj6YrnlYIbh+jA==}
+ /@vercel/[email protected]:
+ resolution: {integrity: sha512-KhY3Ky/lCqE+fHpOXiKOLnXYJ49PZh1dyDSfVtZhmYtmica0NQgyO6kPOAGDNWqD9IOBx8hb65upxxjfnfa1JA==}
engines: {node: '>=16'}
hasBin: true
dependencies:
|
57e2a2401bf64d7525610f9073a1e92a82e96cdd
|
2022-06-09 15:59:38
|
Ethan Shen
|
feat(route): add 产品沉思录 (#9927)
| false
|
add 产品沉思录 (#9927)
|
feat
|
diff --git a/docs/new-media.md b/docs/new-media.md
index ccb3173e2e9372..7d4a8169e4288d 100644
--- a/docs/new-media.md
+++ b/docs/new-media.md
@@ -1520,6 +1520,12 @@ Supported sub-sites:
<Route author="Fatpandac" example="/chaping/newsflash" path="/chaping/newsflash"/>
+## 产品沉思录
+
+### 首页
+
+<Route author="nczitzk" example="/pmthinking" path="/pmthinking" />
+
## 城农 Growin' City
### 城农资讯观点
diff --git a/lib/v2/pmthinking/index.js b/lib/v2/pmthinking/index.js
new file mode 100644
index 00000000000000..1334aedf692e09
--- /dev/null
+++ b/lib/v2/pmthinking/index.js
@@ -0,0 +1,61 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const timezone = require('@/utils/timezone');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+module.exports = async (ctx) => {
+ const rootUrl = 'https://pmthinking.com';
+ const currentUrl = `${rootUrl}/wp-json/b2/v1/getModulePostList`;
+
+ const response = await got({
+ method: 'post',
+ url: currentUrl,
+ json: {
+ index: 2,
+ post_paged: 1,
+ },
+ });
+
+ const $ = cheerio.load(response.data.data);
+
+ let items = $('h2 a')
+ .toArray()
+ .map((item) => {
+ item = $(item);
+
+ return {
+ title: item.text(),
+ link: item.attr('href'),
+ };
+ });
+
+ items = await Promise.all(
+ items.map((item) =>
+ ctx.cache.tryGet(item.link, async () => {
+ const detailResponse = await got({
+ method: 'get',
+ url: item.link,
+ });
+
+ const content = cheerio.load(detailResponse.data);
+
+ item.author = content('.post-user-name').text();
+ item.pubDate = timezone(parseDate(content('time[itemprop="datePublished"]').attr('datetime')), +8);
+ item.description = art(path.join(__dirname, 'templates/description.art'), {
+ image: content('.post-style-4-top img').attr('src'),
+ description: content('.entry-content').html(),
+ });
+
+ return item;
+ })
+ )
+ );
+
+ ctx.state.data = {
+ title: '产品沉思录 · Product Thinking',
+ link: rootUrl,
+ item: items,
+ };
+};
diff --git a/lib/v2/pmthinking/maintainer.js b/lib/v2/pmthinking/maintainer.js
new file mode 100644
index 00000000000000..ca7cf1eb13c68a
--- /dev/null
+++ b/lib/v2/pmthinking/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/': ['nczitzk'],
+};
diff --git a/lib/v2/pmthinking/radar.js b/lib/v2/pmthinking/radar.js
new file mode 100644
index 00000000000000..c3f78733c29f5c
--- /dev/null
+++ b/lib/v2/pmthinking/radar.js
@@ -0,0 +1,13 @@
+module.exports = {
+ 'pmthinking.com': {
+ _name: '产品沉思录',
+ '.': [
+ {
+ title: '首页',
+ docs: 'https://docs.rsshub.app/new-media.html#chan-pin-chen-si-lu-shou-ye',
+ source: ['/'],
+ target: '/pmthinking',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/pmthinking/router.js b/lib/v2/pmthinking/router.js
new file mode 100644
index 00000000000000..20c52b09d72938
--- /dev/null
+++ b/lib/v2/pmthinking/router.js
@@ -0,0 +1,3 @@
+module.exports = function (router) {
+ router.get('/', require('./index'));
+};
diff --git a/lib/v2/pmthinking/templates/description.art b/lib/v2/pmthinking/templates/description.art
new file mode 100644
index 00000000000000..c823516c9a36ad
--- /dev/null
+++ b/lib/v2/pmthinking/templates/description.art
@@ -0,0 +1,4 @@
+{{ if image }}
+<img src="{{ image }}">
+{{ /if }}
+{{@ description }}
\ No newline at end of file
|
9be1457ec8d3d303ae4c3bd480264bbf6326e365
|
2022-10-12 22:48:48
|
Tony
|
fix(route): mtime (#11074)
| false
|
mtime (#11074)
|
fix
|
diff --git a/docs/multimedia.md b/docs/multimedia.md
index 79b3c53f99f141..67d194b711c981 100644
--- a/docs/multimedia.md
+++ b/docs/multimedia.md
@@ -1543,7 +1543,7 @@ JavDB 有多个备用域名,本路由默认使用永久域名 <https://javdb.c
## 时光网
-### 资讯
+### 时光新闻
<Route author="TsSmartTT" example="/mtime/news" path="/mtime/news" radar="1" rssbud="1"/>
diff --git a/lib/v2/mtime/maintainer.js b/lib/v2/mtime/maintainer.js
index ae0ebe64216aa0..80ea9ed532705e 100644
--- a/lib/v2/mtime/maintainer.js
+++ b/lib/v2/mtime/maintainer.js
@@ -1,3 +1,3 @@
module.exports = {
- '/mtime/news': ['TsSmartTT'],
+ '/news': ['TsSmartTT'],
};
diff --git a/lib/v2/mtime/news.js b/lib/v2/mtime/news.js
index e939db6b8827fb..97f2383650ba05 100644
--- a/lib/v2/mtime/news.js
+++ b/lib/v2/mtime/news.js
@@ -2,47 +2,51 @@ const got = require('@/utils/got');
const cheerio = require('cheerio');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
+const asyncPool = require('tiny-async-pool');
module.exports = async (ctx) => {
- const link = 'http://news.mtime.com/';
- const response = await got({
- method: 'get',
- url: link,
+ const link = 'https://news.mtime.com';
+ const response = await got(link, {
+ https: {
+ rejectUnauthorized: false,
+ },
});
const $ = cheerio.load(response.data);
const list = $('ul.left-cont.fix li')
- .map((_, item) => {
+ .toArray()
+ .map((item) => {
item = $(item);
return {
title: item.find('h4 a').text(),
link: item.find('h4 a').attr('href'),
};
- })
- .get();
+ });
- const items = await Promise.all(
- list.map((item) =>
- ctx.cache.tryGet(item.link, async () => {
- const detailResponse = await got({
- method: 'get',
- url: item.link,
- });
- const content = cheerio.load(detailResponse.data);
+ const items = [];
+ for await (const item of asyncPool(4, list, (item) =>
+ ctx.cache.tryGet(item.link, async () => {
+ const detailResponse = await got(item.link);
+ const content = cheerio.load(detailResponse.data);
- content('.DRE-subject-wrapper').remove();
+ content('.DRE-subject-wrapper').remove();
- item.author = content('.editor').text().replace('编辑:', '');
- item.description = content('.body').first().html();
- item.pubDate = timezone(parseDate(content('.userCreateTime').text()), 8);
+ item.author = content('.editor').text().replace('编辑:', '');
+ item.description = content('.body').first().html();
+ item.pubDate = timezone(parseDate(content('.userCreateTime').text()), 8);
+ item.category = content('.keyword a')
+ .toArray()
+ .map((item) => content(item).text());
- return item;
- })
- )
- );
+ return item;
+ })
+ )) {
+ items.push(item);
+ }
ctx.state.data = {
- title: 'Mtime时光网 - 资讯',
+ title: $('head title').text().trim(),
link,
+ image: 'http://static1.mtime.cn/favicon.ico',
item: items,
};
};
diff --git a/lib/v2/mtime/radar.js b/lib/v2/mtime/radar.js
index 113c4feff5fefc..e5e558dc2d987e 100644
--- a/lib/v2/mtime/radar.js
+++ b/lib/v2/mtime/radar.js
@@ -3,7 +3,7 @@ module.exports = {
_name: '时光网',
news: [
{
- title: '资讯',
+ title: '时光新闻',
docs: 'https://docs.rsshub.app/multimedia.html#shi-guang-wang',
source: '/',
target: '/mtime/news',
|
06e3892106cda248bcab88a620ea16f67d94366a
|
2023-12-09 00:16:31
|
Tony
|
feat(route): missav (#13997)
| false
|
missav (#13997)
|
feat
|
diff --git a/lib/v2/missav/maintainer.js b/lib/v2/missav/maintainer.js
new file mode 100644
index 00000000000000..ffb61fdc89d07c
--- /dev/null
+++ b/lib/v2/missav/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/new': ['TonyRL'],
+};
diff --git a/lib/v2/missav/new.js b/lib/v2/missav/new.js
new file mode 100644
index 00000000000000..281f12c0f9e5ea
--- /dev/null
+++ b/lib/v2/missav/new.js
@@ -0,0 +1,36 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { art } = require('@/utils/render');
+const { join } = require('path');
+
+module.exports = async (ctx) => {
+ const baseUrl = 'https://missav.com';
+ const { data: response } = await got(`${baseUrl}/dm397/new`);
+ const $ = cheerio.load(response);
+
+ const items = $('.grid .group')
+ .toArray()
+ .map((item) => {
+ item = $(item);
+ const title = item.find('.text-secondary');
+ const poster = new URL(item.find('img').data('src'));
+ poster.searchParams.set('class', 'normal');
+ const video = item.find('video').data('src');
+ return {
+ title: title.text().trim(),
+ link: title.attr('href'),
+ description: art(join(__dirname, 'templates/preview.art'), {
+ poster: poster.href,
+ video,
+ type: video.split('.').pop(),
+ }),
+ };
+ });
+
+ ctx.state.data = {
+ title: $('head title').text(),
+ description: $('head meta[name="description"]').attr('content'),
+ link: baseUrl,
+ item: items,
+ };
+};
diff --git a/lib/v2/missav/radar.js b/lib/v2/missav/radar.js
new file mode 100644
index 00000000000000..471b84b03e66ca
--- /dev/null
+++ b/lib/v2/missav/radar.js
@@ -0,0 +1,13 @@
+module.exports = {
+ 'missav.com': {
+ _name: 'MissAV.com',
+ '.': [
+ {
+ title: '最近更新',
+ docs: 'https://docs.rsshub.app/multimedia#missav-com',
+ source: ['/dm397/new', '/new', '/'],
+ target: '/missav/new',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/missav/router.js b/lib/v2/missav/router.js
new file mode 100644
index 00000000000000..cbdbafac3606dc
--- /dev/null
+++ b/lib/v2/missav/router.js
@@ -0,0 +1,3 @@
+module.exports = (router) => {
+ router.get('/new', require('./new'));
+};
diff --git a/lib/v2/missav/templates/preview.art b/lib/v2/missav/templates/preview.art
new file mode 100644
index 00000000000000..5f3f875a994c66
--- /dev/null
+++ b/lib/v2/missav/templates/preview.art
@@ -0,0 +1,3 @@
+<video controls preload="none" poster="{{ poster }}">
+ <source src="{{ video }}" type="{{ type }}">
+</video>
diff --git a/website/docs/routes/multimedia.mdx b/website/docs/routes/multimedia.mdx
index 5bcaed8b2e8f50..e5ed11b913f2a4 100644
--- a/website/docs/routes/multimedia.mdx
+++ b/website/docs/routes/multimedia.mdx
@@ -985,6 +985,12 @@ See [Directory](https://www.javlibrary.com/en/star_list.php) to view all stars.
</Route>
+## MissAV.com {#missav.com}
+
+### 最近更新 {#missav.com-zui-jin-geng-xin}
+
+<Route author="TonyRL" example="/missav/new" path="/missav/new" radar="1" />
+
## Mixcloud {#mixcloud}
### User {#mixcloud-user}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.