mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 23:00:48 +08:00
@@ -3038,7 +3038,7 @@ board 和 build 可在[这里](http://api.ineal.me/tss/status)查看
|
|||||||
### 刷屏
|
### 刷屏
|
||||||
|
|
||||||
<route name="最新" author="xyqfer" example="/weseepro/newest" path="/weseepro/newest"/>
|
<route name="最新" author="xyqfer" example="/weseepro/newest" path="/weseepro/newest"/>
|
||||||
|
<route name="最新(无中间页)" author="xyqfer yefoenix" example="/weseepro/newest-direct" path="/weseepro/newest-direct"/>
|
||||||
<route name="朋友圈" author="xyqfer" example="/weseepro/circle" path="/weseepro/circle"/>
|
<route name="朋友圈" author="xyqfer" example="/weseepro/circle" path="/weseepro/circle"/>
|
||||||
|
|
||||||
### 虎嗅
|
### 虎嗅
|
||||||
|
|||||||
@@ -933,6 +933,7 @@ router.get('/testerhome/newest', require('./routes/testerhome/newest'));
|
|||||||
|
|
||||||
// 刷屏
|
// 刷屏
|
||||||
router.get('/weseepro/newest', require('./routes/weseepro/newest'));
|
router.get('/weseepro/newest', require('./routes/weseepro/newest'));
|
||||||
|
router.get('/weseepro/newest-direct', require('./routes/weseepro/newest-direct'));
|
||||||
router.get('/weseepro/circle', require('./routes/weseepro/circle'));
|
router.get('/weseepro/circle', require('./routes/weseepro/circle'));
|
||||||
|
|
||||||
// 玩物志
|
// 玩物志
|
||||||
|
|||||||
69
lib/routes/weseepro/newest-direct.js
Normal file
69
lib/routes/weseepro/newest-direct.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
const axios = require('../../utils/axios');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const response = await axios({
|
||||||
|
method: 'get',
|
||||||
|
url: 'https://www.weseepro.com/api/v1/message/ground/spam?pageNumber=1&pageSize=20',
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = response.data.data.data;
|
||||||
|
const generateMessage = (message) => {
|
||||||
|
let name = '';
|
||||||
|
let content = '';
|
||||||
|
|
||||||
|
if (message.topMessage.account) {
|
||||||
|
name = message.topMessage.account.name;
|
||||||
|
content = message.topMessage.content.replace(/\n/g, '<br>');
|
||||||
|
}
|
||||||
|
|
||||||
|
return `
|
||||||
|
<img referrerpolicy="no-referrer" src="${message.link.img_url}"/><br><br>
|
||||||
|
<a href="${message.link.url}">${message.link.summary}</a><br><br>
|
||||||
|
<strong>${name}</strong>: ${content}<br><br>
|
||||||
|
`;
|
||||||
|
};
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: '刷屏-最新(无中间页)',
|
||||||
|
link: 'https://www.weseepro.com',
|
||||||
|
item: data.map((item) => {
|
||||||
|
let title;
|
||||||
|
let link;
|
||||||
|
let description;
|
||||||
|
let pubDate;
|
||||||
|
|
||||||
|
if (item.data.spam) {
|
||||||
|
const spam = item.data.spam;
|
||||||
|
|
||||||
|
title = spam.content;
|
||||||
|
link = spam.link.url;
|
||||||
|
description = generateMessage(spam);
|
||||||
|
pubDate = new Date(spam.spam_add_time).toUTCString();
|
||||||
|
} else if (item.data.special) {
|
||||||
|
const special = item.data.special;
|
||||||
|
const specialMessages = item.data.special_messages;
|
||||||
|
const messages = specialMessages.reduce((messages, message) => {
|
||||||
|
messages += generateMessage(message);
|
||||||
|
return messages;
|
||||||
|
}, '');
|
||||||
|
|
||||||
|
title = special.title;
|
||||||
|
link = `https://www.weseepro.com/mine/album?uuid=${special.uuid}`;
|
||||||
|
description = `
|
||||||
|
<img referrerpolicy="no-referrer" src="${special.image}"/><br><br>
|
||||||
|
${special.description}<br><br>
|
||||||
|
${messages}
|
||||||
|
`;
|
||||||
|
} else {
|
||||||
|
title = description = '未知类型,请点击<a href="https://github.com/DIYgod/RSSHub/issues">链接</a>提交issue';
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
title,
|
||||||
|
link,
|
||||||
|
description,
|
||||||
|
pubDate,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user