[ci skip] [skip ci] Co-authored-by: codefactor-io <support@codefactor.io>
This commit is contained in:
parent
54203c59c2
commit
e2280a38f5
|
|
@ -1,7 +1,7 @@
|
|||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
//传入参数
|
||||
// 传入参数
|
||||
const id = String(ctx.params.id);
|
||||
|
||||
// 发起 HTTP GET 请求
|
||||
|
|
@ -13,7 +13,7 @@ module.exports = async (ctx) => {
|
|||
},
|
||||
});
|
||||
|
||||
//发起第二个 HTTP GET 请求,用于获取该日记的标题
|
||||
// 发起第二个 HTTP GET 请求,用于获取该日记的标题
|
||||
const response2 = await got({
|
||||
method: 'get',
|
||||
url: `https://faexport.spangle.org.uk/journal/${id}.json`,
|
||||
|
|
@ -33,7 +33,7 @@ module.exports = async (ctx) => {
|
|||
// 源说明
|
||||
description: `Fur Affinity ${data2.title} - Journal Comments`,
|
||||
|
||||
//遍历此前获取的数据
|
||||
// 遍历此前获取的数据
|
||||
item: data.map((item) => ({
|
||||
// 标题
|
||||
title: item.text,
|
||||
|
|
@ -41,10 +41,10 @@ module.exports = async (ctx) => {
|
|||
description: `<img src="${item.avatar}"> <br> ${item.name}: ${item.text}`,
|
||||
// 链接
|
||||
link: `https://www.furaffinity.net/journal/${id}/`,
|
||||
//作者
|
||||
// 作者
|
||||
author: item.name,
|
||||
//日期
|
||||
// 日期
|
||||
pubDate: new Date(item.posted_at).toUTCString(),
|
||||
})),
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ const cheerio = require('cheerio');
|
|||
|
||||
// 发起 HTTP GET 请求
|
||||
module.exports = async (ctx) => {
|
||||
//传入参数
|
||||
// 传入参数
|
||||
const username = String(ctx.params.username);
|
||||
|
||||
//添加参数username
|
||||
// 添加参数username
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `https://faexport.spangle.org.uk/user/${username}/journals.rss`,
|
||||
|
|
@ -31,7 +31,7 @@ module.exports = async (ctx) => {
|
|||
// 源说明
|
||||
description: `Fur Affinity ${username}'s Journals`,
|
||||
|
||||
//遍历此前获取的数据
|
||||
// 遍历此前获取的数据
|
||||
item:
|
||||
list &&
|
||||
list.map((index, item) => {
|
||||
|
|
@ -45,5 +45,5 @@ module.exports = async (ctx) => {
|
|||
};
|
||||
})
|
||||
.get(),
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
//传入参数
|
||||
// 传入参数
|
||||
const id = String(ctx.params.id);
|
||||
|
||||
// 发起 HTTP GET 请求
|
||||
|
|
@ -13,7 +13,7 @@ module.exports = async (ctx) => {
|
|||
},
|
||||
});
|
||||
|
||||
//发起第二个 HTTP GET 请求,用于获取该作品的标题
|
||||
// 发起第二个 HTTP GET 请求,用于获取该作品的标题
|
||||
const response2 = await got({
|
||||
method: 'get',
|
||||
url: `https://faexport.spangle.org.uk/submission/${id}.json`,
|
||||
|
|
@ -33,7 +33,7 @@ module.exports = async (ctx) => {
|
|||
// 源说明
|
||||
description: `Fur Affinity ${data2.title} - Submission Comments`,
|
||||
|
||||
//遍历此前获取的数据
|
||||
// 遍历此前获取的数据
|
||||
item: data.map((item) => ({
|
||||
// 标题
|
||||
title: item.text,
|
||||
|
|
@ -41,10 +41,10 @@ module.exports = async (ctx) => {
|
|||
description: `<img src="${item.avatar}"> <br> ${item.name}: ${item.text}`,
|
||||
// 链接
|
||||
link: `https://www.furaffinity.net/view/${id}/`,
|
||||
//作者
|
||||
// 作者
|
||||
author: item.name,
|
||||
//日期
|
||||
// 日期
|
||||
pubDate: new Date(item.posted_at).toUTCString(),
|
||||
})),
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue