mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-06 21:18:57 +08:00
Update watchers.js
This commit is contained in:
@@ -5,8 +5,7 @@ module.exports = async (ctx) => {
|
||||
//传入参数
|
||||
const username = String(ctx.params.username);
|
||||
|
||||
// 添加参数keyword以及判断传入的参数sfw
|
||||
|
||||
//添加参数username
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `https://faexport.spangle.org.uk/user/${username}/watchers.json`,
|
||||
@@ -15,7 +14,18 @@ module.exports = async (ctx) => {
|
||||
},
|
||||
});
|
||||
|
||||
//发起第二个HTTP GET请求,用于获取被关注总数
|
||||
const response2 = await got({
|
||||
method: 'get',
|
||||
url: `https://faexport.spangle.org.uk/user/${username}.json`,
|
||||
headers: {
|
||||
Referer: `https://faexport.spangle.org.uk/`,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const data = response.data;
|
||||
const data2 = response2.data;
|
||||
|
||||
ctx.state.data = {
|
||||
// 源标题
|
||||
@@ -30,10 +40,10 @@ module.exports = async (ctx) => {
|
||||
// 标题
|
||||
title: item,
|
||||
// 正文
|
||||
description: `${username} was watched by ${item}`,
|
||||
description: `${username} was watched by ${item} <br> Totall: ${data2.watchers.count} `,
|
||||
// 链接
|
||||
link: `https://www.furaffinity.net/user/${item}/`,
|
||||
//由于源API未提供日期,故无pubDate
|
||||
})),
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user