feat: add Wallpaperhub (#5388)

Co-authored-by: Henry Wang <hi@henry.wang>
This commit is contained in:
Ethan Shen 2020-08-19 04:36:30 +08:00 committed by GitHub
parent 04ad7dd8cd
commit 2a9f35b78d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions

View File

@ -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 提示

View File

@ -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'));

View File

@ -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,
};
};