diff --git a/docs/en/program-update.md b/docs/en/program-update.md index b79aa6628..604ba87c6 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -531,6 +531,12 @@ Language +## WziFile + +### Version History + + + ## X410 ### News diff --git a/docs/program-update.md b/docs/program-update.md index ff23d3ff0..9c683a31f 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -618,6 +618,12 @@ pageClass: routes +## WziFile + +### 更新日志 + + + ## X410 ### News diff --git a/lib/v2/wizfile/index.js b/lib/v2/wizfile/index.js new file mode 100644 index 000000000..b653bcd32 --- /dev/null +++ b/lib/v2/wizfile/index.js @@ -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, + }; +}; diff --git a/lib/v2/wizfile/maintainer.js b/lib/v2/wizfile/maintainer.js new file mode 100644 index 000000000..0bf2a37e0 --- /dev/null +++ b/lib/v2/wizfile/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/updates': ['Fatpandac'], +}; diff --git a/lib/v2/wizfile/radar.js b/lib/v2/wizfile/radar.js new file mode 100644 index 000000000..fe43e38ac --- /dev/null +++ b/lib/v2/wizfile/radar.js @@ -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', + }, + ], + }, +}; diff --git a/lib/v2/wizfile/router.js b/lib/v2/wizfile/router.js new file mode 100644 index 000000000..59ad5f60b --- /dev/null +++ b/lib/v2/wizfile/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/updates', require('./index')); +};