feat(route): Add 福利吧最近更新内容 (#13711)

* fuliba added

* style: auto format

* doc refine for fuliba

* update per lint info

* fix some title and style

* update per SSRF concern comment

* update per SSRF concern during review

* Update lib/v2/fuliba/radar.js

Per comment on naming of title

* Update website/docs/routes/new-media.mdx

* turn to wordpress api

* Update website/docs/routes/new-media.mdx

---------

Co-authored-by: shinemoon <shinemoon@foxmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
iClaud
2023-11-08 00:43:03 +08:00
committed by GitHub
co-authored by shinemoon github-actions[bot]
parent 676e70436f
commit 04b47eff53
5 changed files with 52 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const { data: response } = await got(`https://fuliba2023.net/wp-json/wp/v2/posts`, {
searchParams: {
per_page: ctx.query.limit ?? 100,
_embed: 1,
},
});
const items = response.map((item) => ({
title: item.title.rendered,
link: item.link,
guid: item.guid.rendered,
description: item.content.rendered,
pubDate: parseDate(item.date_gmt),
author: item._embedded.author[0].name,
}));
ctx.state.data = {
title: '福利吧',
link: `https://fuliba2023.net`,
item: items,
};
};
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
'/latest': ['shinemoon'],
};
+15
View File
@@ -0,0 +1,15 @@
const fuliba = {
_name: '福利吧',
'.': [
{
title: '最新',
docs: 'https://docs.rsshub.app/routes/new-media#fuliba',
source: '/',
target: '/fuliba/latest',
},
],
};
module.exports = {
'fuliba2023.net': fuliba,
};
+3
View File
@@ -0,0 +1,3 @@
module.exports = (router) => {
router.get('/latest', require('./latest'));
};
+6
View File
@@ -3293,6 +3293,12 @@ Type 栏目:
</Route>
## 福利吧 {#fu-li-ba}
### 最新 {#fu-li-ba-zui-xin}
<Route author="shinemoon" example="/fuliba/latest" path="/fuliba/latest"/>
## 福利年 {#fu-li-nian}
### 文章 {#fu-li-nian-wen-zhang}