[CodeFactor] Apply fixes to commit 9d9d869 (#6925)

[ci skip] [skip ci]

Co-authored-by: codefactor-io <support@codefactor.io>
This commit is contained in:
DIYgod 2021-02-20 16:23:02 +08:00 committed by GitHub
parent 54203c59c2
commit e2280a38f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 16 deletions

View File

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

View File

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

View File

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