mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 14:07:54 +08:00
feat: 添加开放平台公告 (#2831)
This commit is contained in:
@@ -252,6 +252,16 @@ GitHub 官方也提供了一些 RSS:
|
||||
|
||||
</Route>
|
||||
|
||||
## 饿了么开放平台
|
||||
|
||||
### 商家开放平台公告
|
||||
|
||||
<Route author="phantomk" example="/eleme/open/announce" path="/eleme/open/announce"/>
|
||||
|
||||
### 饿百零售开放平台公告
|
||||
|
||||
<Route author="phantomk" example="/eleme/open-be/announce" path="/eleme/open-be/announce"/>
|
||||
|
||||
## 极客时间
|
||||
|
||||
### 专栏文章
|
||||
@@ -507,6 +517,24 @@ GitHub 官方也提供了一些 RSS:
|
||||
|
||||
</Route>
|
||||
|
||||
## 微信开放平台
|
||||
|
||||
### 微信开放社区-小程序公告
|
||||
|
||||
<Route author="phantomk" example="wechat-open/community/xcx-announce" path="wechat-open/community/xcx-announce"/>
|
||||
|
||||
### 微信开放社区-小游戏公告
|
||||
|
||||
<Route author="phantomk" example="wechat-open/community/xyx-announce" path="wechat-open/community/xyx-announce"/>
|
||||
|
||||
### 微信开放社区-微信支付公告
|
||||
|
||||
<Route author="phantomk" example="wechat-open/community/pay-announce" path="wechat-open/community/pay-announce"/>
|
||||
|
||||
### 微信支付-商户平台公告
|
||||
|
||||
<Route author="phantomk" example="wechat-open/pay/announce" path="wechat-open/pay/announce"/>
|
||||
|
||||
## 印记中文周刊
|
||||
|
||||
### 最新一期
|
||||
|
||||
@@ -1641,4 +1641,14 @@ router.get('/soul/:id', require('./routes/soul'));
|
||||
// 单向空间
|
||||
router.get('/owspace/read/:type?', require('./routes/owspace/read'));
|
||||
|
||||
// eleme
|
||||
router.get('/eleme/open/announce', require('./routes/eleme/open/announce'));
|
||||
router.get('/eleme/open-be/announce', require('./routes/eleme/open-be/announce'));
|
||||
|
||||
// wechat-open
|
||||
router.get('/wechat-open/community/xcx-announce', require('./routes/wechat-open/community/xcx-announce'));
|
||||
router.get('/wechat-open/community/xyx-announce', require('./routes/wechat-open/community/xyx-announce'));
|
||||
router.get('/wechat-open/community/pay-announce', require('./routes/wechat-open/community/pay-announce'));
|
||||
router.get('/wechat-open/pay/announce', require('./routes/wechat-open/pay/announce'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
19
lib/routes/eleme/open-be/announce.js
Normal file
19
lib/routes/eleme/open-be/announce.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const data = (await got({
|
||||
method: 'get',
|
||||
url: 'https://open-be.ele.me/dev/notice/list?curpage=1&perpage=200',
|
||||
})).data;
|
||||
|
||||
ctx.state.data = {
|
||||
title: '饿百零售开放平台-公告',
|
||||
link: 'https://open-be.ele.me/dev/notice',
|
||||
item: data.data.body.notice_info.map((item) => ({
|
||||
title: item.title,
|
||||
description: `更新时间: ${item.update_time}`,
|
||||
pubDate: item.create_time,
|
||||
link: `https://open-be.ele.me/dev/notice?id=${item.id}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
34
lib/routes/eleme/open/announce.js
Normal file
34
lib/routes/eleme/open/announce.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const data = (await got({
|
||||
method: 'post',
|
||||
url: 'https://app-api.shop.ele.me/arena/invoke/?method=NoticeKeeperService.getBroadcastList',
|
||||
json: true,
|
||||
data: {
|
||||
id: '5CC2B32FA6F24CF78CB300DDE2F370BE|1565511577423',
|
||||
metas: {
|
||||
appName: 'Odin',
|
||||
appVersion: '4.4.0',
|
||||
},
|
||||
service: 'NoticeKeeperService',
|
||||
method: 'getBroadcastList',
|
||||
params: {
|
||||
offset: 0,
|
||||
limit: 999,
|
||||
},
|
||||
ncp: '2.0.0',
|
||||
},
|
||||
})).data;
|
||||
|
||||
ctx.state.data = {
|
||||
title: '饿了么商家开放平台-公告',
|
||||
link: 'https://open.shop.ele.me/openapi/publicnotice/0',
|
||||
item: data.result.broadcastList.map((item) => ({
|
||||
title: item.title,
|
||||
description: '',
|
||||
pubDate: item.beginDate,
|
||||
link: `https://open.shop.ele.me/openapi/publicnotice/${item.templateId}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
30
lib/routes/wechat-open/community/pay-announce.js
Normal file
30
lib/routes/wechat-open/community/pay-announce.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { data: htmlString } = await got({
|
||||
method: 'get',
|
||||
url: 'https://developers.weixin.qq.com/community/pay/list/2',
|
||||
});
|
||||
const $ = cheerio.load(htmlString);
|
||||
const announceList = [];
|
||||
$('#article_frame > div > ul > li').each(function() {
|
||||
const $item = $(this);
|
||||
const $link = $item.find('a').attr('href');
|
||||
const time = $item.find('div > em').text();
|
||||
const title = $item.find('h2 > meta').attr('content');
|
||||
|
||||
announceList.push({
|
||||
title: title,
|
||||
link: `https://developers.weixin.qq.com${$link}`,
|
||||
description: title,
|
||||
pubDate: time,
|
||||
});
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: '微信开放社区-微信支付公告',
|
||||
link: 'https://developers.weixin.qq.com/community/pay/list/2',
|
||||
item: announceList,
|
||||
};
|
||||
};
|
||||
30
lib/routes/wechat-open/community/xcx-announce.js
Normal file
30
lib/routes/wechat-open/community/xcx-announce.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { data: htmlString } = await got({
|
||||
method: 'get',
|
||||
url: 'https://developers.weixin.qq.com/community/develop/list/2',
|
||||
});
|
||||
const $ = cheerio.load(htmlString);
|
||||
const announceList = [];
|
||||
$('#article_frame > div > ul > li').each(function() {
|
||||
const $item = $(this);
|
||||
const $link = $item.find('a').attr('href');
|
||||
const time = $item.find('div > em').text();
|
||||
const title = $item.find('h2 > meta').attr('content');
|
||||
|
||||
announceList.push({
|
||||
title: title,
|
||||
link: `https://developers.weixin.qq.com${$link}`,
|
||||
description: title,
|
||||
pubDate: time,
|
||||
});
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: '微信开放社区-小程序公告',
|
||||
link: 'https://developers.weixin.qq.com/community/develop/list/2',
|
||||
item: announceList,
|
||||
};
|
||||
};
|
||||
30
lib/routes/wechat-open/community/xyx-announce.js
Normal file
30
lib/routes/wechat-open/community/xyx-announce.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { data: htmlString } = await got({
|
||||
method: 'get',
|
||||
url: 'https://developers.weixin.qq.com/community/minigame/list/2',
|
||||
});
|
||||
const $ = cheerio.load(htmlString);
|
||||
const announceList = [];
|
||||
$('#article_frame > div > ul > li').each(function() {
|
||||
const $item = $(this);
|
||||
const $link = $item.find('a').attr('href');
|
||||
const time = $item.find('div > em').text();
|
||||
const title = $item.find('h2 > meta').attr('content');
|
||||
|
||||
announceList.push({
|
||||
title: title,
|
||||
link: `https://developers.weixin.qq.com${$link}`,
|
||||
description: title,
|
||||
pubDate: time,
|
||||
});
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: '微信开放社区-小游戏公告',
|
||||
link: 'https://developers.weixin.qq.com/community/minigame/list/2',
|
||||
item: announceList,
|
||||
};
|
||||
};
|
||||
28
lib/routes/wechat-open/pay/announce.js
Normal file
28
lib/routes/wechat-open/pay/announce.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const data = (await got({
|
||||
method: 'get',
|
||||
url:
|
||||
'https://pay.weixin.qq.com/index.php/public/cms/get_contents?id=6200&cmstype=1&url=https%253A%252F%252Fpay.weixin.qq.com%252Fpublic%252Fcms%252Fcontent_list%253Flang%253Dzh%2526id%253D6200&states=2&publishtimeend=1565537507&expiretimebeg=1565537507&propertyinclude=1&ordertype=4&field=contentId%2CcontentTitle%2CcontentPublishTime&g_ty=ajax',
|
||||
})).data.data.contentlist;
|
||||
|
||||
const data2 = (await got({
|
||||
method: 'get',
|
||||
url:
|
||||
'https://pay.weixin.qq.com/index.php/public/cms/get_contents?pagenum=1&id=6200&cmstype=1&url=https%253A%252F%252Fpay.weixin.qq.com%252Fpublic%252Fcms%252Fcontent_list%253Flang%253Dzh%2526id%253D6200&states=2&publishtimeend=1565537507&expiretimebeg=1565537507&propertyexclude=1&ordertype=4&field=contentId%2CcontentTitle%2CcontentPublishTime&g_ty=ajax',
|
||||
})).data.data.contentlist;
|
||||
|
||||
data.push(...data2);
|
||||
|
||||
ctx.state.data = {
|
||||
title: '微信支付-商户平台公告',
|
||||
link: 'https://pay.weixin.qq.com/public/cms/content_list?lang=zh&id=6200',
|
||||
item: data.map((item) => ({
|
||||
title: item.contentTitle,
|
||||
description: item.contentTitle,
|
||||
pubDate: new Date(item.contentPublishTime * 1000).toUTCString(),
|
||||
link: `https://pay.weixin.qq.com/index.php/public/cms/content_detail?platformType=0&lang=zh&id=${item.contentId}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user