diff --git a/docs/government.md b/docs/government.md
index 84d427710..145d55170 100644
--- a/docs/government.md
+++ b/docs/government.md
@@ -933,9 +933,9 @@ pageClass: routes
-| 政策解读 | 最新文件 | 公告公示 | 教育部简报 |
-| :---------: | :---------: | :----: | :---------------: |
-| policy_anal | newest_file | notice | edu_ministry_news |
+| 政策解读 | 最新文件 | 公告公示 | 教育部简报 | 教育要闻 |
+| :---------: | :---------: | :----: | :---------------: | :---------------: |
+| policy_anal | newest_file | notice | edu_ministry_news | edu_focus_news |
diff --git a/lib/router.js b/lib/router.js
index 40a058a1d..ee9296538 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -1220,8 +1220,8 @@ router.get('/gov/ndrc/xwdt/:caty?', lazyloadRouteHandler('./routes/gov/ndrc/xwdt
// 中华人民共和国-海关总署
router.get('/gov/customs/list/:gchannel', lazyloadRouteHandler('./routes/gov/customs/list'));
-// 中华人民共和国教育部
-router.get('/gov/moe/:type', lazyloadRouteHandler('./routes/gov/moe/moe'));
+// 中华人民共和国教育部 migrated to v2
+// router.get('/gov/moe/:type', lazyloadRouteHandler('./routes/gov/moe/moe'));
// 中华人民共和国外交部
// router.get('/gov/fmprc/fyrbt', lazyloadRouteHandler('./routes/gov/fmprc/fyrbt'));
diff --git a/lib/v2/gov/maintainer.js b/lib/v2/gov/maintainer.js
index c17a95579..d9c55dae1 100644
--- a/lib/v2/gov/maintainer.js
+++ b/lib/v2/gov/maintainer.js
@@ -1,24 +1,27 @@
module.exports = {
- '/anhui/kjt/:path?': ['nczitzk'],
- '/beijing/kw/:channel': ['Fatpandac'],
- '/shenzhen/hrss/szksy/:caty/:page?': ['zlasd'],
- '/shenzhen/zzb/:caty/:page?': ['zlasd'],
- '/shanghai/rsj/ksxm': ['Fatpandac'],
'/fmprc/:category?': ['nicolaszf', 'nczitzk'],
- '/guangdong/tqyb/tfxtq': ['Fatpandac'],
- '/guangdong/tqyb/sncsyjxh': ['Fatpandac'],
- '/huizhou/zwgk/:category?': ['Fatpandac'],
- '/sichuan/deyang/govpulicinfo/:countyName': ['zytomorrow'],
+ '/mee/ywdt?': ['liuxsdev'],
'/mfa/wjdt/:category?': ['nczitzk'],
'/miit/wjfb/:ministry': ['Fatpandac'],
'/miit/yjzj': ['Fatpandac'],
'/miit/zcwj': ['Yoge-Code'],
'/miit/wjgs': ['Yoge-Code'],
'/miit/zcjd': ['Yoge-Code'],
- '/mee/ywdt?': ['liuxsdev'],
+ '/moe/:type': ['Crawler995'],
'/nrta/news/:category?': ['yuxinliu-alex'],
'/pbc/goutongjiaoliu': ['nczitzk'],
+ '/pbc/gzlw': ['Fatpandac'],
'/pbc/tradeAnnouncement': ['nczitzk'],
'/pbc/zcyj': ['Fatpandac'],
- '/pbc/gzlw': ['Fatpandac'],
+
+ '/anhui/kjt/:path?': ['nczitzk'],
+ '/beijing/kw/:channel': ['Fatpandac'],
+ '/shenzhen/hrss/szksy/:caty/:page?': ['zlasd'],
+ '/shenzhen/zzb/:caty/:page?': ['zlasd'],
+ '/shanghai/rsj/ksxm': ['Fatpandac'],
+ '/shanghai/wsjkw/yqtb': ['zcf0508'],
+ '/guangdong/tqyb/tfxtq': ['Fatpandac'],
+ '/guangdong/tqyb/sncsyjxh': ['Fatpandac'],
+ '/huizhou/zwgk/:category?': ['Fatpandac'],
+ '/sichuan/deyang/govpulicinfo/:countyName': ['zytomorrow'],
};
diff --git a/lib/routes/gov/moe/moe.js b/lib/v2/gov/moe/moe.js
similarity index 78%
rename from lib/routes/gov/moe/moe.js
rename to lib/v2/gov/moe/moe.js
index 5c6be04e1..9ac5a073b 100644
--- a/lib/routes/gov/moe/moe.js
+++ b/lib/v2/gov/moe/moe.js
@@ -1,7 +1,7 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const logger = require('@/utils/logger');
-const liburl = require('url');
+const { parseDate } = require('@/utils/parse-date');
const moeUrl = 'http://www.moe.gov.cn/';
const typesIdMap = [
@@ -9,6 +9,7 @@ const typesIdMap = [
{ type: 'newest_file', id: 'nine_con1', name: '最新文件' },
{ type: 'notice', id: 'nine_con2', name: '公告公示' },
{ type: 'edu_ministry_news', id: 'nine_con3', name: '教育部简报' },
+ { type: 'edu_focus_news', id: 'eight_con2 .TRS_Editor', name: '教育要闻' },
];
module.exports = async (ctx) => {
@@ -28,11 +29,7 @@ module.exports = async (ctx) => {
return;
}
- const response = await got({
- method: 'get',
- url: moeUrl,
- Host: 'www.moe.gov.cn',
- });
+ const response = await got(moeUrl);
const $ = cheerio.load(response.data);
const newsLis = $('div#' + id + '>ul>li');
@@ -46,15 +43,11 @@ module.exports = async (ctx) => {
item = $(item);
const firstA = item.find('a');
- const itemUrl = liburl.resolve(moeUrl, firstA.attr('href'));
+ const itemUrl = new URL(firstA.attr('href'), moeUrl).href;
const infos = await ctx.cache.tryGet(itemUrl, async () => {
const res = {};
- const response = await got({
- method: 'get',
- url: itemUrl,
- Host: 'www.moe.gov.cn',
- });
+ const response = await got(itemUrl);
const data = cheerio.load(response.data);
if (itemUrl.indexOf('www.gov.cn') > -1) {
@@ -65,7 +58,7 @@ module.exports = async (ctx) => {
res.title = data('div#xxgk_content_redheadbg > h1').text();
} else if (itemUrl.indexOf('jyb_') > -1) {
res.description = data('div.TRS_Editor').html();
- res.title = data('div#content_body > h1').text();
+ res.title = data('div.TRS_Editor').siblings('h1').first().text();
}
return res;
@@ -75,7 +68,7 @@ module.exports = async (ctx) => {
title: infos.title,
description: infos.description,
link: itemUrl,
- pubDate: `${new Date().getFullYear()}-${item.find('span').text()}`,
+ pubDate: parseDate(item.find('span').text(), 'MM-DD'),
};
})
.get()
diff --git a/lib/v2/gov/radar.js b/lib/v2/gov/radar.js
index f78969e7e..af92edb2c 100644
--- a/lib/v2/gov/radar.js
+++ b/lib/v2/gov/radar.js
@@ -374,6 +374,17 @@ module.exports = {
},
],
},
+ 'moe.gov.cn': {
+ _name: '中华人民共和国教育部',
+ '.': [
+ {
+ title: '新闻',
+ docs: 'https://docs.rsshub.app/government.html#zhong-hua-ren-min-gong-he-guo-jiao-yu-bu',
+ source: ['/'],
+ target: '/gov/moe/newest_file',
+ },
+ ],
+ },
'nrta.gov.cn': {
_name: '国家广播电视总局',
'.': [
diff --git a/lib/v2/gov/router.js b/lib/v2/gov/router.js
index 6dd0d04f5..fc7ec613a 100644
--- a/lib/v2/gov/router.js
+++ b/lib/v2/gov/router.js
@@ -1,25 +1,28 @@
module.exports = function (router) {
- router.get(/anhui\/kjt\/([\w\d/-]+)?/, require('./anhui/kjt'));
- router.get('/beijing/kw/:channel', require('./beijing/kw/index'));
- router.get('/shenzhen/hrss/szksy/:caty/:page?', require('./shenzhen/hrss/szksy/index'));
- router.get('/shenzhen/zzb/:caty/:page?', require('./shenzhen/zzb/index'));
- router.get('/shanghai/rsj/ksxm', require('./shanghai/rsj/ksxm'));
- router.get('/shanghai/wsjkw/yqtb', require('./shanghai/wsjkw/yqtb'));
+ // ministry
router.get('/fmprc/:category?', require('./mfa/wjdt'));
- 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', require('./sichuan/deyang/govpulicinfo'));
+ router.get('/mee/ywdt/:category?', require('./mee/ywdt'));
router.get('/mfa/wjdt/:category?', require('./mfa/wjdt'));
router.get('/miit/wjfb/:ministry', require('./miit/wjfb'));
router.get('/miit/yjzj', require('./miit/yjzj'));
router.get('/miit/zcwj', require('./miit/zcwj'));
router.get('/miit/wjgs', require('./miit/wjgs'));
router.get('/miit/zcjd', require('./miit/zcjd'));
- router.get('/mee/ywdt/:category?', require('./mee/ywdt'));
+ router.get('/moe/:type', require('./moe/moe'));
router.get('/nrta/news/:category?', require('./nrta/news'));
router.get('/pbc/goutongjiaoliu', require('./pbc/goutongjiaoliu'));
- router.get('/pbc/tradeAnnouncement', require('./pbc/tradeAnnouncement'));
router.get('/pbc/gzlw', require('./pbc/gzlw'));
+ router.get('/pbc/tradeAnnouncement', require('./pbc/tradeAnnouncement'));
router.get('/pbc/zcyj', require('./pbc/zcyj'));
+ // province
+ router.get(/anhui\/kjt\/([\w\d/-]+)?/, require('./anhui/kjt'));
+ router.get('/beijing/kw/:channel', require('./beijing/kw/index'));
+ router.get('/shenzhen/hrss/szksy/:caty/:page?', require('./shenzhen/hrss/szksy/index'));
+ router.get('/shenzhen/zzb/:caty/:page?', require('./shenzhen/zzb/index'));
+ router.get('/shanghai/rsj/ksxm', require('./shanghai/rsj/ksxm'));
+ router.get('/shanghai/wsjkw/yqtb', require('./shanghai/wsjkw/yqtb'));
+ 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', require('./sichuan/deyang/govpulicinfo'));
};
diff --git a/lib/v2/xueqiu/user.js b/lib/v2/xueqiu/user.js
index cbff540c8..7e0bc83cf 100644
--- a/lib/v2/xueqiu/user.js
+++ b/lib/v2/xueqiu/user.js
@@ -41,10 +41,11 @@ module.exports = async (ctx) => {
link: `https://xueqiu.com/u/${id}`,
description: `${data[0].user.screen_name} 的雪球${typename[type]}动态`,
item: data.map((item) => {
- const description = item.description + (item.retweeted_status ? `
${item.retweeted_status.user.screen_name}: ${item.retweeted_status.description}
` : '');
+ const retweetedStatus = item.retweeted_status ? `${item.retweeted_status.user.screen_name}: ${item.retweeted_status.description}
` : '';
+ const description = item.description + retweetedStatus;
return {
title: item.title ? item.title : description.replace(/<[^>]+>/g, ''),
- description,
+ description: item.text ? (item.text + retweetedStatus) : description,
pubDate: parseDate(item.created_at),
link: `https://xueqiu.com${item.target}`,
};