feat: add Wallpaperhub (#5388)
Co-authored-by: Henry Wang <hi@henry.wang>
This commit is contained in:
parent
04ad7dd8cd
commit
2a9f35b78d
|
|
@ -122,6 +122,10 @@ pageClass: routes
|
|||
|
||||
<Route author="MegrezZhu" example="/tits-guru/category/bikini" path="/tits-guru/category/:type" :paramsDesc="['指定类别,详见[这里](https://tits-guru.com/categories)']"/>
|
||||
|
||||
## Wallpaperhub
|
||||
|
||||
<Route author="nczitzk" example="/wallpaperhub" path="/wallpaperhub" />
|
||||
|
||||
## yande.re
|
||||
|
||||
::: tip 提示
|
||||
|
|
|
|||
|
|
@ -3062,6 +3062,9 @@ router.get('/telecompaper/news/:caty/:year?/:country?/:type?/:keyword?', require
|
|||
// 水木社区
|
||||
router.get('/newsmth/account/:id', require('./routes/newsmth/account'));
|
||||
|
||||
// Wallpaperhub
|
||||
router.get('/wallpaperhub', require('./routes/wallpaperhub/index'));
|
||||
|
||||
// 悟空问答
|
||||
router.get('/wukong/user/:id', require('./routes/wukong/user'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const link = `https://wallpaperhub-fn.azurewebsites.net/api/wallpapers`;
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: link,
|
||||
});
|
||||
|
||||
const list = response.data.wallpapers.slice(0, 20).map((item) => ({
|
||||
title: item.title,
|
||||
description: `<p>${item.description}</p><img src="${item.thumbnail}">`,
|
||||
pubDate: new Date(item.publishedDate).toUTCString(),
|
||||
link: `https://wallpaperhub.app/wallpapers/${item.id}`,
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
title: `Wallpaperhub`,
|
||||
link: 'https://wallpaperhub.app/wallpapers',
|
||||
item: list,
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue