mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
@@ -665,6 +665,12 @@ GitHub 官方也提供了一些 RSS:
|
||||
|
||||
<Route author="tonghs" example="/manong-weekly" path="/manong-weekly" />
|
||||
|
||||
## 美团开放平台
|
||||
|
||||
### 美团开放平台公告
|
||||
|
||||
<Route author="youzipi" example="/meituan/open/announce" path="/meituan/open/announce"/>
|
||||
|
||||
## 平安银河实验室
|
||||
|
||||
### posts
|
||||
|
||||
@@ -2092,6 +2092,9 @@ router.get('/tianya/comments/:userid', require('./routes/tianya/comments'));
|
||||
router.get('/eleme/open/announce', require('./routes/eleme/open/announce'));
|
||||
router.get('/eleme/open-be/announce', require('./routes/eleme/open-be/announce'));
|
||||
|
||||
// 美团开放平台
|
||||
router.get('/meituan/open/announce', require('./routes/meituan/open/announce'));
|
||||
|
||||
// 微信开放社区
|
||||
router.get('/wechat-open/community/:type', require('./routes/tencent/wechat/wechat-open/community/announce'));
|
||||
// 微信支付 - 商户平台公告
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://developer.meituan.com/api/v1/announcement/menu-page?docKey=anno-all&pageSize=100&pageNum=1',
|
||||
});
|
||||
const docList = response.data.data.docList;
|
||||
|
||||
const url = 'https://developer.meituan.com/api/v1/doc/content';
|
||||
|
||||
// https://developer.meituan.com/api/v1/doc/content?docKey=announcement-468
|
||||
const articleList = await Promise.all(
|
||||
docList.map(async (item) => {
|
||||
const articleUrl = `${url}?docKey=${item.docKey}`;
|
||||
const cacheKey = `${articleUrl}_${item.modifyTime}`;
|
||||
|
||||
const cache = await ctx.cache.get(cacheKey);
|
||||
if (cache) {
|
||||
return Promise.resolve(JSON.parse(cache));
|
||||
} else {
|
||||
const articleResp = await got.get(articleUrl);
|
||||
const article = {
|
||||
title: item.title,
|
||||
link: `https://developer.meituan.com/isv/announcement/detail?dockey=anno-all&id=${item.docKey}`,
|
||||
description: articleResp.data.data.docDataItemDtos[0].content,
|
||||
pubDate: item.modifyTime,
|
||||
};
|
||||
ctx.cache.set(cacheKey, JSON.stringify(article));
|
||||
return Promise.resolve(article);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: '美团开放平台-公告',
|
||||
link: 'https://developer.meituan.com/isv/announcement/list',
|
||||
item: articleList.map((item) => ({
|
||||
title: item.title,
|
||||
description: item.description,
|
||||
pubDate: item.modifyTime,
|
||||
link: item.link,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user