feat(route): add 北京市教育委员会通知公告 (#9978)

This commit is contained in:
Ethan Shen
2022-06-18 23:23:11 +08:00
committed by GitHub
parent be32ca0e95
commit f3aee1b3b5
5 changed files with 100 additions and 26 deletions
+6
View File
@@ -44,6 +44,12 @@ pageClass: routes
<Route author="Fatpandac" example="/ssm/news" path="/ssm/news"/>
## 北京市教育委员会
### 通知公告
<Route author="nczitzk" example="/gov/beijing/jw/tzgg" path="/gov/beijing/jw/tzgg" />
## 北京市科学技术委员会、中关村科技园区管理委员会
### 频道
+58
View File
@@ -0,0 +1,58 @@
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 rootUrl = 'http://jw.beijing.gov.cn';
const currentUrl = `${rootUrl}/tzgg`;
const response = await got({
method: 'get',
url: currentUrl,
});
const $ = cheerio.load(response.data);
let items = $('.col-md a')
.toArray()
.map((item) => {
item = $(item);
const link = item.attr('href');
return {
title: item.text(),
link: /^http/.test(link) ? link : `${rootUrl}${link.replace(/^\./, '/tzgg')}`,
pubDate: parseDate(item.parent().find('span').text()),
};
});
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);
const pubDate = content('meta[name="PubDate"]').attr('content');
item.author = content('meta[name="ContentSource"]').attr('content');
item.pubDate = pubDate ? timezone(parseDate(content('meta[name="PubDate"]').attr('content')), +8) : item.pubDate;
item.description = content('.TRS_UEDITOR').html();
return item;
})
)
);
ctx.state.data = {
title: '北京市教育委员会 - 通知公告',
link: currentUrl,
item: items,
description: $('meta[name="ColumnDescription"]').attr('content'),
};
};
+1
View File
@@ -18,6 +18,7 @@ module.exports = {
'/pbc/zcyj': ['Fatpandac'],
// province
'/anhui/kjt/:path?': ['nczitzk'],
'/beijing/jw/tzgg': ['nczitzk'],
'/beijing/kw/:channel': ['Fatpandac'],
'/hebei/czt/xwdt/:category?': ['nczitzk'],
'/shenzhen/hrss/szksy/:caty/:page?': ['zlasd'],
+34 -26
View File
@@ -18,10 +18,18 @@ module.exports = {
},
'beijing.gov.cn': {
_name: '北京市人民政府',
jw: [
{
title: '北京市教育委员会通知公告',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-jiao-yu-wei-yuan-tong-zhi-gong-gao',
source: ['/tzgg'],
target: '/gov/beijing/jw/tzgg',
},
],
kw: [
{
title: '北京市科委央地协同',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1132') {
@@ -31,7 +39,7 @@ module.exports = {
},
{
title: '北京市科委三城一区',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1134') {
@@ -41,7 +49,7 @@ module.exports = {
},
{
title: '北京市科委高精尖产业',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1136') {
@@ -51,7 +59,7 @@ module.exports = {
},
{
title: '北京市科委开放创新',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1138') {
@@ -61,7 +69,7 @@ module.exports = {
},
{
title: '北京市科委深化改革',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1140') {
@@ -71,7 +79,7 @@ module.exports = {
},
{
title: '北京市科委内设机构',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col746') {
@@ -81,7 +89,7 @@ module.exports = {
},
{
title: '北京市科委直属机构',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col748') {
@@ -91,7 +99,7 @@ module.exports = {
},
{
title: '北京市科委行政许可',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1520') {
@@ -101,7 +109,7 @@ module.exports = {
},
{
title: '北京市科委行政处罚',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1522') {
@@ -111,7 +119,7 @@ module.exports = {
},
{
title: '北京市科委行政确认',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1524') {
@@ -121,7 +129,7 @@ module.exports = {
},
{
title: '北京市科委行政奖励',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1526') {
@@ -131,7 +139,7 @@ module.exports = {
},
{
title: '行北京市科委政检查',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1528') {
@@ -141,7 +149,7 @@ module.exports = {
},
{
title: '北京市科委其他权力',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1542') {
@@ -151,7 +159,7 @@ module.exports = {
},
{
title: '北京市科委最新政策',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col2380') {
@@ -161,7 +169,7 @@ module.exports = {
},
{
title: '北京市科委科技政策-科技法规规章文件',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col2962' || params.channel === 'col2384') {
@@ -171,7 +179,7 @@ module.exports = {
},
{
title: '北京市科委科技政策-科委规范性文件',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col2962' || params.channel === 'col2386') {
@@ -181,7 +189,7 @@ module.exports = {
},
{
title: '北京市科委科技政策-其他科技政策',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col2962' || params.channel === 'col2388') {
@@ -191,7 +199,7 @@ module.exports = {
},
{
title: '北京市科委国家科技政策',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col2964') {
@@ -201,7 +209,7 @@ module.exports = {
},
{
title: '北京市科委政策解读',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col2396') {
@@ -211,7 +219,7 @@ module.exports = {
},
{
title: '北京市科委通知公告',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col736') {
@@ -221,7 +229,7 @@ module.exports = {
},
{
title: '北京市科委新闻中心',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col6382') {
@@ -231,7 +239,7 @@ module.exports = {
},
{
title: '北京市科委要闻',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col6344') {
@@ -241,7 +249,7 @@ module.exports = {
},
{
title: '北京市科委工作动态',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col2330') {
@@ -251,7 +259,7 @@ module.exports = {
},
{
title: '北京市科委媒体报道',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col2332') {
@@ -261,7 +269,7 @@ module.exports = {
},
{
title: '北京市科委图片报道',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col6346') {
@@ -271,7 +279,7 @@ module.exports = {
},
{
title: '北京市科委政府网站年报专栏',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-、-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
docs: 'https://docs.rsshub.app/government.html#bei-jing-shi-ke-xue-ji-shu-wei-yuan-hui-zhong-guan-cun-ke-ji-yuan-qu-guan-li-wei-yuan-hui',
source: ['/col/:channel/index.html'],
target: (params) => {
if (params.channel === 'col1008') {
+1
View File
@@ -18,6 +18,7 @@ module.exports = function (router) {
router.get('/pbc/zcyj', require('./pbc/zcyj'));
// province
router.get(/anhui\/kjt\/([\w\d/-]+)?/, require('./anhui/kjt'));
router.get('/beijing/jw/tzgg', require('./beijing/jw/tzgg'));
router.get('/beijing/kw/:channel', require('./beijing/kw/index'));
router.get('/hebei/czt/xwdt/:category?', require('./hebei/czt'));
router.get('/shenzhen/hrss/szksy/:caty/:page?', require('./shenzhen/hrss/szksy/index'));