mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 22:19:40 +08:00
feat: add wechat miniprogram changelogs (#4578)
This commit is contained in:
@@ -718,7 +718,21 @@ GitHub 官方也提供了一些 RSS:
|
|||||||
|
|
||||||
### 基础库更新日志
|
### 基础库更新日志
|
||||||
|
|
||||||
<Route author="magicLaLa" example="/weixin/miniprogram/release" path="/weixin/miniprogram/release"/>
|
<Route author="magicLaLa nczitzk" example="/weixin/miniprogram/framework" path="/weixin/miniprogram/framework"/>
|
||||||
|
|
||||||
|
### 开发者工具更新日志
|
||||||
|
|
||||||
|
<Route author="nczitzk" example="/weixin/miniprogram/devtools" path="/weixin/miniprogram/devtools"/>
|
||||||
|
|
||||||
|
### 云开发更新日志
|
||||||
|
|
||||||
|
<Route author="nczitzk" example="/weixin/miniprogram/wxcloud/cloud-sdk" path="/weixin/miniprogram/wxcloud/:caty?" :paramsDesc="['日志分类']">
|
||||||
|
|
||||||
|
| 小程序基础库更新日志(云开发部分) | IDE 云开发 & 云控制台更新日志 | wx-server-sdk 更新日志 |
|
||||||
|
| ---------------------------------- | ----------------------------- | ---------------------- |
|
||||||
|
| cloud-sdk | ide | server-sdk |
|
||||||
|
|
||||||
|
</Route>
|
||||||
|
|
||||||
## 印记中文周刊
|
## 印记中文周刊
|
||||||
|
|
||||||
|
|||||||
@@ -2286,7 +2286,10 @@ router.get('/scala/blog/:part?', require('./routes/scala-blog/scala-blog'));
|
|||||||
router.get('/minecraft/version', require('./routes/minecraft/version'));
|
router.get('/minecraft/version', require('./routes/minecraft/version'));
|
||||||
|
|
||||||
// 微信更新日志
|
// 微信更新日志
|
||||||
router.get('/weixin/miniprogram/release', require('./routes/tencent/wechat/miniprogram/release')); // 基础库更新
|
router.get('/weixin/miniprogram/release', require('./routes/tencent/wechat/miniprogram/framework')); // 基础库更新日志
|
||||||
|
router.get('/weixin/miniprogram/framework', require('./routes/tencent/wechat/miniprogram/framework')); // 基础库更新日志
|
||||||
|
router.get('/weixin/miniprogram/devtools', require('./routes/tencent/wechat/miniprogram/devtools')); // 开发者工具更新日志
|
||||||
|
router.get('/weixin/miniprogram/wxcloud/:caty?', require('./routes/tencent/wechat/miniprogram/wxcloud')); // 云开发更新日志
|
||||||
|
|
||||||
// 武汉肺炎疫情动态
|
// 武汉肺炎疫情动态
|
||||||
router.get('/coronavirus/caixin', require('./routes/coronavirus/caixin'));
|
router.get('/coronavirus/caixin', require('./routes/coronavirus/caixin'));
|
||||||
|
|||||||
38
lib/routes/tencent/wechat/miniprogram/devtools.js
Normal file
38
lib/routes/tencent/wechat/miniprogram/devtools.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const link = `https://developers.weixin.qq.com/miniprogram/dev/devtools/uplog.html`;
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: link,
|
||||||
|
});
|
||||||
|
const data = response.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const name = $('#docContent .content h1')
|
||||||
|
.text()
|
||||||
|
.replace(/[\s|#]/g, '');
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `${name}`,
|
||||||
|
link: link,
|
||||||
|
item: $('#docContent .content h3')
|
||||||
|
.map((_, item) => {
|
||||||
|
item = $(item);
|
||||||
|
const title = item
|
||||||
|
.text()
|
||||||
|
.replace(/[\s|#]/g, '')
|
||||||
|
.replace(/更新说明/g, '');
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
description:
|
||||||
|
(item.text().indexOf('更新说明') !== -1 ? '<h3><a href="' + item.find('a[target="_blank"]').attr('href') + '" target="_blank" rel="noopener noreferrer">更新说明<span></span></a></h3>' : '') +
|
||||||
|
item.next().html(),
|
||||||
|
pubDate: new Date(title + ' GMT+8').toUTCString(),
|
||||||
|
link: link + item.find('a.header-anchor').attr('href'),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
description: `${name}`,
|
||||||
|
};
|
||||||
|
};
|
||||||
33
lib/routes/tencent/wechat/miniprogram/framework.js
Normal file
33
lib/routes/tencent/wechat/miniprogram/framework.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const link = `https://developers.weixin.qq.com/miniprogram/dev/framework/release/`;
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: link,
|
||||||
|
});
|
||||||
|
const data = response.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const name = $('#docContent .content h1')
|
||||||
|
.text()
|
||||||
|
.replace(/[\s|#]/g, '');
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `${name}`,
|
||||||
|
link: link,
|
||||||
|
item: $('#docContent .content h3')
|
||||||
|
.map((_, item) => {
|
||||||
|
item = $(item);
|
||||||
|
const title = item.text().replace(/[\s|#]/g, '');
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
description: item.next().html(),
|
||||||
|
pubDate: new Date(new RegExp(/\d{4}-\d{2}-\d{2}/).exec(title) + ' GMT+8').toUTCString(),
|
||||||
|
link: link + item.find('a.header-anchor').attr('href'),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
description: `${name}`,
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
const got = require('@/utils/got');
|
|
||||||
const cheerio = require('cheerio');
|
|
||||||
|
|
||||||
module.exports = async (ctx) => {
|
|
||||||
const link = 'https://developers.weixin.qq.com/miniprogram/dev/framework/release/';
|
|
||||||
const response = await got({
|
|
||||||
method: 'get',
|
|
||||||
url: link,
|
|
||||||
});
|
|
||||||
const data = response.data;
|
|
||||||
const $ = cheerio.load(data);
|
|
||||||
const name = $('#docContent .content h1')
|
|
||||||
.text()
|
|
||||||
.replace(/[\s|#]/g, '');
|
|
||||||
const titles = $('#docContent .content h3').map((i, ele) =>
|
|
||||||
$(ele)
|
|
||||||
.text()
|
|
||||||
.replace(/[\s|#]/g, '')
|
|
||||||
);
|
|
||||||
const list = $('#docContent > .content ol')
|
|
||||||
.map((i, ele) => ({
|
|
||||||
title: titles[i],
|
|
||||||
description: $(ele).html(),
|
|
||||||
}))
|
|
||||||
.get();
|
|
||||||
|
|
||||||
ctx.state.data = {
|
|
||||||
title: `${name}最新动态`,
|
|
||||||
link: link,
|
|
||||||
item: list,
|
|
||||||
description: '基础库更新日志RSS',
|
|
||||||
};
|
|
||||||
};
|
|
||||||
47
lib/routes/tencent/wechat/miniprogram/wxcloud.js
Normal file
47
lib/routes/tencent/wechat/miniprogram/wxcloud.js
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const link = `https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference/changelog` + (ctx.params.caty ? '-' + ctx.params.caty : '') + `.html`;
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: link,
|
||||||
|
});
|
||||||
|
const data = response.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const name = $('#docContent .content h2').text();
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `${name}`,
|
||||||
|
link: link,
|
||||||
|
item: ctx.params.caty
|
||||||
|
? $('#docContent .content h3')
|
||||||
|
.map((_, item) => {
|
||||||
|
item = $(item);
|
||||||
|
const title = item.text().replace(/[\s|#]/g, '');
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
description: item.next().html(),
|
||||||
|
pubDate: new Date(new RegExp(/\d{4}.\d{2}.\d{2}/).exec(title) + ' GMT+8').toUTCString(),
|
||||||
|
link: link + item.find('a.header-anchor').attr('href'),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get()
|
||||||
|
: $('#docContent .custom')
|
||||||
|
.map((_, item) => {
|
||||||
|
$('#docContent .custom h2').remove();
|
||||||
|
const title = $('#docContent .custom h3')
|
||||||
|
.first()
|
||||||
|
.text()
|
||||||
|
.replace(/[\s|#]/g, '');
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
description: $(item).html(),
|
||||||
|
pubDate: new Date(new RegExp(/\d{4}.\d{2}.\d{2}/).exec(title) + ' GMT+8').toUTCString(),
|
||||||
|
link: link,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
description: `${name}`,
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user