feat(route): add Infuse Release Notes (#12500)
* feat(route): add Infuse Release Notes * Update lib/v2/firecore/maintainer.js * Update lib/v2/firecore/index.js * Update docs/en/program-update.md * Update lib/v2/firecore/radar.js ---------
This commit is contained in:
parent
b0cb871b83
commit
342d333bc7
|
|
@ -306,6 +306,12 @@ Language
|
|||
|
||||
<RouteEn author="nczitzk" example="/imagemagick/changelog" path="/imagemagick/changelog"/>
|
||||
|
||||
## Infuse
|
||||
|
||||
### Release Notes
|
||||
|
||||
<RouteEn author="NathanDai" example="/firecore/iOS" path="/firecore/:os" :paramsDesc="['`iOS`,`atv`,`mac`']"/>
|
||||
|
||||
## IPSW.me
|
||||
|
||||
### Apple Firmware Update-IPSWs/OTAs version
|
||||
|
|
|
|||
|
|
@ -338,6 +338,12 @@ pageClass: routes
|
|||
|
||||
<Route author="nczitzk" example="/imagemagick/changelog" path="/imagemagick/changelog"/>
|
||||
|
||||
## Infuse
|
||||
|
||||
### Release Notes
|
||||
|
||||
<Route author="NathanDai" example="/firecore/iOS" path="/firecore/:os" :paramsDesc="['`iOS`,`atv`,`mac`']"/>
|
||||
|
||||
## IPSW\.me
|
||||
|
||||
### 苹果固件更新 - IPSWs/OTAs 版本
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const host = 'https://firecore.com/releases';
|
||||
const { data } = await got(host);
|
||||
const $ = cheerio.load(data);
|
||||
const items = $(`div.tab-pane.fade#${ctx.params.os}`)
|
||||
.find('.release-date')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const title = item
|
||||
.parent()
|
||||
.contents()
|
||||
.filter((_, el) => el.nodeType === 3)
|
||||
.text();
|
||||
const pubDate = parseDate(item.text().match(/(\d{4}-\d{2}-\d{2})/)[1]);
|
||||
|
||||
const next = item.parent().nextUntil('hr');
|
||||
return {
|
||||
title,
|
||||
description: next
|
||||
.toArray()
|
||||
.map((item) => $(item).html())
|
||||
.join(''),
|
||||
pubDate,
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'Infuse Release Notes',
|
||||
link: 'https://firecore.com/releases',
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/:os': ['NathanDai'],
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'firecore.com': {
|
||||
_name: 'Infuse',
|
||||
'.': [
|
||||
{
|
||||
title: 'Release Notes',
|
||||
docs: 'https://docs.rsshub.app/program-update.html#infuse',
|
||||
source: ['/releases', '/'],
|
||||
target: '/firecore/:os?',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/:os', require('./index'));
|
||||
};
|
||||
Loading…
Reference in New Issue