feat(route): '国务院会议' (#16768)

* Add route of '国务院会议'

* Moved the route to gov folder

* modified route path and example to fix a route not found error

* fix: combine with existing route

* fix: filter empty category

---------
This commit is contained in:
et al.
2024-09-17 23:42:46 +08:00
committed by GitHub
parent 20dfcb9977
commit cece722677
2 changed files with 19 additions and 7 deletions
+8
View File
@@ -0,0 +1,8 @@
import type { Namespace } from '@/types';
export const namespace: Namespace = {
name: '中国政府网',
url: 'www.gov.cn/',
categories: ['government'],
description: '',
};
@@ -7,9 +7,9 @@ import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
export const route: Route = {
path: '/news/:uid',
path: '/cn/news/:uid',
categories: ['government'],
example: '/gov/news/bm',
example: '/gov/cn/news/bm',
parameters: { uid: '分类名' },
features: {
requireConfig: false,
@@ -20,11 +20,11 @@ export const route: Route = {
supportScihub: false,
},
name: '政府新闻',
maintainers: ['EsuRt'],
maintainers: ['EsuRt', 'howfool'],
handler,
description: `| 政务部门 | 滚动新闻 | 新闻要闻 | 国务院新闻 | 政策文件 |
| :------: | :------: | :------: | :--------: | :------: |
| bm | gd | yw | gwy | zhengce |`,
description: `| 政务部门 | 滚动新闻 | 新闻要闻 | 国务院新闻 | 国务院工作会议 | 政策文件 |
| :------: | :------: | :------: | :--------: | :------------: | :------: |
| bm | gd | yw | gwy | gwyzzjg | zhengce |`,
};
async function handler(ctx) {
@@ -55,6 +55,10 @@ async function handler(ctx) {
url = 'http://sousuo.gov.cn/s.htm?t=zhengcelibrary';
title = '中国政府网 - 政策文件';
break;
case 'gwyzzjg':
url = `${originDomain}/gwyzzjg/huiyi/`;
title = '中国政府网 - 国务院工作会议';
break;
default:
logger.error('pattern not matched');
}
@@ -119,7 +123,7 @@ async function handler(ctx) {
link: contentUrl,
pubDate,
author,
category,
category: category.filter(Boolean),
};
});
})