feat(route): add WizFile (#10474)
This commit is contained in:
parent
34c0bdee51
commit
d3aa59447a
|
|
@ -531,6 +531,12 @@ Language
|
|||
|
||||
<RouteEn author="nczitzk" example="/diskanalyzer/whats-new" path="/diskanalyzer/whats-new"/>
|
||||
|
||||
## WziFile
|
||||
|
||||
### Version History
|
||||
|
||||
<RouteEn author="Fatpandac" example="/wizfile/updates" path="/wizfile/updates"/>
|
||||
|
||||
## X410
|
||||
|
||||
### News
|
||||
|
|
|
|||
|
|
@ -618,6 +618,12 @@ pageClass: routes
|
|||
|
||||
<Route author="nczitzk" example="/diskanalyzer/whats-new" path="/diskanalyzer/whats-new"/>
|
||||
|
||||
## WziFile
|
||||
|
||||
### 更新日志
|
||||
|
||||
<Route author="Fatpandac" example="/wizfile/updates" path="/wizfile/updates"/>
|
||||
|
||||
## X410
|
||||
|
||||
### News
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
const rootUrl = 'https://antibody-software.com';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const currentUrl = `${rootUrl}/wizfile/download`;
|
||||
|
||||
const response = await got(currentUrl);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const items = $('section.blog-section > div > div > div > h4')
|
||||
.map((_, item) => {
|
||||
const title = $(item)
|
||||
.text()
|
||||
.replace(/\(.*?\)/, '');
|
||||
const pubDate = parseDate(
|
||||
$(item)
|
||||
.find('span')
|
||||
.text()
|
||||
.match(/\((.*?)\)/)[1]
|
||||
);
|
||||
|
||||
const description = $(item).next().html();
|
||||
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
pubDate,
|
||||
guid: `${currentUrl}${title}`,
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: `WziFile - 更新日志`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/updates': ['Fatpandac'],
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'antibody-software.com': {
|
||||
_name: 'WizFile',
|
||||
'.': [
|
||||
{
|
||||
title: '更新日志',
|
||||
docs: 'https://docs.rsshub.app/new-media.html#wei-ji-xin-wen',
|
||||
source: ['/wizfile/download'],
|
||||
target: '/wizfile/updates',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/updates', require('./index'));
|
||||
};
|
||||
Loading…
Reference in New Issue