mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: add everything changes (#6363)
This commit is contained in:
@@ -70,6 +70,12 @@ The owner of the official image fills in the library, for example: https://rsshu
|
||||
|
||||
:::
|
||||
|
||||
## Everything
|
||||
|
||||
### Changes
|
||||
|
||||
<RouteEn author="nczitzk" example="/everything/changes" path="/everything/changes"/>
|
||||
|
||||
## F-Droid
|
||||
|
||||
### App Update
|
||||
|
||||
@@ -116,6 +116,12 @@ pageClass: routes
|
||||
|
||||
:::
|
||||
|
||||
## Everything
|
||||
|
||||
### Changes
|
||||
|
||||
<Route author="nczitzk" example="/everything/changes" path="/everything/changes"/>
|
||||
|
||||
## F-Droid
|
||||
|
||||
### App 更新
|
||||
|
||||
@@ -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'));
|
||||
|
||||
|
||||
@@ -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, '<li>').replace(/\n/g, '</li>');
|
||||
|
||||
return {
|
||||
description,
|
||||
link: rootUrl,
|
||||
title: title[1],
|
||||
pubDate: new Date(title[0]).toUTCString(),
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'Everything - Changes',
|
||||
link: rootUrl,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user