diff --git a/docs/en/program-update.md b/docs/en/program-update.md index 604ba87c6..c3ed1eba3 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -430,6 +430,12 @@ Refer to [#minecraft](/en/game.html#minecraft) +## RemNote + +### Changelog + + + ## RescueTime ### Release Notes diff --git a/docs/program-update.md b/docs/program-update.md index 35aa08366..542ec10e9 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -485,6 +485,12 @@ pageClass: routes +## RemNote + +### 变更日志 + + + ## RescueTime ### Release Notes diff --git a/lib/v2/remnote/changelog.js b/lib/v2/remnote/changelog.js new file mode 100644 index 000000000..6f128c5fc --- /dev/null +++ b/lib/v2/remnote/changelog.js @@ -0,0 +1,33 @@ +const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); +const FQDN = 'feedback.remnote.com'; +const apiGateway = 'https://gateway.hellonext.co'; + +module.exports = async (ctx) => { + const { data } = await got(`${apiGateway}/api/v2/changelogs`, { + headers: { + 'x-organization': FQDN, + }, + searchParams: { + page: 1, + status: 'published', + }, + }); + + const items = data.map((item) => ({ + title: item.title, + description: item.description_html, + link: `https://${FQDN}/changelog/${item.slug}`, + pubDate: parseDate(item.published_at.timestamp), + author: item.user.name, + })); + + ctx.state.data = { + title: 'Changelog | RemNote', + description: 'Vote or request new RemNote features. Subscribe to get updates about new features from RemNote.', + link: `https://${FQDN}/changelog`, + image: 'https://vault.hnxt.dev/uploads/organization_customization/favicon/3970/88153ff13b4b03492ddfee6e675228c1.png', + item: items, + language: 'en-US', + }; +}; diff --git a/lib/v2/remnote/maintainer.js b/lib/v2/remnote/maintainer.js new file mode 100644 index 000000000..8d1ec28b5 --- /dev/null +++ b/lib/v2/remnote/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/changelog': ['TonyRL'], +}; diff --git a/lib/v2/remnote/radar.js b/lib/v2/remnote/radar.js new file mode 100644 index 000000000..4acb372f7 --- /dev/null +++ b/lib/v2/remnote/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'remnote.com': { + _name: 'RemNote', + '.': [ + { + title: 'Changelog', + docs: 'https://docs.rsshub.app/program-update.html#remnote', + source: ['/changelog', '/'], + target: '/remnote/changelog', + }, + ], + }, +}; diff --git a/lib/v2/remnote/router.js b/lib/v2/remnote/router.js new file mode 100644 index 000000000..b7a79582c --- /dev/null +++ b/lib/v2/remnote/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/changelog', require('./changelog')); +};