diff --git a/assets/radar-rules.js b/assets/radar-rules.js index cdf9f2e79..c18c18027 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -2068,4 +2068,15 @@ }, ], }, + 'ems.com.cn': { + _name: '中国邮政速递物流', + www: [ + { + title: '新闻', + docs: 'https://docs.rsshub.app/other.html#zhong-guo-you-zheng-su-di-wu-liu', + source: '/aboutus/xin_wen_yu_shi_jian.html', + target: '/ems/news', + }, + ], + }, }); diff --git a/docs/other.md b/docs/other.md index 2246a55c1..4fdecabce 100644 --- a/docs/other.md +++ b/docs/other.md @@ -627,8 +627,8 @@ type 为 all 时,category 参数不支持 cost 和 free ### 源仓库更新 -| 阅读 | 异次元 | 海阔 | -| ---- | ----- | ---- | +| 阅读 | 异次元 | 海阔 | +| ---- | ----- | ---- | | yuedu | yiciyuan | haikuo | @@ -681,6 +681,12 @@ type 为 all 时,category 参数不支持 cost 和 free +## 中国邮政速递物流 + +### 新闻 + + + ## 自如 ### 房源 diff --git a/lib/router.js b/lib/router.js index a7c883a05..4372e7750 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2861,6 +2861,9 @@ router.get('/jike/user/:id', require('./routes/jike/user')); // 网易新闻 router.get('/netease/news/rank/:category?/:type?/:time?', require('./routes/netease/news/rank')); +// 中国邮政速递物流 +router.get('/ems/news', require('./routes/ems/news')); + // 场库 router.get('/changku', require('./routes/changku/index')); diff --git a/lib/routes/ems/news.js b/lib/routes/ems/news.js new file mode 100644 index 000000000..7a930c9ea --- /dev/null +++ b/lib/routes/ems/news.js @@ -0,0 +1,21 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const response = await got({ + method: 'get', + url: 'http://www.ems.com.cn/ems/news/listNews', + }); + + const items = response.data.map((item) => ({ + title: item.title, + link: `http://www.ems.com.cn/ems/news/viewNews?id=${item.id}`, + pubDate: item.postDate, + description: item.content, + })); + + ctx.state.data = { + title: '中国邮政速递物流', + link: 'http://www.ems.com.cn/', + item: items, + }; +};