diff --git a/docs/en/program-update.md b/docs/en/program-update.md index 5e2724897e..aea1f05f93 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -70,6 +70,12 @@ The owner of the official image fills in the library, for example: https://rsshu ::: +## Everything + +### Changes + + + ## F-Droid ### App Update diff --git a/docs/program-update.md b/docs/program-update.md index 1db285b943..c2be76ad56 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -116,6 +116,12 @@ pageClass: routes ::: +## Everything + +### Changes + + + ## F-Droid ### App 更新 diff --git a/lib/router.js b/lib/router.js index 63e2ba918a..b58e89adb5 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3519,6 +3519,9 @@ router.get('/uisdc/news', require('./routes/uisdc/news')); router.get('/uisdc/zt/:title?', require('./routes/uisdc/zt')); router.get('/uisdc/topic/:title?/:sort?', require('./routes/uisdc/topic')); +// Everything +router.get('/everything/changes', require('./routes/everything/changes')); + // 中国劳工通讯 router.get('/clb/commentary/:lang?', require('./routes/clb/commentary')); diff --git a/lib/routes/everything/changes.js b/lib/routes/everything/changes.js new file mode 100644 index 0000000000..926f8a3624 --- /dev/null +++ b/lib/routes/everything/changes.js @@ -0,0 +1,33 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const rootUrl = 'https://www.voidtools.com/Changes.txt'; + + const response = await got({ + method: 'get', + url: rootUrl, + }); + + const items = response.data + .replace(/\t\n|\t\n\n/g, '\n\n') + .split('\n\n') + .map((item) => { + item = item.indexOf('\n') === 0 ? item.substr(2, item.length - 2) : item; + + const title = item.split('\n')[0].split(':'); + const description = item.split(title[1])[1].replace(/\t/g, '
  • ').replace(/\n/g, '
  • '); + + return { + description, + link: rootUrl, + title: title[1], + pubDate: new Date(title[0]).toUTCString(), + }; + }); + + ctx.state.data = { + title: 'Everything - Changes', + link: rootUrl, + item: items, + }; +};