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:
NathanDai 2023-05-13 23:36:48 +08:00 committed by GitHub
parent b0cb871b83
commit 342d333bc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 68 additions and 0 deletions

View File

@ -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

View File

@ -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 版本

37
lib/v2/firecore/index.js Normal file
View File

@ -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,
};
};

View File

@ -0,0 +1,3 @@
module.exports = {
'/:os': ['NathanDai'],
};

13
lib/v2/firecore/radar.js Normal file
View File

@ -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?',
},
],
},
};

View File

@ -0,0 +1,3 @@
module.exports = function (router) {
router.get('/:os', require('./index'));
};