mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
feat: 添加了必应壁纸 (#2194)
This commit is contained in:
@@ -151,3 +151,9 @@ pageClass: routes
|
||||
### 主题
|
||||
|
||||
<Route author="xyqfer" example="/dapenti/subject/184" path="/dapenti/subject/:id" :paramsDesc="['主题 id']"/>
|
||||
|
||||
## Bing 壁纸
|
||||
|
||||
### 每日壁纸
|
||||
|
||||
<Route author="FHYunCai" example="/bing" path="/bing"/>
|
||||
|
||||
@@ -1316,6 +1316,9 @@ router.get('/enclavebooks/category/:id?', require('./routes/enclavebooks/categor
|
||||
router.get('/dsndsht23/:subforumid', require('./routes/dsndsht23/index'));
|
||||
router.get('/dsndsht23', require('./routes/dsndsht23/index'));
|
||||
|
||||
// Bing壁纸
|
||||
router.get('/bing', require('./routes/bing/index'));
|
||||
|
||||
// MaxNews - DotA 2
|
||||
router.get('/maxnews/dota2', require('./routes/maxnews/dota2'));
|
||||
|
||||
|
||||
25
lib/routes/bing/index.js
Normal file
25
lib/routes/bing/index.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const axios = require('@/utils/axios');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
baseURL: 'https://cn.bing.com',
|
||||
url: '/HPImageArchive.aspx',
|
||||
params: {
|
||||
format: 'js',
|
||||
idx: 0,
|
||||
n: 7,
|
||||
mkt: 'zh-CN',
|
||||
},
|
||||
});
|
||||
const data = response.data;
|
||||
ctx.state.data = {
|
||||
title: 'Bing每日壁纸',
|
||||
link: `https://cn.bing.com/`,
|
||||
item: data.images.map((item) => ({
|
||||
title: item.copyright,
|
||||
description: `<img referrerpolicy="no-referrer" src="https://cn.bing.com${item.url}">`,
|
||||
link: item.copyrightlink,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user